/* Customer Frontend Styles */
/* Fonts: Montserrat (English) and IBM Plex Sans Arabic (Arabic) loaded via Google Fonts in master.blade.php */

body {
    margin: 0 !important;
}

:root {
    --header-bg: #ffffff;
    --header-top-bg: #2d2d2d;
    --header-bottom-bg: #2d2d2d;
    --text-primary: #000000;
    --text-secondary: #64748b;
    --text-light: #ffffff;
    --border-color: #e2e8f0;
    --primary-color: #2563eb;
    --hover-color: #1d4ed8;
    --mega-menu-bg: #ffffff;
    --mega-menu-sidebar-bg: #f8f9fa;
}

/* Dark Mode Variables */
html.dark {
    --header-bg: #1e293b;
    --header-top-bg: #0f172a;
    --header-bottom-bg: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #ffffff;
    --border-color: #334155;
    --primary-color: #3b82f6;
    --hover-color: #2563eb;
    --mega-menu-bg: #1e293b;
    --mega-menu-sidebar-bg: #0f172a;
}

html.dark body {
    background-color: #0f172a;
    color: var(--text-primary);
}

html.dark .header-main-content {
    background: #1e293b;
}

html.dark .logo-text {
    color: #f1f5f9;
}

html.dark .customer-content {
    background-color: #0f172a;
    color: var(--text-primary);
}

html.dark .mega-menu {
    background: var(--mega-menu-bg);
}

html.dark .mobile-menu-dropdown {
    background: #1e293b;
}

html.dark .mobile-menu-content {
    background: #1e293b;
}

html.dark .mobile-category-card {
    background: #1e293b;
}

html.dark .mobile-subcategory-item {
    background: #1e293b;
}

html.dark .mega-menu-subcategory-image-wrapper,
html.dark .mobile-category-image-wrapper,
html.dark .mobile-subcategory-image-wrapper {
    background: #334155;
}

html.dark .mobile-category-card {
    border-color: #334155;
}

html.dark .mobile-category-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* English: Montserrat */
html[lang="en"] body,
html[dir="ltr"] body,
html[lang="en"] *,
html[dir="ltr"] * {
    font-family: 'Montserrat', sans-serif;
}

html[lang="en"] .logo-text,
html[dir="ltr"] .logo-text,
html[lang="en"] .nav-link,
html[dir="ltr"] .nav-link,
html[lang="en"] h1,
html[dir="ltr"] h1,
html[lang="en"] h2,
html[dir="ltr"] h2,
html[lang="en"] h3,
html[dir="ltr"] h3,
html[lang="en"] h4,
html[dir="ltr"] h4,
html[lang="en"] h5,
html[dir="ltr"] h5,
html[lang="en"] h6,
html[dir="ltr"] h6,
html[lang="en"] strong,
html[dir="ltr"] strong,
html[lang="en"] b,
html[dir="ltr"] b,
html[lang="en"] [style*="font-weight: bold"],
html[dir="ltr"] [style*="font-weight: bold"],
html[lang="en"] [style*="font-weight:700"],
html[dir="ltr"] [style*="font-weight:700"],
html[lang="en"] [style*="font-weight: 700"],
html[dir="ltr"] [style*="font-weight: 700"] {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Arabic: IBM Plex Sans Arabic */
html[lang="ar"] body,
html[dir="rtl"] body,
html[lang="ar"] *,
html[dir="rtl"] * {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
}

/* Customer Wrapper */
.customer-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    min-height: 0;
}

/* Customer Header */
.customer-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: transparent;
}

/* Announcement Header */
.announcement-header {
    background: transparent;
    padding: 0.75rem 0;
    text-align: center;
    opacity: 0.7;
}

