/* ═══════════════════════════════════════════════════════════
   PRAYAG PANDITS — FLY CART (Mini Cart)

   Smooth centered reveal animation.
   Scale-in from 0.92 → 1.0 with fade + backdrop blur.
   Mobile: bottom sheet slides up.

   Uses design system variables.
   ═══════════════════════════════════════════════════════════ */

.ppn-fc {
    --fc-ease: cubic-bezier(0.32, 0.94, 0.6, 1); /* Headspace premium easing */
}

/* ═══ FLOATING BUTTON ═══ */
.ppn-fc-btn {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9990;
    width: 48px;
    height: 48px;
    border-radius: var(--ppn-radius-circle);
    border: none;
    background: var(--ppn-maroon);
    color: var(--ppn-white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(150, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s var(--fc-ease), box-shadow 0.2s var(--fc-ease);
}
.ppn-fc-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(150, 0, 0, 0.35), 0 3px 12px rgba(0, 0, 0, 0.12);
}
.ppn-fc-btn:active {
    transform: scale(0.95);
}

/* Cart count badge */
.ppn-fc-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--ppn-radius-pill);
    background: var(--ppn-saffron);
    color: var(--ppn-white);
    font-family: 'Inter', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(232, 115, 26, 0.4);
    transition: transform 0.3s var(--fc-ease);
}
.ppn-fc-count:empty,
.ppn-fc-count[data-count="0"] {
    display: none;
}

/* Pulse animation when cart updates */
@keyframes ppn-fc-pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.ppn-fc-count.ppn-fc-pulse {
    animation: ppn-fc-pulse 0.4s var(--fc-ease);
}

/* ═══ BACKDROP ═══ */
.ppn-fc-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99991;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms var(--fc-ease), visibility 0s 280ms;
    cursor: pointer;
}
.ppn-fc.is-open .ppn-fc-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 280ms var(--fc-ease), visibility 0s;
}

/* ═══ CART PANEL — CENTERED SMOOTH REVEAL ═══ */
.ppn-fc-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    z-index: 99992;
    width: 420px;
    max-width: 92vw;
    max-height: 80vh;
    background: linear-gradient(180deg, var(--ppn-bg) 0%, var(--ppn-bg-cream) 100%);
    border-radius: var(--ppn-radius-xl);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 280ms var(--fc-ease), transform 280ms var(--fc-ease), visibility 0s 280ms;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.18), 0 8px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}
.ppn-fc.is-open .ppn-fc-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
    transition: opacity 280ms var(--fc-ease), transform 280ms var(--fc-ease), visibility 0s;
}

/* ═══ PANEL HEADER ═══ */
.ppn-fc-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}
.ppn-fc-panel-header h4 {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: rgb(68, 68, 68);
    margin: 0;
}
.ppn-fc-close {
    width: 36px;
    height: 36px;
    border-radius: var(--ppn-radius-circle);
    border: none;
    background: transparent;
    color: rgb(68, 68, 68);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms var(--fc-ease);
}
.ppn-fc-close:hover {
    background: rgba(68, 68, 68, 0.08);
}

/* ═══ PANEL BODY ═══ */
.ppn-fc-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
    -webkit-overflow-scrolling: touch;
}

