@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Tajawal', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: #f5f7fa;
}

.hero .container,
.categories-section .container,
.products-section .container,
.home-ads .container {
    padding-left: 16px;
    padding-right: 16px;
}

.home-ads-top #home-ads-top-banner,
.home-ads-top #home-ads-top-grid > * {
    border-radius: 16px;
    overflow: hidden;
}

.home-ads-top #home-ads-top-banner img,
.home-ads-top #home-ads-top-banner iframe,
.home-ads-top #home-ads-top-banner video,
.home-ads-top #home-ads-top-grid img,
.home-ads-top #home-ads-top-grid iframe,
.home-ads-top #home-ads-top-grid video {
    border-radius: 16px;
    display: block;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.header {
    background-color: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.8rem 0;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    padding: 0.5rem 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.desktop-topbar,
.desktop-sidebar {
    display: none;
}

@media (min-width: 1024px), (hover: hover) and (pointer: fine) {
    .desktop-topbar,
    .desktop-sidebar {
        display: block;
    }

    body {
        --desktop-topbar-h: 84px;
        --desktop-sidebar-w: 260px;
        padding-top: var(--desktop-topbar-h);
        padding-right: var(--desktop-sidebar-w);
    }

    .header {
        background-color: transparent;
        box-shadow: none;
        position: static;
        top: auto;
        padding: 0;
        z-index: auto;
    }

    .header > .container {
        display: none;
    }

    .hero {
        padding: 18px 0 8px;
    }

    .desktop-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        padding: 12px 0;
        background: var(--primary-color);
        z-index: 2400;
        box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    }

    .desktop-topbar-inner {
        max-width: none;
        width: calc(100% - var(--desktop-sidebar-w));
        margin: 0 var(--desktop-sidebar-w) 0 0;
        padding: 0 22px;
        display: grid;
        grid-template-columns: auto minmax(260px, 1fr) auto;
        align-items: center;
        gap: 16px;
        direction: ltr;
    }

    .desktop-topbar-actions {
        display: flex;
        align-items: center;
        gap: 10px;
        direction: ltr;
    }

    .desktop-topbar-action {
        width: 42px;
        height: 42px;
        border-radius: 999px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        text-decoration: none;
        position: relative;
        background: rgba(255, 255, 255, 0.12);
        border: 1px solid rgba(255, 255, 255, 0.18);
        transition: transform 0.2s ease, background 0.2s ease;
    }

    .desktop-topbar-action:hover {
        background: rgba(255, 255, 255, 0.18);
        transform: translateY(-1px);
    }

    .desktop-topbar-action i {
        font-size: 1.05rem;
    }

    .desktop-topbar-badge {
        position: absolute;
        top: -6px;
        left: -6px;
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        border-radius: 999px;
        background: var(--secondary-color);
        color: #111827;
        font-weight: 900;
        font-size: 0.72rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border: 2px solid var(--primary-color);
    }

    .desktop-topbar-search {
        display: none;
    }

    .desktop-topbar-search-slot {
        display: block;
        direction: rtl;
    }

    .desktop-topbar-logo-link {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }

    .desktop-topbar-logo {
        height: 60px;
        max-width: 200px;
        width: auto;
        object-fit: contain;
        display: block;
    }

    .desktop-topbar-brand {
        display: inline-flex;
        align-items: center;
        gap: 12px;
        justify-content: flex-end;
        direction: rtl;
    }

    .desktop-topbar-brand-link {
        color: #fbbf24;
        text-decoration: none;
        display: inline-flex;
        align-items: flex-end;
        justify-content: flex-end;
        font-weight: 900;
        font-size: 1.55rem;
        white-space: nowrap;
        direction: rtl;
        flex-direction: column;
        line-height: 1.05;
    }

    .desktop-topbar-brand-name {
        color: #fbbf24;
        letter-spacing: 0.2px;
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
    }

    .desktop-topbar-brand-subtitle {
        display: block;
        margin-top: 4px;
        font-size: 0.82rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.92);
        text-shadow: 0 1px 0 rgba(0, 0, 0, 0.16);
    }

    .desktop-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        width: var(--desktop-sidebar-w);
        height: 100vh;
        background: linear-gradient(180deg, rgba(11, 10, 40, 0.18), rgba(0, 0, 0, 0)) , var(--primary-color);
        padding-top: calc(var(--desktop-topbar-h) + 14px);
        z-index: 2300;
        box-shadow: -10px 0 28px rgba(15, 23, 42, 0.18);
    }

    .desktop-sidebar-nav {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 14px;
    }

    .desktop-sidebar-link {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px 12px;
        border-radius: 14px;
        color: rgba(255, 255, 255, 0.92);
        text-decoration: none;
        font-weight: 800;
        border: 1px solid rgba(255, 255, 255, 0.14);
        background: rgba(255, 255, 255, 0.06);
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .desktop-sidebar-link:hover {
        background: rgba(255, 255, 255, 0.12);
        transform: translateX(-1px);
        color: #fbbf24;
    }

    .desktop-sidebar-link:hover i {
        color: #fbbf24;
    }

    .desktop-sidebar-link i {
        width: 22px;
        text-align: center;
    }

    .desktop-sidebar-link.active {
        background: var(--secondary-color);
        color: var(--navy-color);
        border-color: transparent;
    }

    .desktop-sidebar-link.active i {
        color: var(--navy-color);
    }

    .desktop-sidebar-more {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

    .desktop-sidebar-more-toggle {
        width: 100%;
        font: inherit;
        appearance: none;
        cursor: pointer;
        text-align: right;
    }

    .desktop-sidebar-more-caret {
        margin-right: auto;
        transition: transform 0.2s ease;
    }

    .desktop-sidebar-more-toggle[aria-expanded="true"] .desktop-sidebar-more-caret {
        transform: rotate(180deg);
    }

    .desktop-sidebar-sublist {
        display: flex;
        flex-direction: column;
        gap: 6px;
        padding: 0 10px;
    }

    .desktop-sidebar-sublist[hidden] {
        display: none !important;
    }

    .desktop-sidebar-sublink {
        display: block;
        padding: 10px 12px;
        border-radius: 12px;
        color: rgba(255, 255, 255, 0.88);
        text-decoration: none;
        font-weight: 700;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        transition: background 0.2s ease, transform 0.2s ease;
    }

    .desktop-sidebar-sublink:hover {
        background: rgba(255, 255, 255, 0.1);
        transform: translateX(-1px);
        color: #fbbf24;
    }

    .desktop-sidebar-sublink.active {
        background: rgba(255, 255, 255, 0.16);
        border-color: rgba(255, 255, 255, 0.18);
        color: #fff;
    }

    .home-ads {
        margin-top: 6px;
    }

    .categories-section {
        padding: 1.2rem 0 0.4rem;
    }

    .categories-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 14px;
    }

    .category-card {
        padding: 14px 10px;
        border-radius: 16px;
        gap: 10px;
    }

    .category-icon {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.12);
        color: #fff;
    }

    .category-name {
        font-size: 0.92rem;
        font-weight: 800;
    }

    .products-section {
        padding-top: 1.1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 16px;
    }

    .product-card {
        border-radius: 16px;
    }

    .product-image {
        height: 190px;
    }
}

