/* ═══════════════════════════════════════════════════
   MOBILE BOTTOM NAV — PREMIUM CURVED NOTCH V2
   Architecture: clip-path concave cutout + float circle
   ───────────────────────────────────────────────────
   The notch is a REAL cutout in the nav surface.
   The float circle sits HALF inside the notch.
   Active text/icon: visibility:hidden (space kept).
   Only transform & clip-path. No left/top/margin tricks.
   ═══════════════════════════════════════════════════ */

/* ── Container ── */
.sp-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 1000;
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
}

/* ── Nav surface ── */
.sp-bottom-nav-surface {
    position: absolute;
    inset: 0;
    background: #0F172A;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
    z-index: 1;
    backface-visibility: hidden;
}

/* ── Animation ── */
.sp-bottom-nav-animate .sp-bottom-nav-surface {
    transition: clip-path 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.sp-bottom-nav-animate .sp-bottom-nav-float {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Floating circle ── */
.sp-bottom-nav-float {
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 6px solid #ffffff;
    background: linear-gradient(135deg, #C8A45A 0%, #a8883e 100%);
    box-shadow: 0 6px 24px rgba(200, 164, 90, 0.5);
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* ── UL layout ── */
.sp-bottom-nav-surface ul {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    list-style: none;
    margin: 0;
    padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    height: 100%;
    position: relative;
    z-index: 1;
}

.sp-bottom-nav-surface li {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* ── Link base ── */
.sp-bottom-nav-surface li > a {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: #94a3b8;
    text-decoration: none;
    outline-offset: -4px;
    padding: 8px 4px 4px;
    border-radius: 12px;
    position: relative;
    gap: 3px;
    min-height: 48px;
    min-width: 48px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.25s ease;
}

/* ── Non-active ── */
.sp-bottom-nav-surface li > a:not(.active) {
    opacity: 0.55;
    transition: color 0.25s ease, opacity 0.25s ease;
}

/* ── Hover ── */
.sp-bottom-nav-surface li > a:not(.active):hover {
    color: #C8A45A;
    opacity: 0.85;
}

/* ── Tap scale ── */
.sp-bottom-nav-surface li > a:active {
    transform: scale(0.92);
}

/* ── Active: completely hide link content (float shows the icon instead) ── */
.sp-bottom-nav-surface li > a.active {
    color: transparent !important;
    opacity: 0 !important;
    pointer-events: auto; /* still clickable under the float */
}
.sp-bottom-nav-surface li > a.active i,
.sp-bottom-nav-surface li > a.active i::before,
.sp-bottom-nav-surface li > a.active > span {
    opacity: 0 !important;
    visibility: hidden !important;
    color: transparent !important;
}

/* ── Icon ── */
.sp-bottom-nav-surface i {
    font-size: 22px;
    line-height: 1;
}

/* ── Ripple ── */
.sp-bottom-nav-surface li > a::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.12) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}
.sp-bottom-nav-surface li > a:active::after {
    opacity: 1;
    transition: opacity 0s;
}

/* ── Badge (cart count — outside <a> so it survives active visibility:hidden) ── */
.sp-bottom-nav .sp-mobile-cart-badge {
    font-size: 10px;
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(calc(-50% + 16px));
    background: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    color: #fff;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0F172A;
    z-index: 4;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    line-height: 1;
    pointer-events: none;
}

/* ── Body padding ── */
body.sp-mobile-nav-active {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ═══════════════════════════════════════════════════
   ACCOUNT DROPDOWN
   ═══════════════════════════════════════════════════ */
.sp-bottom-nav .sp-mobile-account-dropdown {
    display: none;
    position: fixed;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    background: #0F172A;
    border-radius: 16px;
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.45);
    z-index: 1001;
    max-width: 320px;
    margin: 0 auto;
    overflow: hidden;
    direction: rtl;
}
.sp-bottom-nav .sp-mobile-account-dropdown.open {
    display: block;
}
.sp-bottom-nav .sp-mobile-account-info {
    padding: 20px 20px 12px;
}
.sp-bottom-nav .sp-mobile-account-name {
    font-size: 16px;
    font-weight: 700;
    color: #f4f1f1;
    margin-bottom: 4px;
}
.sp-bottom-nav .sp-mobile-account-mobile {
    font-size: 13px;
    color: #94a3b8;
}
.sp-bottom-nav .sp-mobile-account-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 4px 0;
}
.sp-bottom-nav .sp-mobile-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #f4f1f1;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    flex-direction: row;
    opacity: 1;
    transform: none;
    min-height: auto;
    visibility: visible;
}
.sp-bottom-nav .sp-mobile-account-item:hover {
    background: rgba(255, 255, 255, 0.05);
}
.sp-bottom-nav .sp-mobile-account-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: #C8A45A;
}