/* ═══ PRIORITY SCHEDULING PROGRESS BAR ═══ */
.ppn-fc-progress {
    background: var(--ppn-bg-parchment);
    border: 1px solid var(--ppn-border-muted);
    border-radius: var(--ppn-radius-ms);
    padding: 12px 14px;
    margin-bottom: 14px;
}
.ppn-fc-progress__text {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    color: var(--ppn-brown-warm);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}
.ppn-fc-progress__icon { font-size: 0.875rem; flex-shrink: 0; }
.ppn-fc-progress__track {
    height: 6px;
    background: var(--ppn-border-muted);
    border-radius: 3px;
    overflow: hidden;
}
.ppn-fc-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ppn-maroon), var(--ppn-saffron));
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}
/* Clean fill — no shimmer (calmer for spiritual context) */
/* Unlocked state — green + pulse */
.ppn-fc-progress__fill.unlocked {
    background: linear-gradient(90deg, var(--ppn-green-hover), var(--ppn-green));
}
@keyframes ppnUnlockPulse {
    0%   { transform: scaleY(1); }
    50%  { transform: scaleY(2); }
    100% { transform: scaleY(1); }
}
.ppn-fc-progress__fill.unlocked {
    animation: ppnUnlockPulse 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ppn-fc-progress__done strong { color: var(--ppn-green-hover); }

/* ═══ WOOCOMMERCE MINI CART STYLES ═══ */
.ppn-fc-body .woocommerce-mini-cart {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ppn-fc-body .woocommerce-mini-cart li.woocommerce-mini-cart-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    font-family: 'Inter', -apple-system, sans-serif;
    flex-wrap: wrap;
}
/* Kill WC clearfix pseudo-elements that become rogue flex children */
.ppn-fc-body .woocommerce-mini-cart li::before,
.ppn-fc-body .woocommerce-mini-cart li::after {
    display: none;
    content: none;
}
/* Force Inter on EVERY element inside each cart item + the entire panel */
.ppn-fc-panel,
.ppn-fc-panel *:not(svg):not(path),
.ppn-fc-body,
.ppn-fc-body *:not(svg):not(path),
.ppn-fc-body .woocommerce-mini-cart,
.ppn-fc-body .woocommerce-mini-cart li,
.ppn-fc-body .woocommerce-mini-cart li *:not(svg):not(path),
.ppn-fc-body .woocommerce-mini-cart li a,
.ppn-fc-body .woocommerce-mini-cart li span,
.ppn-fc-body .woocommerce-mini-cart li bdi,
.ppn-fc-body .woocommerce-mini-cart li small,
.ppn-fc-body .woocommerce-mini-cart li strong,
.ppn-fc-body .woocommerce-mini-cart li dl,
.ppn-fc-body .woocommerce-mini-cart li dt,
.ppn-fc-body .woocommerce-mini-cart li dd,
.ppn-fc-body .woocommerce-mini-cart li p,
.ppn-fc-body .woocommerce-mini-cart li .woocommerce-Price-amount,
.ppn-fc-body .woocommerce-mini-cart__total,
.ppn-fc-body .woocommerce-mini-cart__total *,
.ppn-fc-body .woocommerce-mini-cart__buttons a {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}
/* Product name link — normalize every text rendering property */
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove),
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove):link,
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove):visited,
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove):active {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13.6px;
    font-weight: 600;
    font-style: normal;
    font-variant: normal;
    font-stretch: normal;
    color: rgb(68, 68, 68);
    text-decoration: none;
    line-height: 1.4;
    letter-spacing: 0px;
    word-spacing: 0px;
    text-transform: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Clamp long names to 2 lines for consistent card height */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: calc(100% - 80px);
}
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove):hover {
    color: var(--ppn-maroon);
}
/* ALL images inside cart items — force consistent size */
.ppn-fc-body .woocommerce-mini-cart li img,
.ppn-fc-body .woocommerce-mini-cart li a img,
.ppn-fc-body .woocommerce-mini-cart li .attachment-woocommerce_thumbnail,
.ppn-fc-body .woocommerce-mini-cart li .wp-post-image {
    width: 56px;
    height: 56px;
    min-width: 56px;
    max-width: 56px;
    object-fit: cover;
    border-radius: var(--ppn-radius-ms);
    flex-shrink: 0;
    float: left;
    margin-right: 12px;
    margin-bottom: 0;
}
/* Remove button — positioned at top-right of item, clear of qty controls */
.ppn-fc-body .woocommerce-mini-cart li.woocommerce-mini-cart-item {
    position: relative;
    padding-right: 32px; /* Make room for the × button */
}
.ppn-fc-body .woocommerce-mini-cart li a.remove {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ppn-radius-circle);
    background: rgba(220, 38, 38, 0.06);
    color: var(--ppn-red);
    font-size: 1rem;
    font-weight: 400;
    text-decoration: none;
    transition: all 150ms var(--fc-ease);
    z-index: 2;
}
.ppn-fc-body .woocommerce-mini-cart li a.remove:hover {
    background: rgba(220, 38, 38, 0.12);
    color: var(--ppn-red);
    transform: translateY(-50%) scale(1.1);
}
/* Force Inter on ALL text inside cart items — including WC Deposits injected markup */
.ppn-fc-body .woocommerce-mini-cart li,
.ppn-fc-body .woocommerce-mini-cart li *,
.ppn-fc-body .woocommerce-mini-cart li span,
.ppn-fc-body .woocommerce-mini-cart li small,
.ppn-fc-body .woocommerce-mini-cart li dl,
.ppn-fc-body .woocommerce-mini-cart li dt,
.ppn-fc-body .woocommerce-mini-cart li dd,
.ppn-fc-body .woocommerce-mini-cart li p {
    font-family: 'Inter', -apple-system, sans-serif;
}
.ppn-fc-body .woocommerce-mini-cart li .quantity {
    font-size: 0.8rem;
    color: rgba(68, 68, 68, 0.6);
}
.ppn-fc-body .woocommerce-mini-cart li .quantity .amount {
    color: var(--ppn-maroon);
    font-weight: 600;
}
/* WC Deposits extra text in mini cart */
.ppn-fc-body .woocommerce-mini-cart li small {
    display: block;
    font-size: 0.72rem;
    color: rgba(68, 68, 68, 0.5);
    margin-top: 2px;
}
/* Variation/meta data injected by plugins */
.ppn-fc-body .woocommerce-mini-cart li dl.variation {
    font-size: 0.75rem;
    color: rgba(68, 68, 68, 0.5);
    margin: 4px 0 0;
    padding: 0;
}
.ppn-fc-body .woocommerce-mini-cart li dl.variation dt,
.ppn-fc-body .woocommerce-mini-cart li dl.variation dd {
    display: inline;
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
}