.mobile-bottom-nav {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 64px;
    background: var(--primary-color);
    z-index: 2000;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
}

.mobile-bottom-nav .mobile-bottom-nav-inner {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
}

.mobile-bottom-nav a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    height: 100%;
}

.mobile-bottom-nav a i {
    font-size: 1.15rem;
}

.mobile-bottom-nav a.active {
    color: var(--secondary-color);
}

.mobile-bottom-nav a.active i {
    transform: translateY(-1px);
}

.scroll-to-top {
    position: fixed;
    right: 1.25rem;
    bottom: 5.5rem;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: none;
    background: var(--primary-color);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 2100;
}

.scroll-to-top.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(-4px);
}

.scroll-to-top i {
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    .scroll-to-top {
        right: 1rem;
        bottom: 5.5rem;
    }
}

/* ===== Hero Section ===== */
.hero {
    background: transparent;
    color: var(--text-color);
    padding: 70px 0 14px;
    text-align: center;
    position: relative;
    overflow: visible;
    border-radius: 0;
}

.hero::before {
    content: none;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.btn-primary { 
    background-color: var(--navy-color);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 188, 212, 0.4);
    background-color: var(--secondary-color);
}

/* ===== Hero Search Bar ===== */
.hero-search-form {
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
}

.hero-search-inner {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 999px;
    padding: 0.25rem 0.25rem 0.25rem 0.9rem;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-search-inner:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 14px 30px rgba(124, 58, 237, 0.16);
}

.hero-search-input {
    flex: 1 1 auto;
    border: none;
    outline: none;
    background: transparent;
    padding: 0.7rem 0.8rem;
    font-size: 0.98rem;
    font-family: inherit;
    color: var(--text-color);
    direction: rtl;
}

.hero-search-input::placeholder {
    color: #94a3b8;
}

.hero-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    border-radius: 999px;
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.hero-search-btn i {
    font-size: 1.05rem;
    color: rgba(15, 23, 42, 0.55);
}

