:root {
    --premium-bg: #f6f3ee;
    --premium-ink: #151515;
    --premium-muted: #6d6a62;
    --premium-surface: #fffdfa;
    --premium-surface-strong: #fff7ea;
    --premium-border: rgba(21, 21, 21, .11);
    --premium-emerald: #0d6b57;
    --premium-coral: #e65f47;
    --premium-amber: #d99a28;
    --premium-plum: #59355b;
    --premium-shadow: 0 16px 34px rgba(38, 31, 24, .12);
    --premium-shadow-soft: 0 8px 18px rgba(38, 31, 24, .08);
    --premium-radius: 8px;
}

html {
    scroll-padding-top: 96px;
    max-width: 100%;
    overflow-x: hidden;
}

body {
    color: var(--premium-ink) !important;
    background:
        linear-gradient(180deg, #fffaf2 0%, var(--premium-bg) 42%, #f9fbf5 100%) !important;
    font-family: 'Cairo', 'Tajawal', 'Roboto', Arial, sans-serif !important;
    max-width: 100%;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background-image:
        linear-gradient(90deg, rgba(13, 107, 87, .045) 1px, transparent 1px),
        linear-gradient(180deg, rgba(89, 53, 91, .04) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,.7), transparent 72%);
}

#particles-js {
    display: none !important;
}

main.container {
    max-width: none;
    padding-inline: 0;
}

.main-navbar.navbar,
.customer-shell-nav {
    background: rgba(255, 253, 250, .92) !important;
    border-bottom: 1px solid var(--premium-border);
    box-shadow: 0 10px 30px rgba(21, 21, 21, .08);
    backdrop-filter: blur(18px);
    animation: none !important;
}

.main-navbar .container,
.customer-nav-container {
    width: min(1180px, calc(100% - 40px));
    padding-inline: clamp(10px, 1.6vw, 22px) !important;
}

.customer-shell-nav .customer-nav-container {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 18px;
}

.customer-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--premium-ink) !important;
    text-decoration: none !important;
    font-weight: 950;
    letter-spacing: 0;
}

.logo-img {
    width: 52px !important;
    height: 52px !important;
    border-radius: var(--premium-radius) !important;
    border-color: rgba(13, 107, 87, .28) !important;
    box-shadow: var(--premium-shadow-soft) !important;
}

.navbar-brand {
    color: var(--premium-ink) !important;
    text-shadow: none !important;
    letter-spacing: 0 !important;
    font-size: 1.08rem !important;
    font-weight: 950 !important;
}

.customer-brand span {
    font-size: 1.08rem;
    color: var(--premium-ink);
}

.customer-menu-toggle {
    margin-inline-start: auto;
}

.customer-nav-collapse {
    align-items: center;
    gap: 16px;
}

.customer-primary-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-inline: auto 0 !important;
}

.nav-link {
    color: var(--premium-ink) !important;
    text-shadow: none !important;
    font-size: .98rem !important;
    font-weight: 850 !important;
    border-radius: var(--premium-radius);
    padding: .55rem .75rem !important;
}

.customer-primary-nav .nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    white-space: nowrap;
}

.customer-nav-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: nowrap;
    margin-inline-start: auto;
}

.nav-action-btn,
.customer-language-switcher .lang-btn {
    min-height: 42px;
    border-radius: var(--premium-radius) !important;
    border: 1px solid var(--premium-border) !important;
    background: #fff !important;
    color: var(--premium-ink) !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 11px !important;
    font-family: 'Cairo', 'Tajawal', Arial, sans-serif !important;
    font-size: .9rem !important;
    font-weight: 900 !important;
    line-height: 1.25 !important;
    text-decoration: none !important;
    text-shadow: none !important;
    white-space: nowrap !important;
    box-shadow: none !important;
}

.nav-action-btn:hover,
.customer-language-switcher .lang-btn:hover {
    background: var(--premium-surface-strong) !important;
    color: var(--premium-emerald) !important;
}

.nav-action-strong,
.customer-language-switcher .lang-btn.active {
    background: var(--premium-emerald) !important;
    color: #fff !important;
    border-color: var(--premium-emerald) !important;
}

.nav-user-chip {
    max-width: 155px;
}

.nav-user-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-logout-form {
    margin: 0;
}