/* ═══ QUANTITY CONTROLS (injected by JS) ═══ */
.fc-qty-controls {
    display: inline-flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    border-radius: var(--ppn-radius-sm);
    overflow: hidden;
    margin-top: 6px;
}
.fc-qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: rgb(68, 68, 68);
    font-family: 'Inter', sans-serif;
    transition: all 120ms ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.fc-qty-btn:hover {
    background: rgba(150, 0, 0, 0.06);
    color: var(--ppn-maroon);
}
.fc-qty-btn:active {
    transform: scale(0.88);
}
.fc-qty-btn--minus {
    border-right: 1px solid rgba(0, 0, 0, 0.08);
}
.fc-qty-btn--plus {
    border-left: 1px solid rgba(0, 0, 0, 0.08);
}
.fc-qty-value {
    min-width: 28px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    color: rgb(68, 68, 68);
}

/* Keep the price amount visible next to controls */
.ppn-fc-body .woocommerce-mini-cart li .quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: rgba(68, 68, 68, 0.6);
    flex-wrap: wrap;
}

/* Subtotal */
.ppn-fc-body .woocommerce-mini-cart__total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    margin: 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgb(68, 68, 68);
    border-top: 2px solid rgb(68, 68, 68);
}
.ppn-fc-body .woocommerce-mini-cart__total .amount {
    font-family: 'Inter', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ppn-maroon);
}

