/* =============================================================
   [NW-FEATURES] Wishlist, Search, Recently Viewed, Exit Popup,
   Comparison, Mega Menu, Sticky Cart, Floating WhatsApp,
   Buy Now extensions
   ============================================================= */

/* ---------------------------- Wishlist ---------------------------- */
.nw-wishlist-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--nw-cloud, #E5E7EB);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(4px);
    color: var(--nw-text-gray, #6B7280);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    transition: transform .18s var(--nw-ease-standard, ease), color .18s, background .18s, box-shadow .18s;
    padding: 0;
}
.nw-wishlist-btn svg { width: 18px; height: 18px; }
.nw-wishlist-btn:hover { color: #ef4444; transform: scale(1.08); box-shadow: var(--nw-shadow-md); }
.nw-wishlist-btn.is-active { color: #ef4444; background: #fff; }
@keyframes nw-heartbeat {
    0% { transform: scale(1); }
    25% { transform: scale(1.25); }
    50% { transform: scale(0.92); }
    75% { transform: scale(1.15); }
    100% { transform: scale(1); }
}
.nw-wishlist-btn.is-pulse { animation: nw-heartbeat .6s var(--nw-ease-emphasized, ease); }

.nw-nav__wishlist {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: inherit;
    text-decoration: none;
    margin-right: 8px;
    position: relative;
}
.nw-nav__wishlist svg { width: 22px; height: 22px; }
.nw-nav__wishlist-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: var(--nw-blue, #1D4ED8);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}
.nw-nav__wishlist-count.is-empty {
    background: var(--nw-cloud, #E5E7EB);
    color: var(--nw-text-gray, #6B7280);
}

/* ----------------------------- Search ----------------------------- */
.nw-nav__search-btn {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
}
.nw-nav__search-btn svg { width: 22px; height: 22px; }

#nw-search-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--nw-z-modal, 1050);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 12vh;
}
#nw-search-overlay.is-open { display: flex; }
.nw-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
}
.nw-search__box {
    position: relative;
    width: min(560px, 92vw);
    background: #fff;
    border-radius: var(--nw-radius-lg, 16px);
    box-shadow: var(--nw-shadow-lg);
    overflow: hidden;
}
.nw-search__input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--nw-line, #E5E7EB);
}
.nw-search__input {
    flex: 1;
    border: 0;
    outline: none;
    font-size: 16px;
    background: transparent;
    color: var(--nw-text-dark, #111827);
}
.nw-search__close-btn {
    background: var(--nw-bg, #F7F8FA);
    border: 0;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    cursor: pointer;
    color: var(--nw-text-gray, #6B7280);
    font-size: 20px;
    line-height: 1;
}
.nw-search__results {
    max-height: 60vh;
    overflow: auto;
}
.nw-search__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}
.nw-search__list a {
    display: flex;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: var(--nw-text-dark, #111827);
}
.nw-search__list a:hover { background: var(--nw-bg, #F7F8FA); }
.nw-search__list img,
.nw-search__noimg {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--nw-cloud, #E5E7EB);
    flex-shrink: 0;
}
.nw-search__meta { display: flex; flex-direction: column; gap: 2px; }
.nw-search__name { font-weight: 600; font-size: 14px; }
.nw-search__price { font-size: 13px; color: var(--nw-text-gray, #6B7280); }
.nw-search__spinner,
.nw-search__empty {
    padding: 24px;
    text-align: center;
    color: var(--nw-text-gray, #6B7280);
    font-size: 14px;
}

/* ------------------------- Recently Viewed ------------------------ */
#nw-recently-viewed {
    margin: 48px auto;
    max-width: 1280px;
    padding: 0 16px;
}
.nw-rv__title {
    font-family: var(--nw-font-display);
    font-weight: 800;
    font-size: clamp(20px, 2vw, 24px);
    margin: 0 0 16px;
}
.nw-rv__row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
}
.nw-rv__card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid var(--nw-line, #E5E7EB);
    border-radius: var(--nw-radius-md, 12px);
    text-decoration: none;
    color: var(--nw-text-dark, #111827);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: transform .18s, box-shadow .18s;
}
.nw-rv__card:hover { transform: translateY(-2px); box-shadow: var(--nw-shadow-md); }
.nw-rv__card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    background: var(--nw-cloud, #E5E7EB);
}
.nw-rv__name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.nw-rv__price { font-size: 13px; color: var(--nw-text-gray, #6B7280); }

/* --------------------------- Exit-Intent -------------------------- */
.nw-exit-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--nw-z-modal, 1050);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .28s var(--nw-ease-standard);
    pointer-events: none;
}
.nw-exit-overlay.is-open { opacity: 1; pointer-events: auto; }
.nw-exit__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
}
.nw-exit__modal {
    position: relative;
    background: #fff;
    border-radius: var(--nw-radius-lg, 16px);
    box-shadow: var(--nw-shadow-lg);
    max-width: 440px;
    width: 100%;
    padding: 36px 28px 24px;
    text-align: center;
    transform: translateY(12px);
    transition: transform .28s var(--nw-ease-standard);
}
.nw-exit-overlay.is-open .nw-exit__modal { transform: translateY(0); }
.nw-exit__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    color: var(--nw-text-gray, #6B7280);
    cursor: pointer;
}
.nw-exit__icon { font-size: 56px; line-height: 1; margin-bottom: 8px; }
.nw-exit__title {
    font-family: var(--nw-font-display);
    font-weight: 800;
    font-size: clamp(22px, 2.4vw, 28px);
    margin: 0 0 8px;
    color: var(--nw-ink, #132758);
}
.nw-exit__msg { color: var(--nw-text-gray, #6B7280); margin: 0 0 20px; line-height: 1.5; }
.nw-exit__code {
    margin: 0 0 20px;
    padding: 12px;
    background: var(--nw-blue-pale, #EFF6FF);
    border: 1px dashed var(--nw-blue-bright, #3B82F6);
    border-radius: var(--nw-radius-md, 12px);
}
.nw-exit__code span {
    font-family: var(--nw-font-mono);
    font-size: 18px;
    color: var(--nw-blue, #1D4ED8);
    letter-spacing: 0.08em;
}
.nw-exit__form { display: flex; gap: 8px; margin-bottom: 12px; }
.nw-exit__form input {
    flex: 1;
    padding: 12px 14px;
    border: 1px solid var(--nw-line);
    border-radius: var(--nw-radius-pill, 999px);
    font-size: 14px;
}
.nw-exit__form button {
    padding: 12px 18px;
    border: 0;
    border-radius: var(--nw-radius-pill, 999px);
    background: var(--nw-blue, #1D4ED8);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.nw-exit__nope {
    background: transparent;
    border: 0;
    color: var(--nw-text-gray, #6B7280);
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
}

/* --------------------------- Comparison --------------------------- */
.nw-compare-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--nw-cloud, #E5E7EB);
    color: var(--nw-text-gray, #6B7280);
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: all .18s;
}
.nw-compare-btn svg { width: 14px; height: 14px; }
.nw-compare-btn:hover { color: var(--nw-blue, #1D4ED8); border-color: var(--nw-blue, #1D4ED8); }
.nw-compare-btn.is-active {
    background: var(--nw-blue, #1D4ED8);
    color: #fff;
    border-color: var(--nw-blue, #1D4ED8);
}

#nw-compare-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: -80px;
    background: var(--nw-navy, #0F172A);
    color: #fff;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: var(--nw-z-fixed, 1030);
    box-shadow: 0 -8px 24px rgba(0,0,0,.18);
    transition: bottom .3s var(--nw-ease-emphasized);
}
#nw-compare-bar.is-visible { bottom: 0; }
.nw-compare-bar__count { font-weight: 600; }
.nw-compare-bar__go,
.nw-compare-bar__clear {
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
}
.nw-compare-bar__go {
    background: var(--nw-blue, #1D4ED8);
    color: #fff;
}
.nw-compare-bar__go:disabled { opacity: 0.45; cursor: not-allowed; }
.nw-compare-bar__clear {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,.3);
}

#nw-compare-modal {
    position: fixed;
    inset: 0;
    z-index: var(--nw-z-modal, 1050);
    opacity: 0;
    transition: opacity .28s;
    pointer-events: none;
}
#nw-compare-modal.is-open { opacity: 1; pointer-events: auto; }
.nw-compare-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(6px);
}
.nw-compare-modal__panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: var(--nw-radius-lg, 16px);
    box-shadow: var(--nw-shadow-lg);
    width: min(960px, 94vw);
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    padding: 24px;
}
.nw-compare-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: 0;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.nw-compare-modal__panel h2 {
    margin: 0 0 14px;
    font-family: var(--nw-font-display);
    font-size: 22px;
}
.nw-compare-modal__scroll { overflow: auto; }
.nw-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.nw-compare-table th,
.nw-compare-table td {
    padding: 10px;
    border-bottom: 1px solid var(--nw-line, #E5E7EB);
    text-align: left;
    vertical-align: top;
}
.nw-compare-table thead th {
    font-family: var(--nw-font-display);
    font-weight: 700;
    background: var(--nw-bg, #F7F8FA);
}
.nw-compare-table img { max-width: 120px; border-radius: 8px; }

/* ----------------------- Sticky Mobile Cart Bar ------------------- */
#nw-sticky-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    border-top: 1px solid var(--nw-line, #E5E7EB);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: var(--nw-z-sticky, 1020);
    box-shadow: 0 -4px 16px rgba(0,0,0,.08);
    transition: opacity .25s, transform .25s;
}
#nw-sticky-bar.is-hidden { opacity: 0; transform: translateY(8px); pointer-events: none; }
.nw-sticky__info { flex: 1; min-width: 0; }
.nw-sticky__name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nw-sticky__price { font-size: 13px; color: var(--nw-text-gray, #6B7280); }
.nw-sticky__cta {
    background: var(--nw-blue, #1D4ED8);
    color: #fff;
    border: 0;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
@media (min-width: 769px) { #nw-sticky-bar { display: none !important; } }

/* ----------------------- Floating WhatsApp ------------------------ */
.nw-wa-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    background: #25D366;
    color: #fff;
    padding: 12px 16px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
    z-index: var(--nw-z-fixed, 1030);
    animation: nw-wa-pulse 2.4s ease-in-out infinite;
}
.nw-wa-float svg { width: 22px; height: 22px; fill: #fff; }
@keyframes nw-wa-pulse {
    0%, 100% { box-shadow: 0 6px 18px rgba(37, 211, 102, 0.40); }
    50%      { box-shadow: 0 6px 28px rgba(37, 211, 102, 0.60); }
}
@media (max-width: 768px) {
    .nw-wa-float { padding: 0; width: 52px; height: 52px; justify-content: center; }
    .nw-wa-float span { display: none; }
    body.single-product .nw-wa-float { bottom: 80px; }
}

/* ---------------------- Buy Now (extension) ---------------------- */
.nw-bn__qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0;
}
.nw-bn__qty-label { font-weight: 600; font-size: 14px; }
.nw-bn__qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--nw-line, #E5E7EB);
    border-radius: 999px;
    overflow: hidden;
}
.nw-bn__qty-btn {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    color: var(--nw-text-dark, #111827);
}
.nw-bn__qty-btn:hover { background: var(--nw-bg, #F7F8FA); }
.nw-bn__qty-input {
    width: 48px;
    text-align: center;
    border: 0;
    background: transparent;
    font-weight: 600;
    font-size: 14px;
    -moz-appearance: textfield;
}
.nw-bn__qty-input::-webkit-outer-spin-button,
.nw-bn__qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.nw-bn__variations { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 4px; }
.nw-bn__var-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--nw-text-gray, #6B7280);
}
.nw-bn__var-row select {
    padding: 10px 12px;
    border: 1px solid var(--nw-line, #E5E7EB);
    border-radius: var(--nw-radius-md, 12px);
    font-size: 14px;
    background: #fff;
    color: var(--nw-text-dark, #111827);
}

/* ============================================================
   [MOBILE NAV] hide search + wishlist icons on small screens.
   Matches the existing 900px breakpoint where .nw-nav__links
   hides and .nw-nav__burger reveals. Their counterparts live
   inside the mobile drawer (header.php → <aside class="nw-mobile-drawer">).
   ============================================================ */
@media (max-width: 900px) {
    .nw-nav__search-btn { display: none; }
    .nw-nav__wishlist   { display: none; }
}

/* ============================================================
   [LANG-SWITCHER] EN / FR / AR pill row
   ============================================================ */
.nw-lang-switcher {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-right: 8px;
}
.nw-lang-switcher__btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 4px 9px;
    border-radius: 999px;
    text-decoration: none;
    color: rgba(255,255,255,.55);
    background: transparent;
    transition: background .15s, color .15s;
    line-height: 1;
}
.nw-lang-switcher__btn:hover {
    color: #fff;
    background: rgba(255,255,255,.12);
}
.nw-lang-switcher__btn.is-active {
    background: #0F172A;
    color: #fff;
}

/* Mobile drawer variant */
.nw-mobile-drawer .nw-lang-switcher--mobile {
    display: flex;
    gap: 4px;
    padding: 12px 0 4px;
    border-top: 1px solid rgba(255,255,255,.08);
    margin-top: 8px;
}
.nw-mobile-drawer .nw-lang-switcher--mobile .nw-lang-switcher__btn {
    color: rgba(255,255,255,.6);
    font-size: 12px;
    padding: 6px 12px;
}
.nw-mobile-drawer .nw-lang-switcher--mobile .nw-lang-switcher__btn.is-active {
    background: rgba(255,255,255,.15);
    color: #fff;
}