.announcement-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.announcement-text {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.announcement-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.announcement-link:hover {
    opacity: 0.8;
}

.announcement-icon {
    width: 16px;
    height: 16px;
    color: var(--text-primary);
    opacity: 0.8;
}

/* Main Header */
.header-main {
    background: transparent;
    /* padding: 1.25rem 0; */
    padding-bottom: 0 !important;
    position: relative;
    overflow: visible;
    display: flex;
    justify-content: center;
    z-index: 1001;
}

.header-main-content {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 1rem 2rem;
    width: 98%;
    max-width: 100%;
    overflow: visible;
    transition: border-radius 0.3s ease;
}

.header-main-content.fixed {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    z-index: 1002;
}

.header-main-content.fixed.slide-up {
    animation: slideUpFromBottom 0.3s ease-out forwards;
}

.header-main-content.fixed.slide-down {
    animation: slideDownToBottom 0.3s ease-out forwards;
}

@keyframes slideUpFromBottom {
    from {
        transform: translateX(-50%) translateY(100%);
    }

    to {
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideDownToBottom {
    from {
        transform: translateX(-50%) translateY(0);
    }

    to {
        transform: translateX(-50%) translateY(100%);
    }
}

[dir="rtl"] .header-main-content {
    flex-direction: row;
    justify-content: flex-start !important;
}

[dir="rtl"] .header-main-content>.header-logo {
    margin-left: auto;
}

[dir="rtl"] .header-main-content>.header-nav {
    order: 2;
    flex: 1;
}

[dir="rtl"] .header-main-content>.header-right {
    order: 3;
}

.header-main-content:has(.mobile-menu-dropdown.active) {
    border-radius: 12px 12px 0 0;
    align-items: flex-start;
}

/* Improved sticky header animation */
.header-sticky-wrapper {
    display: flex;
    flex-direction: column;
    position: relative;
    --nav-height: 0px;
    --announce-height: 0px;
}

.header-sticky-wrapper.fixed {
    /* We don't change flex-direction anymore to avoid jumps */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    background: transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.header-sticky-wrapper .announcement-header {
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
}

.header-sticky-wrapper .header-main {
    position: relative;
    z-index: 3;
    transition: transform 0.3s ease-in-out;
    background: transparent;
}

.header-sticky-wrapper.fixed .announcement-header {
    transform: translateY(var(--nav-height));
}

.header-sticky-wrapper.fixed .header-main {
    transform: translateY(calc(-1 * var(--announce-height)));
}

.announcement-header.mt-5 {
    margin-top: 0 !important;
}


.header-logo .logo-link {
    text-decoration: none;
    display: block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: normal;
    color: #000000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

html[lang="en"] .logo-text,
html[dir="ltr"] .logo-text {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
}

/* Navigation */
.header-nav {
    flex: 1;
    position: relative;
    display: flex;
    justify-content: center;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
    align-items: center;
    justify-content: center;
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

.nav-item {
    position: static;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: bold;
    padding: 0.5rem 0;
    transition: color 0.2s;
    white-space: nowrap;
}

html[lang="en"] .nav-link,
html[dir="ltr"] .nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
}

html[lang="ar"] .nav-link,
html[dir="rtl"] .nav-link {
    font-weight: bold;
}

.nav-link:hover {
    color: var(--text-primary);
    opacity: 0.7;
}

.chevron-icon {
    width: 12px;
    height: 12px;
    transition: transform 0.2s;
}

.nav-item.active .chevron-icon {
    transform: rotate(180deg);
}

/* Mega Menu Container */
.mega-menu-container {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 50%;
    transform: translateX(-50%);
    width: 98%;
    max-width: 100%;
    z-index: 1003;
    pointer-events: none;
}

.mega-menu-container .mega-menu.active {
    pointer-events: auto;
}

/* Mega Menu */
.mega-menu {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: var(--mega-menu-bg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 3rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    z-index: 1003;
    margin-top: 0;
    display: block;
    pointer-events: none;
}

.mega-menu.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.mega-menu-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Subcategories Grid */
.mega-menu-subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem 4rem;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 1200px) {
    .mega-menu-subcategories-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) and (min-width: 768px) {
    .mega-menu-subcategories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem 3rem;
    }
}

/* Subcategory Item */
.mega-menu-subcategory {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Subcategory Link Container */
.mega-menu-subcategory-link {
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 0;
    transition: opacity 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

html[lang="en"] .mega-menu-subcategory-link,
html[dir="ltr"] .mega-menu-subcategory-link {
    align-items: flex-start;
    text-align: left;
}

.mega-menu-subcategory-link:hover {
    opacity: 0.8;
}

/* Subcategory Image */
.mega-menu-subcategory-image-wrapper {
    overflow: hidden;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    background: #f3f4f6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mega-menu-subcategory-image {
    width: 200px;
    height: 100px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mega-menu-subcategory-link:hover .mega-menu-subcategory-image {
    transform: scale(1.05);
}

/* Subcategory Heading */
.mega-menu-subcategory-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0;
    margin-top: 0;
    margin-right: 1rem;
    margin-left: 1rem;
    display: block;
    transition: opacity 0.2s;
    text-align: left;
    line-height: 1.4;
}

html[lang="en"] .mega-menu-subcategory-heading,
html[dir="ltr"] .mega-menu-subcategory-heading {
    text-align: left;
}

html[lang="en"] .mega-menu-subcategory-heading,
html[dir="ltr"] .mega-menu-subcategory-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
}

html[lang="ar"] .mega-menu-subcategory-heading,
html[dir="rtl"] .mega-menu-subcategory-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
    text-align: left;
}

/* Subcategory Products - Text Only */
.mega-menu-subcategory-products {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0;
    width: 100%;
    align-items: flex-start;
    text-align: left;
}

[dir="rtl"] .mega-menu-subcategory-products {
    align-items: flex-start;
    text-align: left;
}

.mega-menu-product-link {
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.5;
    transition: opacity 0.2s;
    margin-right: 1rem;
    margin-left: 1rem;
}

html[lang="en"] .mega-menu-product-link,
html[dir="ltr"] .mega-menu-product-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
}

html[lang="ar"] .mega-menu-product-link,
html[dir="rtl"] .mega-menu-product-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
    text-align: left;
}

.mega-menu-product-link:hover {
    opacity: 0.7;
}

.mega-menu-no-products {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 1rem;
    grid-column: 1 / -1;
}

.mega-menu-loading {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: 2rem;
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    overflow: visible;
}

.header-auth {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.auth-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: color 0.2s;
    white-space: nowrap;
}

.auth-link:hover {
    color: var(--text-primary);
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    position: relative;
    overflow: visible;
}

.header-action-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: opacity 0.2s;
}

.header-action-btn:hover {
    opacity: 0.7;
}

/* Dark Mode Toggle */
.dark-mode-toggle-btn {
    position: relative;
}

.dark-mode-icon {
    width: 20px;
    height: 20px;
    transition: opacity 0.2s;
    display: inline-block;
    vertical-align: middle;
}

/* Hide icons by default, show based on theme */
.dark-mode-icon.sun-icon {
    display: none;
}

.dark-mode-icon.moon-icon {
    display: inline-block;
}

/* Show sun icon in dark mode */
html.dark .dark-mode-icon.sun-icon {
    display: inline-block;
}

html.dark .dark-mode-icon.moon-icon {
    display: none;
}

/* Search Container */
.search-container {
    position: relative;
}

.search-input-wrapper {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    z-index: 10000;
    width: 400px;
    max-width: calc(100vw - 2rem);
}

[dir="rtl"] .search-input-wrapper {
    right: auto;
    left: 0;
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: #666;
    pointer-events: none;
    z-index: 1;
}

[dir="rtl"] .search-icon {
    left: auto;
    right: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: none;
    border-radius: 0;
    font-size: 1rem;
    background: transparent;
    color: #333;
    outline: none;
    transition: all 0.2s;
}

[dir="rtl"] .search-input {
    padding: 0.75rem 3rem 0.75rem 1rem;
}

.search-input::placeholder {
    color: #999;
}

.search-input:focus {
    background: #ffffff;
}

.search-submit-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    z-index: 1;
}

