/* ═══════════════════════════════════════════════════════════
   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: 52px;
    height: 52px;
    border-radius: 50%;
    border: none;
    background: #960000;
    color: #fff;
    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: 100px;
    background: #E8731A;
    color: #fff;
    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;
    transition: opacity 280ms var(--fc-ease), visibility 0s 280ms;
    cursor: pointer;
}
.ppn-fc.is-open .ppn-fc-backdrop {
    opacity: 1;
    visibility: visible;
    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, #fffdfb 0%, #fdf5ee 100%);
    border-radius: 20px;
    opacity: 0;
    visibility: hidden;
    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;
    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: 50%;
    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;
}

/* ═══ WOOCOMMERCE MINI CART STYLES ═══ */
.ppn-fc-body .woocommerce-mini-cart {
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
}
.ppn-fc-body .woocommerce-mini-cart li.woocommerce-mini-cart-item {
    position: relative;
    display: flex !important;
    align-items: center !important;
    gap: 14px !important;
    padding: 16px 0 !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    font-family: 'Inter', -apple-system, sans-serif !important;
}
/* 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 !important;
    content: none !important;
}
/* 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 !important;
}
/* 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 !important;
    font-size: 13.6px !important;
    font-weight: 600 !important;
    font-style: normal !important;
    font-variant: normal !important;
    font-stretch: normal !important;
    color: rgb(68, 68, 68) !important;
    text-decoration: none !important;
    line-height: 1.4 !important;
    letter-spacing: 0px !important;
    word-spacing: 0px !important;
    text-transform: none !important;
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
    /* Clamp long names to 2 lines for consistent card height */
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    max-width: calc(100% - 80px) !important;
}
.ppn-fc-body .woocommerce-mini-cart li a:not(.remove):hover {
    color: #960000 !important;
}
/* 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 !important;
    height: 56px !important;
    min-width: 56px !important;
    max-width: 56px !important;
    object-fit: cover !important;
    border-radius: 10px !important;
    flex-shrink: 0 !important;
    float: left !important;
    margin-right: 12px !important;
    margin-bottom: 0 !important;
}
.ppn-fc-body .woocommerce-mini-cart li a.remove {
    position: absolute;
    top: 16px;
    right: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(68, 68, 68, 0.06);
    color: rgb(68, 68, 68) !important;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    transition: all 150ms var(--fc-ease);
}
.ppn-fc-body .woocommerce-mini-cart li a.remove:hover {
    background: rgba(220, 38, 38, 0.08);
    color: #DC2626 !important;
}
/* 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 !important;
}
.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: #960000;
    font-weight: 600;
}
/* WC Deposits extra text in mini cart */
.ppn-fc-body .woocommerce-mini-cart li small {
    display: block;
    font-size: 0.72rem !important;
    color: rgba(68, 68, 68, 0.5) !important;
    margin-top: 2px;
}
/* Variation/meta data injected by plugins */
.ppn-fc-body .woocommerce-mini-cart li dl.variation {
    font-size: 0.75rem !important;
    color: rgba(68, 68, 68, 0.5) !important;
    margin: 4px 0 0 !important;
    padding: 0 !important;
}
.ppn-fc-body .woocommerce-mini-cart li dl.variation dt,
.ppn-fc-body .woocommerce-mini-cart li dl.variation dd {
    display: inline !important;
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.72rem !important;
}

/* 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: #960000;
}

/* 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: 12px;
    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: #960000;
    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: #960000;
}
/* Checkout — filled */
.ppn-fc-body .woocommerce-mini-cart__buttons a:last-child {
    background: #960000;
    color: #fff;
    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: #B80000;
    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: #960000 !important;
    text-decoration: none;
    padding: 10px 0;
    transition: color 150ms var(--fc-ease);
}
.ppn-fc-shop-link:hover {
    color: #B80000 !important;
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
    .ppn-fc-btn {
        bottom: calc(72px + env(safe-area-inset-bottom, 0px));
        right: 14px;
        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: 20px 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;
    }
}

/* ═══ HIDE SHOPENGINE FLY CART ═══ */
.shopengine-sticky-fly-cart { display: none !important; }