.nav-logout-form button {
    cursor: pointer;
}

.customer-language-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    flex-wrap: nowrap;
}

.customer-language-switcher .flag-icon {
    margin: 0 !important;
}

#cartCountBadge,
#favoriteCount,
.nav-action-btn .badge {
    min-width: 22px;
    min-height: 22px;
    display: inline-grid;
    place-items: center;
    padding: 2px 6px;
    font-size: .78rem;
}

.nav-link:hover,
.nav-link.active {
    color: var(--premium-emerald) !important;
    background: rgba(13, 107, 87, .08);
    transform: none !important;
}

.admin-entry-link {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid rgba(13, 107, 87, .18);
    background: #eef8f1 !important;
    color: var(--premium-emerald) !important;
    white-space: normal;
    text-align: center;
}

.admin-entry-link:hover {
    background: var(--premium-emerald) !important;
    color: #fff !important;
}

.navbar-toggler {
    border: 1px solid var(--premium-border);
    border-radius: var(--premium-radius);
    background: #fff;
}

.auth-buttons .btn-outline-light,
.auth-buttons .btn-outline-dark,
.language-switcher .lang-btn,
#favoritesBtn,
[data-cart-open] {
    min-height: 42px;
    max-width: none !important;
    border-radius: var(--premium-radius) !important;
    border: 1px solid var(--premium-border) !important;
    background: #fff !important;
    color: var(--premium-ink) !important;
    text-shadow: none !important;
    box-shadow: none !important;
    white-space: normal !important;
    line-height: 1.35 !important;
    text-align: center;
}

.auth-buttons .btn-outline-light:hover,
.auth-buttons .btn-outline-dark:hover,
.language-switcher .lang-btn:hover,
#favoritesBtn:hover,
[data-cart-open]:hover {
    background: var(--premium-surface-strong) !important;
    color: var(--premium-emerald) !important;
    transform: none !important;
}

.language-switcher .lang-btn.active {
    background: var(--premium-emerald) !important;
    color: #fff !important;
}

.badge,
#cartCountBadge,
#favoriteCount {
    border-radius: 999px !important;
}

.phase4a-home {
    color: var(--premium-ink);
    background: transparent !important;
    padding-top: 22px;
    width: 100% !important;
    margin-inline: 0 !important;
    overflow-x: clip;
}

.section-shell {
    width: min(1200px, calc(100% - 30px)) !important;
}

.shop-hero {
    min-height: 520px;
    border-radius: var(--premium-radius) !important;
    padding: clamp(24px, 4vw, 48px);
    border: 1px solid var(--premium-border);
    background:
        linear-gradient(135deg, rgba(255,253,250,.96) 0%, rgba(255,247,234,.98) 54%, rgba(239,248,242,.96) 100%) !important;
    box-shadow: var(--premium-shadow);
}

.shop-hero::before {
    display: none;
}

.eyebrow {
    color: var(--premium-emerald) !important;
    letter-spacing: 0 !important;
    font-weight: 900;
}

.shop-hero h1 {
    color: var(--premium-ink);
    font-size: clamp(2.15rem, 4vw, 4.35rem);
    line-height: 1.12;
    letter-spacing: 0;
}

.shop-hero p,
.catalog-toolbar p,
.whatsapp-cta p,
.conversion-banner p,
.empty-state p {
    color: var(--premium-muted) !important;
}

.hero-actions,
.filter-actions,
.product-actions,
.toolbar-actions,
.promo-actions,
.quantity-box {
    gap: 10px;
}

.hero-actions,
.whatsapp-cta,
.promo-actions {
    align-items: center;
}

.btn,
button,
a.btn {
    letter-spacing: 0 !important;
}