.hero-search-btn:hover {
    transform: translateY(-2px);
    box-shadow: none;
}

.hero-search-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Responsive for hero search */
@media (max-width: 768px) {
    .hero {
        background: var(--primary-color);
        padding-top: 40px;
        margin-top: -14px;
        padding-bottom: 18px;
        border-bottom-left-radius: 22px;
        border-bottom-right-radius: 22px;
        overflow: hidden;
    }

    .home-ads-top {
        margin-top: 12px;
    }

    .hero-search-form {
        max-width: 100%;
        margin: 1.2rem 0.5rem;
    }
    .hero-search-inner {
        padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    }
    .hero-search-input {
        padding: 0.6rem 0.5rem;
        font-size: 0.95rem;
    }
    .hero-search-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .hero-search-btn span {
        display: none;
    }
    .hero-search-btn i {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-search-form {
        margin: 1rem 0.3rem;
    }
    .hero-search-inner {
        border-radius: 40px;
    }
    .hero-search-input {
        padding: 0.5rem 0.4rem;
        font-size: 0.9rem;
    }
    .hero-search-btn {
        padding: 0.5rem 0.9rem;
        border-radius: 35px;
    }
    .hero-search-btn i {
        font-size: 0.95rem;
    }
}

/* ===== Categories Section ===== */
.categories-section {
    padding: 1.8rem 0 0.6rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    padding-bottom: 0;
    scroll-snap-type: none;
}

/* ===== Offers Section ===== */
.offers-section {
    padding: 2rem 0;
}

.offers-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.2rem;
}

.offers-header .section-title {
    margin-bottom: 0;
}

.btn-view-all-offers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0;
    background: none;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: none;
    transition: color 0.2s ease;
}

.btn-view-all-offers i {
    font-size: 0.8rem;
}

.btn-view-all-offers:hover {
    color: var(--secondary-color);
    transform: none;
    box-shadow: none;
    background: none;
}

.offers-grid {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.offer-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 160px;
}

.offer-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.offer-card-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.offer-card-body {
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
}

.offer-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
    line-height: 1.3;
}

.offer-card-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

/* ===== Products Section ===== */
.products-section {
    padding: 1.2rem 0 2.8rem;
}

.category-card {
    background: #fff;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    padding: 12px 10px;
    text-decoration: none;
    color: var(--text-color);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    scroll-snap-align: none;
    flex: initial;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(0, 188, 212, 0.35);
}

.category-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(var(--secondary-rgb), 0.24);
    color: var(--navy-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: inherit;
    display: block;
}

.category-icon i {
    font-size: 1.1rem;
}

.category-name {
    font-weight: 700;
    color: var(--dark-color);
    font-size: 0.85rem;
    text-align: center;
    line-height: 1.2;
}

.mobile-topbar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--primary-color);
    z-index: 2400;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.mobile-topbar-inner {
    height: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mobile-topbar-actions {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    direction: ltr;
    flex-direction: row;
}

.mobile-topbar-actions.mobile-topbar-actions--right {
    left: auto;
    right: 10px;
}

.mobile-topbar-action {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #fff;
    position: relative;
}

.mobile-topbar-action i {
    font-size: 1.05rem;
}

.mobile-topbar-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--secondary-color);
    color: #111827;
    font-weight: 900;
    font-size: 0.72rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-color);
}

.mobile-topbar-title {
    color: #fff;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    position: absolute;
    right: 108px;
    left: auto;
    text-align: right;
    max-width: calc(100% - 190px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.mobile-topbar-brand {
    position: absolute;
    right: 52px;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    direction: rtl;
    z-index: 2;
    max-width: calc(100% - 180px);
}

.mobile-topbar-brand-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    text-decoration: none;
}

.mobile-topbar-brand-logo-img {
    height: 60px;
    width: auto;
    max-width: 80px;
    object-fit: contain;
    display: block;
}

.mobile-topbar-brand-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
}

.mobile-topbar-brand-title {
    color: #fff;
    font-weight: 900;
    font-size: 1.05rem;
    letter-spacing: 0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar-brand-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-topbar-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.1;
    position: absolute;
    right: 108px;
    left: auto;
    top: calc(50% + 10px);
    text-align: right;
    max-width: calc(100% - 190px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

.mobile-topbar-back,
.mobile-menu-toggle {
    z-index: 3;
}

/* ===== Mobile Drawer & Overlay (legal/info menu) ===== */

.mobile-menu-toggle {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    cursor: pointer;
}

.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease-out;
    z-index: 998;
}

.mobile-menu-overlay.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 78%;
    max-width: 320px;
    background: #ffffff;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.25s ease-out;
    z-index: 999;
    display: flex;
    flex-direction: column;
}