/* Cart buttons */
.ppn-fc-body .woocommerce-mini-cart__buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 0;
    margin: 8px 0 0;
}
.ppn-fc-body .woocommerce-mini-cart__buttons a {
    display: block;
    width: 100%;
    padding: 14px 20px;
    border-radius: var(--ppn-radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: all 150ms var(--fc-ease);
    box-sizing: border-box;
}
/* View Cart — outlined */
.ppn-fc-body .woocommerce-mini-cart__buttons a:first-child {
    background: transparent;
    color: var(--ppn-maroon);
    border: 1.5px solid rgba(150, 0, 0, 0.2);
}
.ppn-fc-body .woocommerce-mini-cart__buttons a:first-child:hover {
    background: rgba(150, 0, 0, 0.04);
    border-color: var(--ppn-maroon);
}
/* Checkout — filled */
.ppn-fc-body .woocommerce-mini-cart__buttons a:last-child {
    background: var(--ppn-maroon);
    color: var(--ppn-white);
    border: none;
    box-shadow: 0 4px 15px rgba(150, 0, 0, 0.2);
}
.ppn-fc-body .woocommerce-mini-cart__buttons a:last-child:hover {
    background: var(--ppn-maroon-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(150, 0, 0, 0.3);
}

/* Empty cart */
.ppn-fc-empty {
    text-align: center;
    padding: 40px 0 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    color: rgba(68, 68, 68, 0.45);
}
.ppn-fc-shop-link {
    display: block;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ppn-maroon);
    text-decoration: none;
    padding: 10px 0;
    transition: color 150ms var(--fc-ease);
}
.ppn-fc-shop-link:hover {
    color: var(--ppn-maroon-hover);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .ppn-fc-btn {
        bottom: calc(80px + env(safe-area-inset-bottom, 0px));
        right: 20px;
        width: 48px;
        height: 48px;
    }
    .ppn-fc-btn svg { width: 20px; height: 20px; }

    /* Mobile: bottom sheet instead of centered modal */
    .ppn-fc-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--ppn-radius-xl) 20px 0 0;
        transform: translate(0, 100%) scale(1);
        opacity: 0;
    }
    .ppn-fc.is-open .ppn-fc-panel {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
}


/* ═══ WHATSAPP HELP CTA (below cart body, survives WC fragment refresh) ═══ */
.ppn-fc-help {
    display: none; /* Hidden by default — JS shows when cart has items */
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: #FFF9F0;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.35s var(--fc-ease), transform 0.35s var(--fc-ease);
}
.ppn-fc-help.is-visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

/* Typing indicator bubble */
.ppn-fc-help__typing {
    display: flex;
    align-items: center;
    gap: 3px;
    background: #E8F5E1;
    border-radius: 12px;
    padding: 8px 10px;
    flex-shrink: 0;
}
.ppn-fc-help__typing span {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #25D366;
    opacity: 0.5;
    animation: ppnTypingBounce 1.2s infinite ease-in-out;
}
.ppn-fc-help__typing span:nth-child(2) {
    animation-delay: 0.15s;
}
.ppn-fc-help__typing span:nth-child(3) {
    animation-delay: 0.3s;
}

/* Stop animation after first session view */
.ppn-fc-help__typing.is-seen span {
    animation: none;
    opacity: 0.7;
}

@keyframes ppnTypingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Text + link */
.ppn-fc-help__text {
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 0.78rem;
    color: rgba(68, 68, 68, 0.75);
    line-height: 1.45;
}
.ppn-fc-help__text a {
    display: block;
    margin-top: 2px;
    font-weight: 600;
    font-size: 0.8rem;
    color: #25D366;
    text-decoration: none;
    transition: color 0.15s ease;
}
.ppn-fc-help__text a:hover {
    color: #1DA851;
    text-decoration: underline;
}

/* ═══ Responsive: mobile bottom sheet ═══ */
@media (max-width: 768px) {
    .ppn-fc-help {
        padding: 12px 20px;
        gap: 10px;
    }
    .ppn-fc-help__typing {
        padding: 7px 9px;
    }
    .ppn-fc-help__typing span {
        width: 5px;
        height: 5px;
    }
    .ppn-fc-help__text {
        font-size: 0.74rem;
    }
    .ppn-fc-help__text a {
        font-size: 0.76rem;
    }
}