.btn-primary-cta,
.btn-shop-primary {
    min-height: 44px;
    min-width: 148px;
    border-radius: var(--premium-radius) !important;
    background: linear-gradient(135deg, var(--premium-emerald), #0f8a6f) !important;
    color: #fff !important;
    font-weight: 900 !important;
    box-shadow: 0 10px 20px rgba(13, 107, 87, .22) !important;
    white-space: nowrap;
    overflow-wrap: normal;
    text-align: center;
    flex-shrink: 0;
}

.btn-secondary-cta,
.btn-reset-cta,
.btn-shop-outline {
    min-height: 44px;
    min-width: 150px;
    border-radius: var(--premium-radius) !important;
    background: #fff !important;
    color: var(--premium-ink) !important;
    border: 1px solid var(--premium-border) !important;
    font-weight: 900 !important;
    white-space: nowrap;
    overflow-wrap: normal;
    text-align: center;
    flex-shrink: 0;
}

.btn-icon-cta,
.btn-shop-icon,
.favorite-btn-v2 {
    border-radius: var(--premium-radius) !important;
    background: #fff !important;
    color: var(--premium-emerald) !important;
    border: 1px solid var(--premium-border) !important;
    box-shadow: var(--premium-shadow-soft);
}

.hero-metrics div,
.trust-strip div,
.category-card,
.filter-card,
.catalog-toolbar,
.product-card-v2,
.promo-card,
.conversion-banner,
.whatsapp-cta,
.detail-shell,
.review-panel,
.related-panel,
.favorites-modern-panel,
.cart-items-list,
.summary-card,
.checkout-panel,
.order-wrapper {
    border-radius: var(--premium-radius) !important;
    border: 1px solid var(--premium-border) !important;
    box-shadow: var(--premium-shadow-soft) !important;
}

.hero-metrics div,
.trust-strip div,
.category-card,
.catalog-toolbar,
.filter-card,
.product-card-v2,
.promo-card,
.review-item,
.cart-items-list,
.summary-card,
.checkout-panel {
    background: var(--premium-surface) !important;
}

.hero-metrics strong,
.category-icon,
.detail-price strong,
.promo-card__price strong {
    color: var(--premium-emerald) !important;
}

.hero-product {
    border-radius: var(--premium-radius) !important;
    border: 1px solid var(--premium-border);
    box-shadow: var(--premium-shadow-soft);
}

.hero-product--main {
    min-height: 320px;
}

.hero-product--main div {
    background: #fff;
}

.hero-product h3,
.product-body h3,
.promo-card__body h3,
.detail-info h1,
.section-heading h2,
.catalog-toolbar h2 {
    color: var(--premium-ink);
    letter-spacing: 0;
}

.hero-product strong,
.product-price-row strong {
    color: var(--premium-coral) !important;
}

.trust-strip i,
.review-stars,
.rating i {
    color: var(--premium-amber) !important;
}

.category-card:hover,
.category-card.active {
    border-color: rgba(13, 107, 87, .45) !important;
    background: #f3fbf6 !important;
    transform: translateY(-2px);
}

.category-icon {
    background: linear-gradient(135deg, var(--premium-emerald), var(--premium-plum)) !important;
    color: #fff !important;
    border-radius: var(--premium-radius) !important;
}

.product-card-v2,
.promo-card {
    position: relative;
}

.product-card-v2::after,
.promo-card::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: inherit;
    background:
        linear-gradient(135deg, rgba(13,107,87,.12), transparent 26%),
        linear-gradient(315deg, rgba(230,95,71,.12), transparent 24%);
    opacity: .65;
}

.product-card-v2 > *,
.promo-card > * {
    position: relative;
    z-index: 1;
}

.product-card-v2:hover,
.promo-card:hover {
    transform: translateY(-3px);
}

.product-media,
.promo-card__image {
    background: #efe8dc !important;
}

.product-badge,
.promo-card__badge {
    border-radius: var(--premium-radius) !important;
    background: var(--premium-amber) !important;
    color: #20150a !important;
}

.product-badge--soft {
    background: #fff !important;
    color: var(--premium-emerald) !important;
}

.product-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 44px 44px;
}

.product-actions .btn-primary-cta,
.promo-actions .btn-shop-primary {
    min-width: 0;
    width: 100%;
    white-space: nowrap;
}

.rating {
    background: #fff4dc !important;
    color: #7a4b00 !important;
    border-radius: var(--premium-radius) !important;
}

.input-icon input,
.filter-group input,
.filter-group select,
.sort-form select,
.form-control,
.form-select {
    border-radius: var(--premium-radius) !important;
    border-color: var(--premium-border) !important;
}

.input-icon input:focus,
.filter-group input:focus,
.filter-group select:focus,
.sort-form select:focus,
.form-control:focus,
.form-select:focus {
    border-color: var(--premium-emerald) !important;
    box-shadow: 0 0 0 4px rgba(13, 107, 87, .12) !important;
}