[dir="rtl"] .search-submit-btn {
    right: auto;
    left: 0.5rem;
}

.search-submit-btn:hover {
    color: #333;
}

.search-submit-btn svg {
    width: 20px;
    height: 20px;
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 10001;
}

.search-result-item {
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #e0e0e0;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.selected {
    background-color: #f5f5f5;
}

.search-result-name {
    color: #333;
    font-size: 0.95rem;
}

/* Dark mode search */
html.dark .search-input-container {
    background: var(--header-bg);
    border-color: var(--border-color);
}

html.dark .search-icon {
    color: var(--text-secondary);
}

html.dark .search-input {
    background: transparent;
    color: var(--text-primary);
}

html.dark .search-input::placeholder {
    color: var(--text-secondary);
}

html.dark .search-submit-btn {
    color: var(--text-secondary);
}

html.dark .search-submit-btn:hover {
    color: var(--text-primary);
}

html.dark .search-results-dropdown {
    background: var(--header-bg);
    border-color: var(--border-color);
}

html.dark .search-result-item {
    border-bottom-color: var(--border-color);
}

html.dark .search-result-item:hover,
html.dark .search-result-item.selected {
    background-color: #334155;
}

html.dark .search-result-name {
    color: var(--text-primary);
}

/* Responsive search */
@media (max-width: 768px) {
    .search-input-wrapper {
        width: 320px;
        right: -50px;
    }

    [dir="rtl"] .search-input-wrapper {
        right: auto;
        left: -50px;
    }
}