.mobile-menu-drawer.is-open {
    transform: translateX(0);
}

body.mobile-menu-open {
    overflow: hidden;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}

.mobile-menu-title {
    font-size: 1rem;
    font-weight: 600;
}

.mobile-menu-close {
    border: none;
    background: transparent;
    color: #222;
    font-size: 1.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    cursor: pointer;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    flex: 1;
    overflow-y: auto;
}

.mobile-menu-list li {
    border-bottom: 1px solid #f3f3f3;
}

.mobile-menu-list a {
    display: block;
    padding: 12px 20px;
    font-size: 0.95rem;
    color: #222;
    text-decoration: none;
}

.mobile-menu-list a:hover {
    background-color: #f7f7f7;
}

.mobile-menu-list a:active {
    background-color: rgba(0, 188, 212, 0.08);
}

@media (min-width: 992px) {
    .mobile-menu-toggle,
    .mobile-menu-overlay,
    .mobile-menu-drawer {
        display: none;
    }
}

.mobile-topbar-back {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

/* وضع زر القائمة في يمين الهيدر للجوال */
.mobile-menu-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
}

.section-title {
    text-align: right;
    font-size: 1.05rem;
    font-weight: 900;
    color: #0f172a;
    margin-bottom: 12px;
    position: relative;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

@media (min-width: 1024px) {
    .section-title {
        font-size: 1.4rem;
    }
}

.section-title::after {
    display: none;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

@media (max-width: 600px) {
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
}

/* ===== Product Card ===== */
.product-card {
    background-color: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 188, 212, 0.15);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

@media (max-width: 600px) {
    .product-image {
        height: 148px;
        border-radius: 16px 16px 0 0;
    }
}

.fav-btn {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: rgba(15, 23, 42, 0.70);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.fav-btn:hover {
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    border-color: rgba(0, 188, 212, 0.35);
}

.fav-btn:active {
    transform: translateY(1px);
}

.fav-btn.is-active {
    color: #e11d48;
    border-color: rgba(225, 29, 72, 0.25);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.product-info {
    padding: 12px 12px 12px;
}

.product-title {
    font-size: 0.95rem;
    color: var(--dark-color);
    margin-bottom: 0.25rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-description {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* في كروت الشبكات نعرض الوصف كسطر واحد مختصر تحت العنوان */
.products-grid .product-description {
    display: -webkit-box;
    display: -moz-box;
    display: box;
    -webkit-line-clamp: 1; /* أقصى شيء سطر واحد داخل الكرت */
    -moz-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    -moz-box-orient: vertical;
    box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 8px;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
}

.product-price {
    font-size: 0.98rem;
    font-weight: 900;
    color: #0f172a;
}

.btn-add-cart {
    background-color: var(--secondary-color);
    color: #111827;
    padding: 0.55rem 0.85rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 900;
    font-size: 0.9rem;
    transition: background-color 0.3s, transform 0.2s;
}

.btn-add-cart:hover {
    background-color: var(--secondary-color);
    transform: scale(1.05);
}

.btn-add-cart:active {
    transform: scale(0.98);
}

/* ===== Footer ===== */
.footer {
    background-color: var(--navy-color);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    color: var(--accent-turquoise);
    margin-bottom: 1rem;
    font-weight: 600;
}

.footer-section p {
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: white;
    text-decoration: none;
    opacity: 0.9;
    transition: opacity 0.3s;
}

.footer-section ul li a:hover {
    opacity: 1;
    color: var(--accent-turquoise);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

/* ===== Notification Toast ===== */
.notification {
    position: fixed;
    left: 50%;
    bottom: 30px;
    transform: translate(-50%, 120%);
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: var(--shadow-hover);
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 5000;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
}

.notification.show {
    transform: translate(-50%, 0);
    opacity: 1;
    pointer-events: auto;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .header {
        padding: 0.6rem 0;
    }

    .header .container {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        min-height: auto;
    }

    .logo {
        margin-bottom: 0.5rem;
    }

    .logo-img {
        height: 75px;
    }

    .nav {
        flex-direction: row;
        gap: 0.8rem;
        justify-content: center;
        flex-wrap: wrap;
        order: 2;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }

    .header-actions {
        order: 3;
        margin-top: 0.5rem;
        gap: 0.8rem;
    }

    .account-btn {
        padding: 0.5rem 1.2rem;
        font-size: 0.9rem;
    }

    .account-btn span {
        display: none;
    }

    .cart-icon {
        order: 3;
        margin-top: 0.5rem;
    }

    .hero-content h2 {
        font-size: 1.8rem;
    }

    .hero-content p {
        font-size: 1rem;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    body {
        padding-top: calc(56px + env(safe-area-inset-top));
        padding-bottom: 0;
    }

    body.has-bottom-nav {
        padding-bottom: 64px;
    }

    .header,
    .footer {
        display: none;
    }

    .mobile-topbar {
        display: block;
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }

    body.has-bottom-nav .mobile-bottom-nav {
        display: block;
    }
}

@media (max-width: 480px) {
    body {
        padding-bottom: 0;
        padding-top: calc(56px + env(safe-area-inset-top));
    }

    body.has-bottom-nav {
        padding-bottom: 64px;
    }

    .header,
    .footer {
        display: none;
    }

    .account-btn {
        display: none;
    }

    body.has-bottom-nav .mobile-bottom-nav {
        display: block;
    }

    .mobile-topbar {
        display: block;
        padding-top: env(safe-area-inset-top);
        height: calc(56px + env(safe-area-inset-top));
    }

    .mobile-fav-btn {
        top: 4px;
        left: 4px;
        width: 36px;
        height: 36px;
    }

    .hero {
        background: var(--primary-color);
        padding: 12px 0 14px;
        border-bottom-left-radius: 22px;
        border-bottom-right-radius: 22px;
        overflow: hidden;
    }

    .mobile-summary-bar {
        bottom: 64px;
    }

    .logo-img {
        height: 65px;
    }

    .nav-link {
        font-size: 0.8rem;
        padding: 0.3rem 0;
    }

    .cart-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .section-title {
        font-size: 1.05rem;
        font-weight: 900;
        color: #0f172a;
    }

    .products-grid,
    .favorites-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .product-image {
        height: 140px;
    }

    .fav-btn {
        top: 4px;
        left: 4px;
        width: 34px;
        height: 34px;
    }

    .fav-btn i {
        font-size: 0.85rem;
    }

    .product-info {
        padding: 0.7rem 0.75rem 0.9rem;
    }

    .product-title {
        font-size: 0.95rem;
        margin-bottom: 0.25rem;
    }

    .product-description {
        display: none;
    }

    .product-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        margin-top: 0.55rem;
    }

    .product-price {
        font-size: 1.05rem;
        text-align: center;
    }

    .btn-add-cart {
        width: 100%;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }

    .categories-section {
        padding: 0.9rem 0 0.25rem;
    }

    .categories-grid {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 12px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 2px 16px 10px;
        margin: 0 -16px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .categories-grid::-webkit-scrollbar {
        display: none;
    }

    .category-card {
        padding: 0;
        border-radius: 14px;
        gap: 6px;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        box-shadow: none;
        flex: 0 0 auto;
        width: 92px;
        scroll-snap-align: start;
    }

    .category-icon {
        width: 52px;
        height: 52px;
        border-radius: 50%;
        background: rgba(13, 59, 102, 0.08);
    }

    .category-name {
        font-size: 0.78rem;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .products-section {
        padding-top: 1.25rem;
    }

    .section-title {
        margin-bottom: 1.25rem;
    }

    .notification {
        left: 12px;
        right: 12px;
        bottom: calc(74px + env(safe-area-inset-bottom));
    }
    /* Raise notification to clear mobile bottom nav and safe-area */
    .notification.show {
        transform: translateY(0);
    }
}

/* ===== Animations ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== Skeleton Loading ===== */
.skel {
    background: linear-gradient(90deg, #eee 25%, #f5f5f5 37%, #eee 63%);
    background-size: 400% 100%;
    animation: skel 1.4s ease infinite;
    display: block;
}

.skel-circle {
    border-radius: 50%;
}

@keyframes skel {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

/* ===== Carousel Styles ===== */
.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-slide {
    flex: 0 0 100%;
    width: 100%;
}

.carousel-slide a {
    display: block;
    text-decoration: none;
}

.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.3);
    color: #0f172a;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.carousel-prev:hover,
.carousel-next:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.carousel-prev {
    right: 12px;
}

.carousel-next {
    left: 12px;
}

.carousel-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;
    z-index: 10;
}

.carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.carousel-dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.carousel-dot.active {
    background: #fff;
    width: 24px;
    border-radius: 5px;
}

@media (max-width: 767px) {
    .carousel-prev,
    .carousel-next {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .carousel-prev {
        right: 8px;
    }

    .carousel-next {
        left: 8px;
    }

    .carousel-dot {
        width: 8px;
        height: 8px;
    }

    .carousel-dot.active {
        width: 20px;
    }
}