.conversion-banner {
    background: linear-gradient(135deg, #fffdfa, #fff4df) !important;
}

.conversion-points div {
    border-radius: var(--premium-radius) !important;
    background: #fffdfa !important;
    border: 1px solid var(--premium-border);
}

.whatsapp-cta {
    background: linear-gradient(135deg, #fffdfa, #eaf7ef) !important;
}

.whatsapp-cta .btn {
    min-height: 46px;
    min-width: 178px;
    background: #128c7e !important;
    color: #fff !important;
    border-radius: var(--premium-radius) !important;
    white-space: nowrap;
    flex-shrink: 0;
}

.detail-media,
.detail-description,
.detail-trust div {
    border-radius: var(--premium-radius) !important;
    border: 1px solid var(--premium-border) !important;
    background: #fffdfa !important;
}

.detail-media img,
.quick-card img,
.promo-card__image img,
.product-media img,
.cart-item-card .item-image img,
.summary-item img {
    border-radius: var(--premium-radius) !important;
}

.cart-header {
    background: linear-gradient(135deg, var(--premium-emerald), var(--premium-plum)) !important;
    border-radius: var(--premium-radius) !important;
}

.cart-item-card {
    align-items: stretch;
}

.summary-card,
.summary-panel {
    top: 92px !important;
}

.btn-summary,
.btn-place-order,
.empty-cart-container .btn-continue-shopping,
.empty-cart-container .btn-primary.btn-lg,
.btn-home {
    min-width: 0 !important;
    width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
}

.checkout-panel h2,
.summary-panel .summary-header h2 {
    font-size: 1.35rem;
}

.secure-info {
    color: var(--premium-muted) !important;
}

.payment-paused-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    margin-top: 14px;
    border-radius: var(--premium-radius);
    border: 1px solid rgba(217, 154, 40, .35);
    background: #fff7e7;
    color: #5f430f;
    font-weight: 800;
    line-height: 1.65;
}

.catalog-main,
#categories-section,
#products-section {
    transition: opacity .18s ease, transform .18s ease;
}

.catalog-main.is-loading,
#products-section.is-loading {
    opacity: .55;
    pointer-events: none;
    transform: translateY(4px);
}

.catalog-live-status {
    position: fixed;
    inset-block-end: 24px;
    inset-inline-end: 24px;
    z-index: 2100;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-radius: var(--premium-radius);
    background: var(--premium-ink);
    color: #fff;
    box-shadow: var(--premium-shadow);
    font-weight: 900;
}

.catalog-live-status.show {
    display: inline-flex;
}

.order-wrapper {
    max-width: 680px !important;
    background: linear-gradient(135deg, #fffdfa, #eef8f1) !important;
    color: var(--premium-ink) !important;
}

.order-wrapper h2 {
    color: var(--premium-emerald) !important;
}

.order-wrapper .lead {
    color: var(--premium-coral) !important;
}

.btn-home {
    background: var(--premium-emerald) !important;
    color: #fff !important;
    border-radius: var(--premium-radius) !important;
}

footer {
    background: #151515 !important;
    border-top: 4px solid var(--premium-amber);
}

#backToTop,
#navArrowRight {
    border-radius: var(--premium-radius) !important;
    background: var(--premium-emerald) !important;
}