/* ═══════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════ */
@media (min-width: 769px) {
    .sp-bottom-nav,
    body.sp-mobile-nav-active {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .sp-bottom-nav {
        display: block;
    }
    .sp-bottom-nav-float {
        display: flex;
    }
}

@media (max-width: 480px) {
    .sp-bottom-nav {
        height: 64px;
    }

    .sp-bottom-nav-float {
        width: 48px;
        height: 48px;
        border-width: 5px;
        font-size: 19px;
    }
    .sp-bottom-nav-surface li > a {
        font-size: 10px;
        padding: 6px 2px 2px;
        min-height: 44px;
    }
    .sp-bottom-nav-surface i {
        font-size: 20px;
    }
    .sp-bottom-nav .sp-mobile-cart-badge {
        transform: translateX(calc(-50% + 14px));
        top: 0;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
    body.sp-mobile-nav-active {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    .sp-bottom-nav .sp-mobile-account-dropdown {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
    .sp-bottom-nav-animate .sp-bottom-nav-surface,
    .sp-bottom-nav-animate .sp-bottom-nav-float {
        transition: none;
    }
}

/* ── Keyboard focus ── */
.sp-bottom-nav-surface li > a:focus-visible {
    outline: 2px solid #C8A45A;
    outline-offset: -4px;
    border-radius: 14px;
}

/* ═══════════════════════════════════════════════════
   MOBILE SEARCH MODAL (sheet above bottom nav)
   ═══════════════════════════════════════════════════ */
.sp-mobile-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
}
.sp-mobile-search-modal.open {
    display: block;
}
.sp-mobile-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.sp-mobile-search-modal.open .sp-mobile-search-backdrop {
    opacity: 1;
}
.sp-mobile-search-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78vh, 560px);
    background: #0F172A;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translate3d(0, 100%, 0);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
}
.sp-mobile-search-modal.open .sp-mobile-search-sheet {
    transform: translate3d(0, 0, 0);
}
.sp-mobile-search-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.18);
    margin: 4px auto 14px;
    flex-shrink: 0;
}
.sp-mobile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #f8fafc;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.sp-mobile-search-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #e2e8f0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sp-mobile-search-close:hover,
.sp-mobile-search-close:active {
    background: rgba(255, 255, 255, 0.14);
}
.sp-mobile-search-box {
    display: flex;
    align-items: center;
    height: 52px;
    border-radius: 16px;
    overflow: hidden;
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.sp-mobile-search-icon {
    color: #94a3b8;
    font-size: 16px;
    padding-inline-start: 16px;
    flex-shrink: 0;
}
.sp-mobile-search-box .sp-search-input {
    flex: 1;
    border: none;
    padding: 0 12px;
    outline: none;
    background: transparent;
    color: #f1f5f9;
    font-size: 15px;
    min-width: 0;
    height: 100%;
}
.sp-mobile-search-box .sp-search-input::placeholder {
    color: #64748b;
}
.sp-mobile-search-box .sp-search-btn {
    width: 48px;
    height: 100%;
    border: none;
    background: linear-gradient(135deg, #C8A45A 0%, #a8883e 100%);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.sp-mobile-search-suggestions {
    position: static !important;
    margin-bottom: 12px;
    max-height: min(48vh, 360px);
    overflow-y: auto;
    flex: 1;
    background: #1e293b !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    flex-shrink: 0;
}
.sp-mobile-search-suggestions[style*="display: block"],
.sp-mobile-search-suggestions[style*="display:block"] {
    flex-shrink: 1;
}
body.sp-mobile-search-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    .sp-mobile-search-modal {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-mobile-search-backdrop,
    .sp-mobile-search-sheet {
        transition: none;
    }
}