/* Top Bar Responsive */
@media (max-width: 1189px) {
    .top-bar {
        padding: 10px 0;
    }

    .top-bar-content {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 20px;
        text-align: center;
    }

    .top-bar-left {
        justify-content: center;
        font-size: 12px;
    }

    .top-bar-left span {
        display: none;
    }

    .top-menu {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
        font-size: 12px;
    }

    .top-bar-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .phone-link {
        font-size: 16px;
    }

    .social-links {
        gap: 10px;
    }
}

@media (max-width: 768px) {
    .top-bar {
        padding: 8px 0;
    }

    .top-bar-content {
        padding: 0 15px;
        gap: 10px;
    }

    .top-menu {
        gap: 10px;
        font-size: 11px;
    }

    .top-menu li {
        display: inline-block;
    }

    .phone-link span {
        display: none;
    }

    .phone-link .phone-icon {
        font-size: 18px;
    }

    .social-links a {
        font-size: 14px;
    }
}

/* Main Header Responsive */
@media (max-width: 1189px) {
    .main-header {
        position: sticky;
        top: 0;
        z-index: 1000;
        background: #fff;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .header-content {
        grid-template-columns: auto 1fr auto;
        padding: 0 15px;
        height: 70px !important;
        min-height: 70px !important;
        max-height: 70px !important;
        gap: 10px;
        align-items: center !important;
        justify-items: start;
        position: relative;
    }

    .mobile-menu-btn {
        display: flex !important;
        z-index: 10001;
        position: relative !important;
        background: none !important;
        border: none !important;
        font-size: 22px !important;
        cursor: pointer;
        color: var(--primary-green) !important;
        padding: 0 !important;
        margin: 0 !important;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        max-width: 40px !important;
        max-height: 40px !important;
        grid-column: 1;
        transition: color 0.2s ease;
        align-self: center !important;
        vertical-align: middle;
        line-height: 1 !important;
        box-sizing: border-box !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        transform: none !important;
    }
    
    .mobile-menu-btn i {
        display: inline-block !important;
        width: auto !important;
        height: auto !important;
        line-height: 1 !important;
        vertical-align: middle !important;
        margin: 0 !important;
        padding: 0 !important;
        font-size: 22px !important;
        position: relative;
    }
    
    .mobile-menu-btn:active,
    .mobile-menu-btn:focus {
        transform: none !important;
        outline: none !important;
    }
    
    .mobile-menu-btn:hover {
        color: var(--accent-green) !important;
    }
    
    /* Prevent button from moving */
    .mobile-menu-btn,
    .mobile-menu-btn * {
        box-sizing: border-box !important;
    }

    /* Hide desktop nav menus by default */
    .main-header > .header-content > nav:first-of-type {
        display: none !important;
    }

    .header-actions > nav {
        display: none !important;
    }
    
    /* Show nav when menu is open - override via JavaScript inline styles */
    .main-header > .header-content > nav:first-of-type[style*="display"],
    .header-actions > nav[style*="display"] {
        display: block !important;
        position: static !important;
    }

    /* Override custom.css hiding of nav-menu - must be very specific */
    .main-header nav ul.nav-menu:not(.menu-open),
    .header-actions nav ul.nav-menu:not(.menu-open) {
        display: none !important;
    }

    /* Mobile menu container - show both nav menus when open - maximum specificity */
    ul.nav-menu.menu-open,
    .main-header nav ul.nav-menu.menu-open,
    .header-actions nav ul.nav-menu.menu-open,
    .main-header > .header-content > nav ul.nav-menu.menu-open,
    .header-actions > nav ul.nav-menu.menu-open {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #fff !important;
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        padding: 0 !important;
        z-index: 9999 !important;
        margin: 0 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        visibility: visible !important;
        opacity: 1 !important;
        box-sizing: border-box !important;
        -webkit-overflow-scrolling: touch !important;
    }

    /* First nav menu */
    .main-header > .header-content > nav:first-of-type ul.nav-menu.menu-open {
        border-top: 1px solid #eee;
    }

    /* Second nav menu (in header-actions) - position it right after first menu */
    .header-actions > nav ul.nav-menu.menu-open {
        border-top: 2px solid #ddd;
    }

    .nav-item {
        width: 100%;
        height: auto;
        border-bottom: 1px solid #f0f0f0;
        box-sizing: border-box;
        margin: 0;
    }

    .nav-link {
        width: 100%;
        padding: 16px 20px;
        justify-content: flex-start;
        font-size: 15px;
        font-weight: 600;
        box-sizing: border-box;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        transition: background-color 0.2s;
        margin: 0;
    }
    
    .nav-link:active {
        background-color: #f5f5f5;
    }

    .nav-icon {
        font-size: 18px;
        margin-right: 10px;
    }

    .dropdown {
        position: static;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        border-radius: 0;
        margin-top: 0;
        padding: 0;
        background: #f9f9f9;
        display: none;
    }

    .nav-item:hover .dropdown,
    .nav-item.active .dropdown {
        display: block;
    }

    .dropdown a {
        padding: 12px 40px;
        font-size: 13px;
        border-bottom: 1px solid #eee;
    }

    .logo {
        order: 2;
        text-align: center;
        grid-column: 2;
        justify-self: center;
        align-self: center;
        margin: 0;
    }

    .logo h2 {
        font-size: 18px;
        margin: 0;
        line-height: 1.2;
    }
    
    .logo a {
        display: inline-block;
    }

    .header-actions {
        order: 3;
        gap: 8px;
        font-size: 16px;
        grid-column: 3;
        justify-self: end;
        align-self: center;
        display: flex;
        align-items: center;
    }

    .icon-btn {
        padding: 8px;
        font-size: 16px;
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
        transition: background-color 0.2s;
    }
    
    .icon-btn:active {
        background-color: rgba(0, 0, 0, 0.05);
    }
    
    a.icon-btn {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Google Translate in mobile */
    #google_translate_element {
        display: none;
    }
}

