/* ===========================
   Mobile Header Styles
   Responsive mobile header for screens <= 768px
   =========================== */

/* Hide mobile-header on desktop by default */
.mobile-header {
    display: none;
}

/* Display only on mobile devices */
@media (max-width: 768px) {
    /* ========== MOBILE HEADER ==========*/
    .mobile-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-blue) 100%);
        padding: 12px 16px;
        position: sticky;
        top: 0;
        z-index: 1000;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        height: 60px;
    }

    .mobile-header__container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        height: 100%;
        gap: 8px;
    }

    /* Actions Container (only Cart now) */
    .mobile-header__actions {
        display: flex;
        align-items: center;
        gap: 12px;
        flex: 0 0 auto;
    }

    /* Remove old language switcher styles from header */

    /* Menu Button */
    .mobile-header__menu-btn {
        background: transparent;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        flex: 0 0 auto;
    }

    .mobile-header__menu-btn:hover {
        transform: scale(1.1);
    }

    .mobile-header__menu-btn:active {
        transform: scale(0.95);
    }

    /* Logo */
    .mobile-header__logo {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        padding: 0 8px;
    }

    .mobile-header__logo img {
        height: 44px;
        width: auto;
        max-width: 100%;
        filter: brightness(1.1);
    }

    /* Cart Button */
    .mobile-header__cart {
        position: relative;
        color: white;
        font-size: 1.4rem;
        text-decoration: none;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 6px;
        transition: all 0.3s ease;
        flex: 0 0 auto;
    }

    .mobile-header__cart:hover {
        transform: scale(1.1);
    }

    .mobile-header__cart:active {
        transform: scale(0.95);
    }

    .mobile-header__cart-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        background: #ff4d4f;
        color: white;
        font-size: 0.7rem;
        font-weight: 700;
        min-width: 18px;
        height: 18px;
        padding: 0 5px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        line-height: 1;
        white-space: nowrap;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    }

    /* ========== MOBILE MENU OVERLAY ==========*/
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        display: none;
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .mobile-menu-overlay.active {
        display: block;
        opacity: 1;
    }

    /* ========== MOBILE MENU ==========*/
    .mobile-menu {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        background: white;
        display: flex;
        flex-direction: column;
        z-index: 1001;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        overscroll-behavior: contain;
    }

    .mobile-menu-overlay.active .mobile-menu {
        transform: translateX(0);
    }

    /* Menu Header */
    .mobile-menu__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px;
        border-bottom: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    /* Close Button */
    .mobile-menu__close-btn {
        background: transparent;
        border: none;
        color: var(--text-dark);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        flex: 0 0 auto;
    }

    .mobile-menu__close-btn:hover {
        color: var(--primary-blue);
        transform: scale(1.1);
    }

    .mobile-menu__close-btn:active {
        transform: scale(0.95);
    }

    /* ========== SEARCH IN MENU ==========*/
    .mobile-menu__search {
        display: flex;
        flex-direction: column;
        padding: 12px 16px;
        border-bottom: 1px solid #e5e7eb;
        flex-shrink: 0;
    }

    .mobile-menu__search-form {
        display: flex;
        gap: 8px;
    }

    .mobile-menu__search-input {
        flex: 1;
        padding: 10px 12px;
        border: 1px solid #d5d7e0;
        border-radius: 4px;
        font-size: 0.95rem;
        color: var(--text-dark);
        transition: all 0.3s ease;
    }

    .mobile-menu__search-input:focus {
        outline: none;
        border-color: var(--primary-blue);
        box-shadow: 0 0 0 3px rgba(91, 141, 199, 0.1);
    }

    .mobile-menu__search-input::placeholder {
        color: var(--text-muted);
    }

    .mobile-menu__search-btn {
        padding: 10px 12px;
        background: var(--primary-blue);
        color: white;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        transition: all 0.3s ease;
        flex: 0 0 auto;
    }

    .mobile-menu__search-btn:hover {
        background: var(--accent-blue);
        transform: scale(1.05);
    }

    .mobile-menu__search-btn:active {
        transform: scale(0.95);
    }

    /* Search Results */
    .mobile-menu__search-results {
        max-height: 200px;
        overflow-y: auto;
        margin-top: 8px;
        border: 1px solid #e5e7eb;
        border-radius: 4px;
        display: none;
        background: white;
    }

    .mobile-menu__search-results.active {
        display: block;
    }

    .mobile-menu__search-item {
        display: flex;
        align-items: center;
        padding: 8px 12px;
        border-bottom: 1px solid #f3f4f6;
        text-decoration: none;
        color: var(--text-dark);
        transition: all 0.3s ease;
    }

    .mobile-menu__search-item:last-child {
        border-bottom: none;
    }

    .mobile-menu__search-item:hover {
        background: #f9fafb;
    }

    .mobile-menu__search-item img {
        width: 32px;
        height: 32px;
        object-fit: cover;
        border-radius: 3px;
        margin-right: 8px;
        border: 1px solid #e5e7eb;
    }

    .mobile-menu__search-item-info {
        flex: 1;
        min-width: 0;
    }

    .mobile-menu__search-item-name {
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text-dark);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 2px;
    }

    .mobile-menu__search-item-sku {
        font-size: 0.8rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .mobile-menu__search-empty {
        padding: 12px;
        text-align: center;
        color: var(--text-muted);
        font-size: 0.9rem;
    }

    /* ========== CATEGORIES MENU ==========*/
    .mobile-menu__categories {
        list-style: none;
        margin: 0;
        padding: 0;
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        touch-action: pan-y;
    }

    .mobile-menu__category {
        border-bottom: 1px solid #f3f4f6;
    }

    .mobile-menu__category-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        padding: 0 8px 0 0;
    }

    .mobile-menu__category-link {
        display: block;
        padding: 14px 16px;
        color: var(--text-dark);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
        flex: 1;
    }

    .mobile-menu__category-link:active {
        background: #f9fafb;
    }

    .mobile-menu__category-toggle {
        background: transparent;
        border: none;
        padding: 10px 12px;
        color: var(--text-muted);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: all 0.3s ease;
        flex: 0 0 auto;
    }

    .mobile-menu__category-toggle i {
        font-size: 0.85rem;
        transition: transform 0.3s ease;
    }

    .mobile-menu__category--has-children.open .mobile-menu__category-toggle i {
        transform: rotate(180deg);
        color: var(--primary-blue);
    }

    /* Subcategories */
    .mobile-menu__subcategories {
        list-style: none;
        margin: 0;
        padding: 0;
        background: #f3f4f6;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .mobile-menu__category--has-children.open .mobile-menu__subcategories {
        max-height: 1000px;
    }

    .mobile-menu__subcategory {
        border-bottom: 1px solid #e5e7eb;
    }

    .mobile-menu__subcategory-link {
        display: block;
        padding: 14px 16px 14px 32px;
        color: var(--text-dark);
        text-decoration: none;
        font-size: 0.7rem;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mobile-menu__subcategory-link:active {
        background: #e5e7eb;
    }

    .mobile-menu__subcategory:hover .mobile-menu__subcategory-link {
        color: var(--primary-blue);
        padding-left: 36px;
    }

    /* ========== LANGUAGE SWITCHER IN MENU ==========*/
    .mobile-menu__language-section {
        list-style: none;
        border-bottom: 1px solid #e5e7eb;
        padding: 0;
    }

    .mobile-menu__language {
        padding: 0;
    }

    .mobile-menu__language-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 14px 16px;
        color: var(--text-dark);
        text-decoration: none;
        font-weight: 500;
        transition: all 0.3s ease;
    }

    .mobile-menu__language-link:active {
        background: #f9fafb;
    }

    .mobile-menu__language-link i {
        font-size: 1.1rem;
        color: var(--primary-blue);
        flex: 0 0 auto;
    }

    .mobile-menu__language-link span {
        flex: 1;
        color: var(--text-muted);
        font-size: 0.9rem;
    }

    .mobile-menu__language-link strong {
        font-weight: 600;
        color: var(--text-dark);
        flex: 0 0 auto;
    }

    /* ========== HIDE ON DESKTOP ==========*/
}

@media (min-width: 769px) {
    .mobile-header,
    .mobile-menu-overlay,
    .mobile-menu {
        display: none !important;
    }
}