@media (max-width: 991.98px) {
    .main-navbar .container,
    .customer-nav-container {
        width: min(calc(100% - 24px), 1180px);
    }

    .customer-shell-nav .customer-nav-container {
        min-height: 68px;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 10px;
    }

    .customer-brand {
        max-width: calc(100% - 76px);
        min-width: 0;
    }

    .customer-brand span {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .customer-menu-toggle {
        margin-inline-start: 0;
        flex: 0 0 auto;
    }

    .customer-nav-collapse {
        flex-basis: 100%;
        margin-top: 12px;
        padding: 14px;
        border: 1px solid var(--premium-border);
        border-radius: var(--premium-radius);
        background: rgba(255,253,250,.98);
        box-shadow: var(--premium-shadow-soft);
    }

    .customer-primary-nav,
    .customer-nav-actions,
    .customer-language-switcher {
        width: 100%;
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 8px;
        margin: 0 !important;
    }

    .customer-primary-nav .nav-link,
    .nav-action-btn,
    .customer-language-switcher .lang-btn {
        width: 100%;
        justify-content: center;
        white-space: normal !important;
        min-width: 0;
        text-align: center;
    }

    .nav-user-chip {
        max-width: none;
    }

    .main-navbar .navbar-collapse {
        padding: 14px 0;
    }

    .main-navbar .d-flex,
    .language-switcher {
        align-items: stretch !important;
    }

    .language-switcher .lang-btn,
    .auth-buttons .btn-outline-light,
    .auth-buttons .btn-outline-dark,
    #favoritesBtn,
    [data-cart-open] {
        width: 100%;
        justify-content: center;
    }

    .shop-hero {
        min-height: auto;
        grid-template-columns: minmax(0, 1fr) !important;
        overflow: hidden;
    }

    .shop-hero__content,
    .shop-hero__visual {
        min-width: 0;
    }

    .hero-product-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .detail-grid,
    .conversion-banner,
    .whatsapp-cta {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767.98px) {
    .customer-shell-nav.fixed-top {
        position: sticky !important;
        top: 0;
        z-index: 1030;
    }

    main.container {
        margin-top: 0 !important;
        padding-top: 16px !important;
    }

    .section-shell {
        width: min(calc(100% - 22px), 1200px) !important;
        max-width: calc(100% - 22px) !important;
    }

    .shop-hero {
        padding: 22px 14px;
        text-align: center !important;
    }

    .shop-hero__content {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .shop-hero h1 {
        max-width: min(300px, 100%) !important;
        width: 100%;
        margin-inline: auto;
        font-size: 1.32rem !important;
        line-height: 1.34;
        text-align: center !important;
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        word-break: break-word;
    }

    .shop-hero p {
        max-width: min(310px, 100%) !important;
        width: 100%;
        margin-inline: auto;
        text-align: center !important;
        font-size: .98rem !important;
        overflow-wrap: anywhere !important;
        word-break: break-word;
    }

    .customer-brand .logo-img {
        display: none;
    }

    .customer-shell-nav .customer-nav-container {
        position: relative;
        display: grid;
        grid-template-columns: 58px minmax(0, 1fr) 58px;
        align-items: center;
        justify-content: stretch;
        width: 100%;
    }

    .customer-brand {
        position: static;
        grid-column: 2;
        justify-self: center;
        transform: none;
        max-width: 170px;
    }

    .customer-menu-toggle {
        position: static;
        grid-column: 1;
        justify-self: start;
        transform: none;
    }

    .customer-nav-collapse {
        grid-column: 1 / -1;
        width: 100%;
        max-height: calc(100vh - 96px);
        overflow-y: auto;
    }

    .hero-metrics {
        max-width: 100%;
        grid-template-columns: 1fr !important;
    }

    .hero-actions,
    .filter-actions {
        display: grid !important;
        grid-template-columns: 1fr;
        align-items: stretch;
        width: 100%;
    }

    .hero-actions .btn,
    .filter-actions .btn,
    .whatsapp-cta .btn {
        width: 100% !important;
        max-width: 100%;
        min-width: 0 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
        line-height: 1.45;
    }

    .hero-product-grid,
    .trust-strip,
    .detail-trust,
    .conversion-points {
        grid-template-columns: 1fr !important;
    }

    .product-grid,
    .promo-grid,
    .favorites-modern-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        width: 100%;
    }

    .product-actions,
    .product-card-v2 .product-actions {
        grid-template-columns: minmax(0, 1fr) 42px !important;
    }

    .product-actions .js-quick-view {
        display: inline-flex !important;
    }

    .product-actions a.btn-icon-cta {
        display: none !important;
    }

    .cart-item-card {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr);
        gap: 12px;
    }

    .cart-item-card .item-actions {
        grid-column: 1 / -1;
        width: 100% !important;
        flex-direction: row;
    }

    .quantity-control {
        flex: 1;
    }
}

@media (max-width: 460px) {
    .product-grid,
    .promo-grid,
    .favorites-modern-grid {
        grid-template-columns: 1fr !important;
    }

    .quick-card {
        grid-template-columns: 1fr !important;
    }
}