@media (max-width: 768px) {
    .header-content {
        padding: 0 12px;
        height: 65px;
        min-height: 65px;
        max-height: 65px;
    }

    .main-header nav ul.nav-menu.menu-open,
    .header-actions nav ul.nav-menu.menu-open {
        top: 65px !important;
        max-height: calc(100vh - 65px) !important;
    }

    .mobile-menu-btn {
        font-size: 20px;
        width: 38px;
        height: 38px;
        padding: 0 !important;
        align-self: center !important;
        margin: 0 !important;
    }
    
    .mobile-menu-btn i {
        display: inline-block !important;
        line-height: 1;
        vertical-align: middle;
        margin: 0;
        padding: 0;
    }

    .logo h2 {
        font-size: 16px;
    }

    .header-actions {
        gap: 6px;
        font-size: 15px;
    }

    .icon-btn {
        font-size: 15px;
        width: 34px;
        height: 34px;
        padding: 6px;
    }
    
    a.icon-btn {
        width: 34px;
        height: 34px;
    }
}

@media (max-width: 480px) {
    .header-content {
        padding: 0 10px;
        height: 60px;
        min-height: 60px;
        max-height: 60px;
    }

    .main-header nav ul.nav-menu.menu-open,
    .header-actions nav ul.nav-menu.menu-open {
        top: 60px !important;
        max-height: calc(100vh - 60px) !important;
    }

    .mobile-menu-btn {
        width: 36px;
        height: 36px;
        font-size: 18px;
        padding: 0 !important;
        align-self: center !important;
        margin: 0 !important;
    }
    
    .mobile-menu-btn i {
        display: inline-block !important;
        line-height: 1;
        vertical-align: middle;
        margin: 0;
        padding: 0;
    }

    .nav-link {
        padding: 14px 16px;
        font-size: 14px;
    }

    .dropdown a {
        padding: 10px 30px;
        font-size: 12px;
    }

    .logo h2 {
        font-size: 15px;
    }

    .header-actions {
        gap: 4px;
        font-size: 14px;
    }

    .icon-btn {
        font-size: 14px;
        width: 32px;
        height: 32px;
        padding: 5px;
    }
    
    a.icon-btn {
        width: 32px;
        height: 32px;
    }
}

/* Bestsellers Section Responsive */
@media (max-width: 1189px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem;
    }
    
    .product-card {
        min-height: auto;
    }
    
    .product-image {
        height: 180px;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1rem;
    }
    
    .product-image {
        height: 160px;
        width: 100%;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .product-title {
        font-size: 1.1rem;
    }
    
    .product-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    .current-price {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem;
    }
    
    .product-image {
        height: 140px;
        width: 100%;
    }
    
    .product-image img {
        object-fit: contain !important;
    }
    
    .product-info {
        padding: 0.875rem;
    }
    
    .product-title {
        font-size: 0.875rem !important;
        margin-bottom: 0.5rem;
    }
    
    .product-description {
        font-size: 0.75rem !important;
        margin-bottom: 0.75rem;
        line-height: 1.4;
    }
    
    .product-price {
        gap: 0.5rem !important;
    }
    
    .current-price {
        font-size: 0.75rem !important;
    }
    
    .original-price {
        font-size: 0.7rem !important;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
}