@media (max-width: 480px) {
    .search-input-wrapper {
        width: calc(100vw - 2rem);
        right: 0;
        left: 50%;
        transform: translateX(-50%);
    }

    [dir="rtl"] .search-input-wrapper {
        left: 50%;
        transform: translateX(-50%);
    }
}

.cart-btn {
    text-decoration: none;
}

.cart-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: #2563eb;
    color: white;
    border-radius: 10px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    transform: translate(25%, -25%);
    padding: 0 0.35rem;
    line-height: 1;
    white-space: nowrap;
}

/* Adjust badge for RTL */
[dir="rtl"] .cart-badge {
    right: auto;
    left: 0;
    transform: translate(-25%, -25%);
}


/* Customer Content */
.customer-content {
    position: relative;
    width: 100%;
    min-height: auto;
    height: auto;
    margin-top: 7rem;
}

/* Container */
.container {
    margin: 0 auto;
    position: relative;
    padding-left: 96px;
    padding-right: 96px;
}

@media (max-width: 1199.98px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Break out of container for mega menu */
.header-main .container {
    overflow: visible;
}

/* RTL Support */
[dir="rtl"] .header-top-content {
    flex-direction: row-reverse;
}

[dir="rtl"] .header-center {
    flex-direction: row-reverse;
}

[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
    justify-content: flex-start;
}

[dir="rtl"] .mega-menu {
    left: 0;
    right: 0;
}

[dir="rtl"] .mobile-menu-sidebar {
    right: auto;
    left: -100%;
}

[dir="rtl"] .mobile-menu-sidebar.active {
    left: 0;
    right: auto;
}

[dir="rtl"] .mobile-view-all-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .mega-menu-content {
    direction: rtl;
}

/* Active state for nav item */
.nav-item.active .nav-link {
    color: var(--primary-color);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
}

@media (max-width: 1110px) {
    .mobile-menu-toggle {
        display: flex;
    }
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Mobile Menu Dropdown - Opens from navbar */
.mobile-menu-dropdown {
    position: relative;
    width: 100%;
    max-height: 0;
    background: transparent;
    z-index: 1003;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    box-shadow: none;
    border-radius: 0;
    margin-top: 0;
    -webkit-overflow-scrolling: touch;
    order: 999;
    flex-basis: 100%;
}

.mobile-menu-dropdown.active {
    max-height: calc(90vh - 150px);
    overflow-y: auto;
    margin-top: 0;
}

/* Mobile Menu Toggle Icon */
.mobile-menu-icon {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu-toggle.active .hamburger-icon {
    display: none;
}

.mobile-menu-toggle.active .close-icon {
    display: block !important;
}

.mobile-menu-toggle:not(.active) .close-icon {
    display: none !important;
}

[dir="rtl"] .mobile-menu-dropdown {
    left: 0;
    transform: none;
}

/* Mobile menu dropdown is positioned relative to header-main */
.header-main {
    position: relative;
}

/* Mobile Menu Content */
.mobile-menu-content {
    padding: 0.6rem 0.75rem;
    width: calc(100% - 2.9rem);
    margin: 0 1.5rem;
    border-radius: 12px;
    background: #ffffff;
    position: relative;
    z-index: 1003;
}

/* Mobile Navigation */
.mobile-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mobile-nav-item {
    width: 100%;
}

/* Mobile Category Card */
.mobile-category-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
}

.mobile-category-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.mobile-nav-item.active .mobile-category-card {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

/* Mobile Category Image */
.mobile-category-image-wrapper {
    width: 60px;
    height: 60px;
    min-width: 60px;
    overflow: hidden;
    border-radius: 8px;
    background: #f3f4f6;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile Category Info */
.mobile-category-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* Mobile Category Link */
.mobile-category-link {
    text-decoration: none;
    color: var(--text-primary);
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-category-name {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #000000;
    display: block;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

html[lang="en"] .mobile-category-name,
html[dir="ltr"] .mobile-category-name {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
}

.mobile-category-subtitle {
    font-size: 0.8125rem;
    font-weight: 400;
    color: #6b7280;
    display: block;
    line-height: 1.4;
}

html[lang="en"] .mobile-category-subtitle,
html[dir="ltr"] .mobile-category-subtitle {
    font-family: 'Montserrat', sans-serif;
}

/* Mobile Category Arrow */
.mobile-category-arrow {
    width: 20px;
    height: 20px;
    min-width: 20px;
    color: #9ca3af;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.mobile-nav-item.active .mobile-category-arrow {
    transform: rotate(90deg);
}

/* RTL Support for Mobile Menu */
[dir="rtl"] .mobile-category-card {
    flex-direction: row-reverse;
}

[dir="rtl"] .mobile-category-card>.mobile-category-image-wrapper {
    order: 3;
}

[dir="rtl"] .mobile-category-card>.mobile-category-info {
    order: 2;
}

[dir="rtl"] .mobile-category-card>.mobile-category-arrow {
    transform: scaleX(-1);
}

[dir="rtl"] .mobile-nav-item.active .mobile-category-arrow {
    transform: scaleX(-1) rotate(90deg);
}

/* Mobile Subcategories Container */
.mobile-subcategories-container {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    margin-top: 0.5rem;
}

.mobile-nav-item.active .mobile-subcategories-container {
    max-height: 2000px;
    opacity: 1;
}

.mobile-subcategories-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Mobile Subcategories List - Grid Layout (2 per row like web menu) */
.mobile-subcategories-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    padding: 1rem 0;
}

/* Mobile Subcategory Item - Matching Web Menu Style */
.mobile-subcategory-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

[dir="rtl"] .mobile-subcategory-item {
    align-items: flex-end;
}

/* Mobile Subcategory Link */
.mobile-subcategory-link {
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    transition: opacity 0.2s;
}

[dir="rtl"] .mobile-subcategory-link {
    align-items: flex-end;
}

.mobile-subcategory-link:hover {
    opacity: 0.8;
}

/* Mobile Subcategory Image */
.mobile-subcategory-image-wrapper {
    width: 100%;
    max-width: 200px;
    height: 100px;
    overflow: hidden;
    border-radius: 1rem;
    margin-bottom: 0.5rem;
    background: #f3f4f6;
    flex-shrink: 0;
    margin-left: auto;
    margin-right: auto;
}

[dir="rtl"] .mobile-subcategory-image-wrapper {
    margin-left: auto;
    margin-right: auto;
}

.mobile-subcategory-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.mobile-subcategory-link:hover .mobile-subcategory-image {
    transform: scale(1.05);
}

/* Mobile Subcategory Heading */
.mobile-subcategory-heading {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    margin-bottom: 0;
    margin-top: 0;
    margin-left: 1rem;
    margin-right: 1rem;
    display: block;
    transition: opacity 0.2s;
    text-align: left;
    line-height: 1.4;
}

[dir="rtl"] .mobile-subcategory-heading {
    text-align: right;
}

html[lang="en"] .mobile-subcategory-heading,
html[dir="ltr"] .mobile-subcategory-heading {
    font-family: 'Montserrat', sans-serif;
    font-weight: bold;
}

/* Mobile Subcategory Products */
.mobile-subcategory-products {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0;
    margin-bottom: 0;
    width: 100%;
    align-items: flex-start;
    padding: 0.75rem 1.25rem;
    padding-top: 0;
    background: #fafafa;
    border-top: 1px solid #e5e7eb;
}

[dir="rtl"] .mobile-subcategory-products {
    align-items: flex-end;
}

.mobile-subcategory-product-link {
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    line-height: 1.5;
    transition: opacity 0.2s;
    margin-right: 0.5rem;
    margin-left: 0.5rem;
    text-align: left;
}

[dir="rtl"] .mobile-subcategory-product-link {
    text-align: right;
}

html[lang="en"] .mobile-subcategory-product-link,
html[dir="ltr"] .mobile-subcategory-product-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: normal;
}

.mobile-subcategory-product-link:hover {
    opacity: 0.7;
}

.mobile-no-products {
    color: var(--text-secondary);
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    text-align: left;
}

[dir="rtl"] .mobile-no-products {
    text-align: right;
}

.mobile-view-all-container {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.mobile-view-all-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mobile-view-all-btn:hover {
    background: var(--hover-color);
    color: white;
}

.mobile-view-all-btn svg {
    width: 16px;
    height: 16px;
}

.mobile-loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Mobile Menu Footer */
.mobile-menu-footer {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-auth-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9375rem;
    padding: 0.5rem 0;
    transition: color 0.2s;
}

.mobile-auth-link:hover {
    color: var(--primary-color);
}

.mobile-language-switcher {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-lang-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.mobile-lang-link:hover {
    color: var(--text-primary);
}

.mobile-lang-link svg {
    width: 16px;
    height: 16px;
}

/* Responsive - Tablet and Desktop */
@media (min-width: 1111px) {

    /* Ensure desktop menu is visible */
    .header-nav {
        display: flex !important;
    }

    .mobile-menu-toggle {
        display: none !important;
    }

    .mobile-menu-sidebar,
    .mobile-menu-overlay {
        display: none !important;
    }
}

/* Tablet Landscape */
@media (max-width: 1110px) and (min-width: 769px) {

    /* Hide desktop navigation */
    .header-nav {
        display: none;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Adjust header layout */
    .header-main-content {
        justify-content: space-between;
        padding: 1rem 1.5rem;
    }

    .header-logo {
        flex: 0 0 auto;
    }

    .header-right {
        flex: 0 0 auto;
        gap: 1rem;
    }

    /* Hide mega menu on tablet */
    .mega-menu-container {
        display: none;
    }

    /* Adjust announcement header */
    .announcement-header {
        padding: 0.5rem 0;
    }

    .announcement-text {
        font-size: 0.75rem;
    }

    .announcement-icon {
        width: 14px;
        height: 14px;
    }

    /* Mobile menu sidebar adjustments for tablet */
    .mobile-menu-sidebar {
        width: 60%;
        max-width: 450px;
    }
}

/* Mobile and Tablet Portrait */
@media (max-width: 768px) {

    /* Hide desktop navigation */
    .header-nav {
        display: none;
    }

    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
    }

    /* Adjust header layout */
    .header-main-content {
        justify-content: space-between;
        padding: 0.75rem 1rem;
        border-radius: 8px;
        width: calc(100% - 2rem);
        margin: 0 1%;
        gap: 0.75rem;
    }

    .header-main-content.fixed {
        margin: 0;
    }

    .header-main-content {
        align-items: flex-start;
    }

    .header-main-content:has(.mobile-menu-dropdown.active) {
        border-radius: 8px 8px 0 0;
    }

    /* Match mobile menu width to navbar */
    .mobile-menu-dropdown {
        width: 100%;
        left: 0;
        transform: none;
        margin-top: 0.75rem;
    }

    .mobile-menu-content {
        border-radius: 0 0 8px 8px;
    }

    .header-logo {
        flex: 0 0 auto;
    }

    .header-logo .logo-text {
        font-size: 1.25rem;
    }

    .header-right {
        flex: 0 0 auto;
        gap: 0.5rem;
    }

    .header-actions {
        gap: 0.5rem;
    }

    .header-action-btn {
        padding: 0.4rem;
    }

    .header-action-btn svg {
        width: 18px;
        height: 18px;
    }

    /* Hide mega menu on mobile */
    .mega-menu-container {
        display: none;
    }

    /* Adjust announcement header */
    .announcement-header {
        padding: 0.5rem 0;
    }

    .announcement-text {
        font-size: 0.7rem;
    }

    .announcement-icon {
        width: 12px;
        height: 12px;
    }

    /* Mobile menu sidebar full width on small screens */
    .mobile-menu-sidebar {
        width: 85%;
        max-width: 100%;
    }

    /* Mobile menu content adjustments */
    .mobile-menu-header-main {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .mobile-search-container {
        padding: 0.4rem;
    }

    .mobile-nav-link {
        padding: 0.875rem 1rem;
        font-size: 0.9375rem;
    }

    .mobile-nav-item {
        margin-bottom: 0.25rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header-main-content {
        padding: 0.6rem 0.75rem;
        width: calc(100% - 1.5rem);
        margin: 0 0.75rem;
        border-radius: 12px;
    }

    .header-main-content.fixed {
        margin: 0;
    }

    .header-main-content {
        align-items: flex-start;
    }

    .header-main-content:has(.mobile-menu-dropdown.active) {
        border-radius: 12px 12px 0 0;
    }

    /* Match mobile menu width to navbar */
    .mobile-menu-dropdown {
        width: 100%;
        left: 0;
        transform: none;
        margin-top: 0.5rem;
    }

    [dir="rtl"] .mobile-menu-dropdown {
        left: 0;
        transform: none;
    }

    .mobile-menu-content {
        border-radius: 0 0 12px 12px;
    }

    .header-logo .logo-text {
        font-size: 1.1rem;
    }

    .header-actions {
        gap: 0.25rem;
    }

    .header-action-btn {
        padding: 0.3rem;
    }

    .header-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .cart-badge {
        width: 16px;
        height: 16px;
        font-size: 0.65rem;
    }

    .mobile-menu-sidebar {
        width: 90%;
    }

    .mobile-menu-header-main {
        flex-wrap: wrap;
    }

    .mobile-search-container {
        order: 3;
        width: 100%;
        margin-top: 0.5rem;
    }

    .mobile-nav-link {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {

    .nav-link,
    .mobile-nav-link,
    .header-action-btn {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav-link {
        padding: 1rem;
    }
}