/**
 * Global Top Bar Styles
 * 
 * @package Above_the_Canal
 * @since 1.0.0
 */

/* Global Top Bar Container */
.abc-global-top-bar {
    background: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative !important;
    z-index: 9999 !important;
    height: 80px; /* Increased height for better visibility */
    width: 100% !important; /* Full width - now outside content area */
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 1rem 0 !important;
    margin: 0 !important;
}
  
  /* Desktop layout (above 1024px) */
  @media (min-width: 1025px) {
    .abc-top-bar-container {
      justify-content: space-between;
    }
  }
  
  .abc-top-bar-container {
    display: flex !important;
    align-items: center !important;
    height: 100%;
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 1rem !important;
    gap: 2rem !important;
    visibility: visible !important;
  }
  
  /* Logo Section */
  .abc-top-bar-logo {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
    min-width: 0;
  }
  
  .abc-logo-link {
    display: flex;
    align-items: center;
    height: 100%;
    text-decoration: none;
    flex-shrink: 0;
  }
  
  .abc-logo-image {
    height: 80px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
  }
  
  /* Ensure logo sizing on WooCommerce pages */
  body.woocommerce-account .abc-logo-image,
  body.woocommerce-page .abc-logo-image,
  body.woocommerce .abc-logo-image {
    height: 80px !important;
    width: auto !important;
    max-width: 200px !important;
    max-height: 80px !important;
    object-fit: contain !important;
    display: block !important;
  }
  
  /* Search Section */
  .abc-top-bar-search {
    flex: 1;
    max-width: 600px;
    margin: 0 1rem;
    min-width: 0;
  }
  
  .abc-top-bar-search .abc-search-container {
    max-width: 100%;
  }
  
  .abc-top-bar-search .abc-search-input-wrapper {
    height: 50px;
  }
  
  .abc-top-bar-search .abc-search-input {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  .abc-top-bar-search .abc-search-button {
    padding: 8px 12px;
    font-size: 14px;
  }
  
  /* Account and Cart Group */
  .abc-top-bar-nav-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    min-width: 0;
  }
  
  /* Account Section */
  .abc-top-bar-account {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
  }
  
  /* Account Dropdown */
  .abc-account-dropdown {
    position: relative;
    height: 100%;
  }
  
  .abc-account-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.25rem 0.75rem !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    color: #333 !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    text-decoration: none !important;
    height: 100% !important;
    white-space: normal !important;
    transition: background-color 0.2s ease !important;
    transform: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .abc-account-toggle:hover {
    background: #f8f9fa !important;
    background-color: #f8f9fa !important;
    color: #333 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .abc-account-icon {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
  }
  
  .abc-account-text {
    display: none;
  }
  
  .abc-account-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
  }
  
  .abc-account-menu-open .abc-account-arrow {
    transform: rotate(180deg);
  }
  
  /* Account Menu Dropdown */
  .abc-account-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 175px;
    min-width: 175px;
    z-index: 1001;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
  }
  
  .abc-account-menu-open {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  .abc-account-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-account-menu .abc-account-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-account-menu-item {
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-account-menu .abc-account-menu-item.woocommerce-MyAccount-navigation-link {
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-account-menu-link {
    display: block;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .abc-account-menu-link:hover {
    background: #f8f9fa;
    color: #0073aa;
  }
  
  .abc-account-menu-item.is-active .abc-account-menu-link {
    background: #0073aa;
    color: #fff;
  }
  
  .abc-account-menu-item:last-child .abc-account-menu-link {
    border-bottom: none;
  }
  
  /* Login Dropdown (for non-logged-in users) */
  .abc-login-dropdown {
    position: relative;
    height: 100%;
  }
  
  .abc-login-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #333;
    font-size: 20px;
    font-weight: 500;
    text-decoration: none;
    height: 100%;
    transition: background-color 0.2s ease;
    transform: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .abc-login-link:hover {
    background: #f8f9fa;
    color: #333;
    transform: none !important;
    box-shadow: none !important;
    text-decoration: none;
  }
  
  /* Legacy: Keep for backwards compatibility if needed */
  .abc-login-toggle {
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    padding: 0.25rem 0.75rem !important;
    background: none !important;
    background-color: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    cursor: pointer !important;
    color: #333 !important;
    font-size: 20px !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    text-decoration: none !important;
    height: 100% !important;
    white-space: normal !important;
    transition: background-color 0.2s ease !important;
    transform: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
  }
  
  .abc-login-toggle:hover {
    background: #f8f9fa !important;
    background-color: #f8f9fa !important;
    color: #333 !important;
    transform: none !important;
    box-shadow: none !important;
  }
  
  .abc-login-icon {
    width: 28px;
    height: 28px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
  }
  
  .abc-login-text {
    display: none;
  }
  
  .abc-login-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
  }
  
  .abc-login-menu-open .abc-login-arrow {
    transform: rotate(180deg);
  }
  
  /* Login Menu Dropdown */
  .abc-login-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 180px;
    min-width: 180px;
    z-index: 1001;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
  }
  
  .abc-login-menu-open {
    display: block !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  .abc-login-menu .abc-login-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-login-menu .abc-login-menu-item {
    margin: 0;
    padding: 0;
    width: 100%;
  }
  
  .abc-login-menu-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .abc-login-menu-link:hover {
    background: #f8f9fa;
    color: #0073aa;
  }
  
  .abc-login-menu-item:last-child .abc-login-menu-link {
    border-bottom: none;
  }
  
  .abc-login-menu-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
  }
  
  .abc-login-menu-text {
    flex: 1;
  }
  
  /* Cart Section */
  .abc-top-bar-cart {
    flex-shrink: 0;
    height: 100%;
    display: flex;
    align-items: center;
  }
  
  .abc-cart-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    color: #333;
    text-decoration: none;
    font-size: 20px;
    font-weight: 500;
    height: 100%;
    transition: background-color 0.2s ease;
    position: relative;
  }
  
  .abc-cart-link:hover {
    background: #f8f9fa;
    color: #333;
    text-decoration: none;
  }
  
  .abc-cart-icon {
    font-size: 28px;
  }
  
  .abc-cart-text {
    display: none;
  }
  
  .abc-cart-count {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: #dc3545;
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    padding: 0.125rem 0.25rem;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
  }
  
  /* Tablet Responsive (768px - 1024px) */
  @media (min-width: 768px) and (max-width: 1024px) {
    .abc-global-top-bar {
      height: 80px;
    }
    
    .abc-top-bar-container {
      justify-content: space-between;
    }
    
    .abc-logo-image {
      height: 80px;
      max-width: 150px;
    }
    
    .abc-top-bar-search {
      max-width: 400px;
      margin: 0 0.75rem;
    }
    
    .abc-top-bar-search .abc-search-input-wrapper {
      height: 45px;
    }
    
    .abc-account-text,
    .abc-cart-text {
      display: inline;
      font-size: 20px;
    }
    
    .abc-login-link .abc-login-text,
    .abc-register-link .abc-register-text {
      display: inline;
      font-size: 20px;
    }
    
    .abc-account-icon,
    .abc-login-icon {
      width: 32px;
      height: 32px;
    }
    
    .abc-cart-icon {
      font-size: 32px;
    }
    
    .abc-account-toggle,
    .abc-cart-link {
      padding: 0.5rem 1rem;
      font-size: 20px;
      height: 100%;
      display: flex;
      align-items: center;
    }
    
    .abc-login-text {
      display: inline;
      font-size: 20px;
    }
    
    .abc-login-toggle,
    .abc-login-link {
      padding: 0.5rem 1rem;
      font-size: 20px;
      height: 100%;
      display: flex;
      align-items: center;
    }
  }
  
  /* Mobile Responsive (up to 767px) */
  @media (max-width: 767px) {
    .abc-top-bar-container {
      padding: 0 0.5rem;
      gap: 0.25rem;
      justify-content: flex-start;
    }
    
    .abc-logo-image {
      height: 80px;
      max-width: 120px;
    }
    
    .abc-top-bar-search {
      margin: 0 0.25rem;
      max-width: none;
      flex: 1;
      min-width: 0;
    }
    
    .abc-top-bar-search .abc-search-input-wrapper {
      height: 40px;
    }
    
    .abc-top-bar-search .abc-search-input {
      font-size: 16px; /* Prevents zoom on iOS */
      padding: 6px 10px;
    }
    
    .abc-top-bar-search .abc-search-button {
      padding: 6px 10px;
      font-size: 14px;
    }
    
    .abc-top-bar-nav-group {
      gap: 0.125rem;
      flex-shrink: 0;
      min-width: 80px;
    }
    
    .abc-account-toggle,
    .abc-cart-link {
      padding: 0.25rem;
      font-size: 16px;
      min-height: 44px;
      min-width: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .abc-login-toggle,
    .abc-login-link {
      padding: 0.25rem;
      font-size: 16px;
      min-height: 44px;
      min-width: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .abc-account-icon,
    .abc-login-icon {
      width: 20px;
      height: 20px;
    }
    
    .abc-cart-icon {
      font-size: 20px;
    }
    
    .abc-account-menu {
      width: 160px;
      min-width: 160px;
      right: -0.5rem;
    }
    
    .abc-account-menu-link {
      padding: 0.5rem 0.75rem;
      font-size: 13px;
    }
    
    .abc-cart-count {
      font-size: 9px;
      min-width: 14px;
      height: 14px;
      top: 0.125rem;
      right: 0.125rem;
    }
  }
  
  /* Small Mobile (up to 480px) */
  @media (max-width: 480px) {
    .abc-top-bar-container {
      padding: 0 0.25rem;
      gap: 0.125rem;
      justify-content: flex-start;
    }
    
    .abc-logo-image {
      height: 80px;
      max-width: 100px;
    }
    
    .abc-top-bar-search {
      margin: 0 0.125rem;
      flex: 1;
      min-width: 0;
    }
    
    .abc-top-bar-search .abc-search-input-wrapper {
      height: 35px;
    }
    
    .abc-top-bar-search .abc-search-input {
      font-size: 14px;
      padding: 5px 8px;
    }
    
    .abc-top-bar-search .abc-search-button {
      padding: 5px 8px;
      font-size: 12px;
    }
    
    .abc-top-bar-nav-group {
      gap: 0.125rem;
      flex-shrink: 0;
      min-width: 70px;
    }
    
    .abc-account-toggle,
    .abc-cart-link {
      padding: 0.125rem;
      font-size: 14px;
      min-height: 44px;
      min-width: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .abc-login-toggle,
    .abc-login-link {
      padding: 0.125rem;
      font-size: 14px;
      min-height: 44px;
      min-width: 44px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    
    .abc-account-icon,
    .abc-login-icon {
      width: 18px;
      height: 18px;
    }
    
    .abc-cart-icon {
      font-size: 18px;
    }
    
    .abc-account-menu {
      width: 140px;
      min-width: 140px;
      right: -0.25rem;
    }
    
    .abc-account-menu-link {
      padding: 0.4rem 0.5rem;
      font-size: 12px;
    }
    
    .abc-cart-count {
      font-size: 8px;
      min-width: 12px;
      height: 12px;
      top: 0.1rem;
      right: 0.1rem;
    }
  }
  
  /* Dark mode support */
  @media (prefers-color-scheme: dark) {
    .abc-global-top-bar {
      background: #2d2d2d;
      border-color: #444;
    }
    
    .abc-account-toggle,
    .abc-cart-link,
    .abc-login-link {
      color: #fff;
    }
    
    .abc-account-toggle:hover,
    .abc-cart-link:hover,
    .abc-login-link:hover {
      background: #3d3d3d;
      color: #fff;
      text-decoration: none;
    }
    
    .abc-account-menu {
      background: #2d2d2d;
      border-color: #444;
    }
    
    .abc-account-menu-link {
      color: #fff;
    }
    
    .abc-account-menu-link:hover {
      background: #3d3d3d;
      color: #4a9eff;
    }
  }