/* =============================================
   MOBILE BOTTOM NAVIGATION BAR
   =============================================
   Material Design 3 / Android-First Soft Luxury Navigation
   Design 2: Circular Active Indicator Container
   Branding: Black, White, Luxury Gold (#D4A017)

   UPDATED: full-width bar flush with the bottom edge of the
   viewport (no floating margins/pill shape), reduced height,
   and smaller icons/labels.
   ============================================= */

@media (max-width: 991px) {
    .pvc-bottom-nav {
        view-transition-name: bottom-nav;
    }

    /* The nav is `position: fixed`, so it's removed from normal
       document flow and reserves no space of its own — nothing
       pushes the rest of the page up to clear it. Without this, the
       last ~68-76px of every page's content (usually the footer's
       Quick Links column) renders underneath the fixed bar instead
       of above it. This is global (bottom-nav.css loads on every
       page via head.php) since every page has the same nav. */
    body {
        padding-bottom: calc(68px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 991px) {

    /* Navigation Container — edge-to-edge, flush with bottom, with room to breathe */
    .pvc-bottom-nav {
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: calc(68px + env(safe-area-inset-bottom)) !important;
        padding-bottom: env(safe-area-inset-bottom) !important;
        background: #000 !important;
        border-radius: 0 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        z-index: 99999 !important;
        box-sizing: border-box !important;
        padding-left: 4px !important;
        padding-right: 4px !important;
        contain: layout style;
    }

    .pvc-bottom-cart-badge {
        position: absolute;
        top: -4px;
        right: -6px;
        min-width: 18px;
        height: 18px;
        padding: 0 4px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        border-radius: 999px;
        background: #D4AF37;
        color: #000 !important;
        font-family: 'Inter', system-ui, -apple-system, sans-serif;
        font-size: 10px;
        font-weight: 900;
        line-height: 1;
        z-index: 5;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    /* .pvc-bottom-nav-item.active span (below) colors every span inside
       the active tab gold for its text label — it unintentionally also
       matches this badge, which needs to stay black-on-gold. The ID
       selector's specificity guarantees this wins regardless. */
    #pvc-bottom-cart-count {
        color: #000 !important;
    }

    /* Navigation Item — reduced touch target, still tappable */
    .pvc-bottom-nav-item {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        text-decoration: none !important;
        color: #6B7280 !important;
        font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
        font-size: 10px !important;
        font-weight: 500 !important;
        position: relative !important;
        height: 100% !important;
        flex: 1 !important;
        padding: 8px 0 12px !important;
        gap: 3px !important;
        min-height: 48px !important;
        box-sizing: border-box !important;
        background: transparent !important;
        border: none !important;
        border-radius: 12px !important;
        margin: 0 !important;
        transition: background-color 150ms ease, color 180ms cubic-bezier(.4, 0, .2, 1) !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* Android Ripple Effect on Tap */
    .pvc-bottom-nav-item:active {
        background-color: rgba(212, 160, 23, 0.10) !important;
    }

    /* Icon Container Wrapper — smaller, protected from flex squish */
    .pvc-nav-icon-wrap {
        position: relative;
        width: 28px;
        height: 28px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        background: transparent;
        transition: width 180ms cubic-bezier(.4, 0, .2, 1),
            height 180ms cubic-bezier(.4, 0, .2, 1),
            background 180ms cubic-bezier(.4, 0, .2, 1),
            box-shadow 180ms cubic-bezier(.4, 0, .2, 1),
            transform 180ms cubic-bezier(.4, 0, .2, 1);
        transform: scale(1);
    }

    /* Dual-State SVG Icon Rules — smaller icons */
    .pvc-bottom-nav-item .icon-outline {
        display: block !important;
        width: 19px !important;
        height: 19px !important;
        stroke: #fff !important;
        stroke-width: 2px !important;
        fill: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: stroke 180ms ease, transform 180ms ease !important;
    }

    .pvc-bottom-nav-item .icon-filled {
        display: none !important;
        width: 17px !important;
        height: 17px !important;
        fill: #FFFFFF !important;
        stroke: none !important;
        margin: 0 !important;
        padding: 0 !important;
        transition: transform 180ms ease !important;
    }

    /* Inactive Labels — smaller */
    .pvc-bottom-nav-item span {
        font-size: 10px !important;
        font-weight: 500 !important;
        color: #fff !important;
        opacity: 0.85;
        transition: color 180ms cubic-bezier(.4, 0, .2, 1), opacity 180ms cubic-bezier(.4, 0, .2, 1), font-weight 180ms cubic-bezier(.4, 0, .2, 1) !important;
        line-height: 1.1 !important;
    }

    /* Active State Underline Indicator */
    .pvc-bottom-nav-item::after {
        content: '';
        position: absolute;
        bottom: 3px;
        left: 50%;
        transform: translateX(-50%) scaleX(0);
        width: 22px;
        height: 2px;
        background-color: #D4A017;
        border-radius: 999px;
        transition: transform 180ms cubic-bezier(.4, 0, .2, 1), opacity 180ms cubic-bezier(.4, 0, .2, 1);
        opacity: 0;
    }

    /* ACTIVE CONTAINER (Design 2: Gold Gradient Circle) — smaller */
    .pvc-bottom-nav-item.active .pvc-nav-icon-wrap {
        width: 34px !important;
        height: 34px !important;
        border-radius: 50% !important;
        background: linear-gradient(180deg, #B8860B 0%, #D4A017 50%, #B8860B 100%) !important;
        border: none !important;
        animation: pvcCirclePop 180ms cubic-bezier(.4, 0, .2, 1) forwards;
    }

    @keyframes pvcCirclePop {
        0% {
            transform: scale(0.92);
        }

        100% {
            transform: scale(1);
        }
    }

    /* Active Icon State — Display Filled Icon */
    .pvc-bottom-nav-item.active .icon-outline {
        display: none !important;
    }

    .pvc-bottom-nav-item.active .icon-filled {
        display: block !important;
        fill: #FFFFFF !important;
        transform: scale(1.05) !important;
    }

    /* Active Label */
    .pvc-bottom-nav-item.active span {
        color: #D4A017 !important;
        font-weight: 600 !important;
        opacity: 1 !important;
    }

    /* Active Underline */
    .pvc-bottom-nav-item.active::after {
        display: none;
        transform: translateX(-50%) scaleX(1);
        opacity: 1;
    }

    /* Hover effect */
    @media (hover: hover) {
        .pvc-bottom-nav-item:hover .pvc-nav-icon-wrap svg {
            stroke: #D4A017 !important;
        }

        .pvc-bottom-nav-item:hover span {
            color: #D4A017 !important;
            opacity: 1 !important;
        }
    }

    /* =============================================
       CENTER SEARCH BUTTON
       Permanently raised gold circle — resized to match
       the shorter bar height
       ============================================= */
    .pvc-bottom-nav-item.pvc-nav-search-center {
        position: relative;
        z-index: 2;
        flex: 0.9 !important;
        /* Reset native <button> UA styling that was squashing the circle */
        -webkit-appearance: none !important;
        appearance: none !important;
        outline: none !important;
        cursor: pointer !important;
        font: inherit !important;
        line-height: normal !important;
    }

    .pvc-bottom-nav-item.pvc-nav-search-center .pvc-nav-icon-wrap {
        width: 42px;
        height: 42px;
        aspect-ratio: 1 / 1;
        flex-shrink: 0;
        background: linear-gradient(180deg, #B8860B 0%, #D4A017 50%, #B8860B 100%);
        border: 2px solid #000;
        box-shadow: 0 5px 14px rgba(212, 160, 23, 0.4);
        transform: translateY(-12px);
    }

    .pvc-bottom-nav-item.pvc-nav-search-center .pvc-nav-icon-wrap svg {
        stroke: #000 !important;
        width: 18px !important;
        height: 18px !important;
    }

    .pvc-bottom-nav-item.pvc-nav-search-center span {
        transform: translateY(-9px);
        color: #D4A017 !important;
        font-weight: 600 !important;
        opacity: 1 !important;
    }

    /* Keep the raised look even when marked active — just scale up slightly */
    .pvc-bottom-nav-item.pvc-nav-search-center.active .pvc-nav-icon-wrap {
        width: 42px !important;
        height: 42px !important;
        transform: translateY(-12px) scale(1.05);
        animation: none;
    }

    .pvc-bottom-nav-item.pvc-nav-search-center::after {
        display: none !important;
    }

}

@media (min-width: 992px) {
    .pvc-bottom-nav {
        display: none !important;
    }
}