/* =========================================
   JYNN Cart — "Your Selections" editorial redesign
   Namespaced .jynn-reserve* so it never collides with the
   older .jynn-cart-layout rules in woocommerce-pages-v3.css.
   Loaded only on is_cart(), after that shared stylesheet.
   Tokens: --bg-void #030407 · --accent-glow #D4AF37 ·
   --text-bright #F5E6DA · --text-dim #A88160 · Fraunces + Satoshi.
   ========================================= */

body.woocommerce-cart {
    --font-display: var(--font-body); /* cart + sidebar: Satoshi only */
}

.jynn-reserve {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 360px);
    gap: clamp(2rem, 4vw, 4.5rem);
    align-items: start;
    margin: 0 auto;
    max-width: 1180px;
}

.jynn-reserve__main,
.jynn-reserve__sidebar {
    min-width: 0;
}

/* ---------- Left column: selections ---------- */
.jynn-reserve__head {
    margin-bottom: 2.5rem;
}

.jynn-reserve__eyebrow {
    display: block;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 0.9rem;
}

.jynn-reserve__title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: var(--text-bright);
}

.jynn-reserve__title em {
    font-style: italic;
    color: var(--accent-glow);
}

.jynn-reserve__list {
    border-top: 1px solid var(--border-light);
}

/* ---------- Item row ---------- */
.jynn-reserve__item {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr) 2rem;
    gap: 1.75rem;
    align-items: center;
    padding: 1.85rem 0;
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.jynn-reserve__media {
    position: relative;
    width: 96px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.02);
}

.jynn-reserve__media a,
.jynn-reserve__media img {
    display: block;
    width: 100%;
    height: 100%;
}

.jynn-reserve__media img {
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.jynn-reserve__item:hover .jynn-reserve__media img {
    transform: scale(1.06);
}

.jynn-reserve__info {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
}

.jynn-reserve__name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--text-bright);
}

.jynn-reserve__name a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.jynn-reserve__name a:hover {
    color: var(--accent-glow);
}

.jynn-reserve__meta {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.5;
}

.jynn-reserve__meta p {
    margin: 0;
}

.jynn-reserve__controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* ---------- Quantity stepper ---------- */
.jynn-reserve__qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    overflow: hidden;
}

.jynn-reserve__qty .jynn-qty-btn {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast);
}

.jynn-reserve__qty .jynn-qty-btn:hover {
    color: var(--accent-glow);
    background: rgba(212, 175, 55, 0.06);
}

.jynn-reserve__qty .qty {
    width: 40px;
    height: 34px;
    padding: 0;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--border-light);
    border-right: 1px solid var(--border-light);
    color: var(--text-bright);
    font-family: var(--font-body);
    font-size: 0.9rem;
    -moz-appearance: textfield;
    appearance: textfield;
}

.jynn-reserve__qty .qty::-webkit-outer-spin-button,
.jynn-reserve__qty .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.jynn-reserve__qty .qty:focus-visible {
    outline: 1px solid var(--accent-glow);
    outline-offset: -1px;
}

.jynn-reserve__line-total {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-bright);
    white-space: nowrap;
}

/* ---------- Remove ---------- */
.jynn-reserve__remove {
    display: flex;
    justify-content: flex-end;
    align-self: start;
    padding-top: 0.35rem;
}

.jynn-reserve__remove .remove {
    display: inline-flex;
    color: var(--text-dim);
    line-height: 0;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.jynn-reserve__remove .remove:hover {
    color: var(--accent-glow);
    transform: rotate(90deg);
}

/* ---------- Actions (coupon + update) ---------- */
.jynn-reserve__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.jynn-reserve__coupon {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
}

.jynn-reserve__coupon .input-text {
    background: transparent;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    color: var(--text-bright);
    font-family: var(--font-body);
    font-size: 0.85rem;
    padding: 0 0.9rem;
    height: 44px;
    width: 170px;
}

.jynn-reserve__coupon .input-text::placeholder {
    color: var(--text-dim);
}

.jynn-reserve__coupon .input-text:focus-visible {
    outline: none;
    border-color: var(--accent-glow);
}

/* ---------- Buttons ---------- */
.jynn-reserve .jynn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 1.5rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.jynn-reserve .jynn-btn--ghost {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-dim);
}

.jynn-reserve .jynn-btn--ghost:hover {
    border-color: var(--accent-glow);
    color: var(--accent-glow);
}

.jynn-reserve .jynn-btn--primary {
    background: var(--accent-glow);
    border: 1px solid var(--accent-glow);
    color: var(--bg-void);
}

.jynn-reserve .jynn-btn--primary:hover {
    background: #fff;
    border-color: #fff;
    color: var(--bg-void);
}

/* ---------- Signature: the certificate summary ---------- */
.jynn-reserve__sidebar {
    position: sticky;
    top: 110px;
}

.jynn-reserve__summary {
    position: relative;
    padding: 2rem 1.85rem 2.25rem;
    border: 1px solid var(--border-light);
    background:
        radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.05), rgba(3, 4, 7, 0) 60%),
        rgba(255, 255, 255, 0.015);
    width: 100%;
}

/* Engraved inner frame */
.jynn-reserve__summary::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(212, 175, 55, 0.1);
    pointer-events: none;
}

.jynn-reserve__summary > * {
    position: relative;
    z-index: 1;
}

.jynn-reserve__summary-label {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--accent-glow);
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

/* Hide WC's own "Cart totals" heading (kept for screen readers). */
.jynn-reserve__summary .cart_totals > h2 {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* =========================================================================
   Totals summary — HIGH-SPECIFICITY override.
   Must outrank ".woocommerce table.shop_table th/td { … !important }" in
   woocommerce-pages-v3.css (specificity 0,2,2, all !important). Every
   selector below therefore includes `table.shop_table` to reach 0,3,x and
   win. Without this, that rule forced 1.8rem td padding + extra borders and
   broke every earlier attempt.
   Layout: each <tr> becomes a flex row — label (left) / value (right).
   ========================================================================= */

.jynn-reserve__summary .cart_totals table.shop_table,
.jynn-reserve__summary .cart_totals table.shop_table tbody {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

.jynn-reserve__summary .cart_totals table.shop_table tr {
    display: flex !important;
    justify-content: space-between !important;
    align-items: baseline !important;
    gap: 1rem !important;
    padding: 0.85rem 0 !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.12) !important;
}

/* Grand total: no divider, and top-align the label with the big number. */
.jynn-reserve__summary .cart_totals table.shop_table tr.order-total {
    border-bottom: none !important;
    align-items: flex-start !important;
    padding-top: 1.2rem !important;
}

/* Label column (Subtotal / Shipment / Total). */
.jynn-reserve__summary .cart_totals table.shop_table th {
    flex: 0 0 auto !important;
    width: auto !important;
    font-family: var(--font-body) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.15em !important;
    text-transform: uppercase !important;
    color: var(--text-dim) !important;
    text-align: left !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    white-space: nowrap !important;
    line-height: 1.5 !important;
}

/* Value column. */
.jynn-reserve__summary .cart_totals table.shop_table td {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    text-align: right !important;
    color: var(--text-bright) !important;
    font-size: 0.95rem !important;
    line-height: 1.5 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
}

/* ---- Shipment cell: method / destination / change-address stacked ---- */
.jynn-reserve__summary .cart_totals table.shop_table td ul#shipping_method {
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td ul#shipping_method li {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 0.95rem !important;
    color: var(--text-bright) !important;
    line-height: 1.5 !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .woocommerce-shipping-destination {
    margin: 0.35rem 0 0 !important;
    padding: 0 !important;
    font-size: 0.78rem !important;
    line-height: 1.5 !important;
    color: var(--text-dim) !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .woocommerce-shipping-destination strong {
    color: var(--text-bright) !important;
    font-weight: 500 !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .woocommerce-shipping-calculator {
    margin: 0.5rem 0 0 !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .shipping-calculator-button {
    display: inline-block !important;
    font-family: var(--font-body) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    letter-spacing: 0.08em !important;
    text-transform: uppercase !important;
    color: var(--accent-glow) !important;
    text-decoration: underline !important;
    text-underline-offset: 3px !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .shipping-calculator-button::after {
    content: none !important;
}

.jynn-reserve__summary .cart_totals table.shop_table td .shipping-calculator-form {
    text-align: left !important;
    margin-top: 0.75rem !important;
}

/* ---- Grand total value: big number, then tax caption beneath ---- */
.jynn-reserve__summary .cart_totals table.shop_table tr.order-total td > strong {
    display: block !important;
    font-family: var(--font-display) !important;
    font-style: italic !important;
    font-size: 1.9rem !important;
    font-weight: 400 !important;
    line-height: 1.15 !important;
    color: var(--accent-glow) !important;
}

.jynn-reserve__summary .cart_totals table.shop_table tr.order-total .includes_tax {
    display: block !important;
    margin-top: 0.5rem !important;
    font-family: var(--font-body) !important;
    font-style: normal !important;
    font-size: 0.7rem !important;
    font-weight: 500 !important;
    line-height: 1.6 !important;
    color: var(--text-dim) !important;
}

.jynn-reserve__summary .cart_totals table.shop_table tr.order-total .includes_tax .amount {
    font-family: var(--font-body) !important;
    font-style: normal !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    color: var(--text-bright) !important;
}

/* ---------- Empty cart ---------- */
.jynn-reserve--empty {
    display: block;
    max-width: 640px;
}

.jynn-reserve__empty {
    text-align: center;
    padding: clamp(2rem, 8vh, 5rem) 1rem;
}

.jynn-reserve__empty-title {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -0.02em;
    color: var(--text-bright);
    margin: 0.9rem 0 1rem;
}

.jynn-reserve__empty-text {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-dim);
    max-width: 44ch;
    margin: 0 auto 2rem;
}

.jynn-reserve__empty .jynn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    padding: 0 2rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    background: var(--accent-glow);
    color: var(--bg-void);
    transition: background var(--transition-fast);
}

.jynn-reserve__empty .jynn-btn:hover {
    background: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .jynn-reserve {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        max-width: 640px;
    }

    .jynn-reserve__sidebar {
        position: static;
    }
}

@media (max-width: 600px) {
    .jynn-reserve__head {
        margin-bottom: 1.75rem;
    }

    .jynn-reserve__item {
        grid-template-columns: 76px 1fr;
        column-gap: 1.1rem;
        row-gap: 0;
        align-items: start;
        padding: 1.5rem 0;
    }

    .jynn-reserve__media {
        width: 76px;
    }

    .jynn-reserve__qty .jynn-qty-btn {
        width: 44px;
        height: 44px;
    }

    .jynn-reserve__qty .qty {
        height: 44px;
    }

    /* Pin the remove control to the row's top-right; reserve room for it. */
    .jynn-reserve__remove {
        position: absolute;
        top: 1.5rem;
        right: 0;
        padding-top: 0;
    }

    .jynn-reserve__remove .remove {
        min-width: 44px;
        min-height: 44px;
        align-items: center;
        justify-content: center;
    }

    .jynn-reserve__info {
        padding-right: 1.75rem;
    }

    .jynn-reserve__name {
        font-size: 1.15rem;
    }

    .jynn-reserve__controls {
        margin-top: 0.9rem;
    }

    /* Stack coupon + update actions full-width so nothing overflows. */
    .jynn-reserve__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .jynn-reserve__coupon {
        width: 100%;
    }

    .jynn-reserve__coupon .input-text {
        flex: 1 1 auto;
        width: auto;
    }

    .jynn-reserve__update {
        width: 100%;
    }

    .jynn-reserve__summary {
        padding: 1.75rem 1.35rem 2rem;
    }
}

/* ---------- Motion (respects reduced-motion) ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* Entrance reveal. The hidden start state lives in the keyframe `from`
       (not the base rule) so that if CSS animations are ever unavailable,
       content — including the critical totals/checkout in the sidebar —
       defaults to visible rather than being stuck at opacity:0. */
    .jynn-reserve__item {
        animation: jynn-reserve-rise 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
    }

    .jynn-reserve__item:nth-child(1) { animation-delay: 0.05s; }
    .jynn-reserve__item:nth-child(2) { animation-delay: 0.12s; }
    .jynn-reserve__item:nth-child(3) { animation-delay: 0.19s; }
    .jynn-reserve__item:nth-child(4) { animation-delay: 0.26s; }
    .jynn-reserve__item:nth-child(n+5) { animation-delay: 0.32s; }

    .jynn-reserve__sidebar {
        animation: jynn-reserve-fade 0.7s ease 0.2s both;
    }

    @keyframes jynn-reserve-rise {
        from { opacity: 0; transform: translateY(16px); }
        to { opacity: 1; transform: translateY(0); }
    }

    @keyframes jynn-reserve-fade {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}



/* ---------- Page heading (cart) ----------
   Keep the display serif for the page title (consistency with the rest of
   the site's page headings) even though the cart body is otherwise Satoshi,
   and center it. */
.jynn-woocommerce-page .content-hero h1 {
    font-family: 'Fraunces', serif;
    text-align: center;
}

/* ---------- AJAX updating state ---------- */
.jynn-reserve.is-updating {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

/* ---------- Confirm dialog (last-item removal) ---------- */
.jynn-confirm {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(3, 4, 7, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.jynn-confirm.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0s;
}

.jynn-confirm__box {
    max-width: 420px;
    width: 100%;
    background: #0a0b10;
    border: 1px solid var(--border-light);
    border-radius: 2px;
    padding: 2.25rem;
    text-align: center;
    transform: translateY(12px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.jynn-confirm.is-open .jynn-confirm__box {
    transform: translateY(0);
}

.jynn-confirm__title {
    font-family: var(--font-body);
    font-size: 1.15rem;
    color: var(--text-bright);
    margin: 0 0 0.6rem;
}

.jynn-confirm__text {
    font-size: 0.9rem;
    color: var(--text-dim);
    line-height: 1.6;
    margin: 0 0 1.75rem;
}

.jynn-confirm__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.jynn-confirm .jynn-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 1.5rem;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.jynn-confirm .jynn-btn--ghost {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-dim);
}

.jynn-confirm .jynn-btn--ghost:hover {
    border-color: var(--accent-glow);
    color: var(--accent-glow);
}

.jynn-confirm .jynn-btn--primary {
    background: var(--accent-glow);
    border: 1px solid var(--accent-glow);
    color: var(--bg-void);
}

.jynn-confirm .jynn-btn--primary:hover {
    background: #fff;
}

/* ---------- Fix: grand-total tax breakdown ("(includes … tax)") ----------
   WooCommerce prints the per-tax amounts (e.g. "₹237.36 IGST, ₹237.36 CGST")
   inside <small class="includes_tax"> WITHIN the .order-total cell, using the
   same .woocommerce-Price-amount markup as the grand total. The
   ".order-total .amount" hero rule above therefore also enlarged those tax
   amounts to 2rem italic gold, so they overlapped the tiny "(includes … )"
   labels and each other. Reset that breakdown to a small, tidy caption that
   sits neatly under the total. */
.jynn-reserve__summary .order-total th {
    vertical-align: top !important;
}

.jynn-reserve__summary .order-total .includes_tax {
    display: block;
    margin-top: 0.7rem;
    font-family: var(--font-body);
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.6;
    letter-spacing: 0.02em;
    text-transform: none;
    color: var(--text-dim);
}

.jynn-reserve__summary .order-total .includes_tax .amount {
    font-family: var(--font-body) !important;
    font-style: normal !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    line-height: 1.6 !important;
    color: var(--text-bright) !important;
}

/* ---------- Fix: shipping row + subtotal/total alignment in the summary ----
   The shipping cell packs the method label, "Shipping to…" line, and
   "Change address" link with no spacing/hierarchy, and its th/td (like
   subtotal's) were vertically misaligned against each other. Tidy all three
   rows consistently. */
.jynn-reserve__summary .cart_totals th,
.jynn-reserve__summary .cart_totals td {
    vertical-align: top !important;
}

.jynn-reserve__summary .woocommerce-shipping-totals ul#shipping_method {
    margin: 0 !important;
}

.jynn-reserve__summary .woocommerce-shipping-totals ul#shipping_method li {
    display: flex !important;
    justify-content: flex-end;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--text-bright);
}

.jynn-reserve__summary .woocommerce-shipping-destination {
    display: block;
    margin: 0.5rem 0 0 !important;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-dim);
    text-align: right;
}

.jynn-reserve__summary .woocommerce-shipping-destination strong {
    color: var(--text-bright);
    font-weight: 500;
}

.jynn-reserve__summary .shipping-calculator-button {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-glow);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Proceed to checkout: full-width button ----------
   v3 paints it gold but never sets width/display, and the earlier
   full-width rule was lost in edits. Specificity 0,3,1 + !important so it
   holds regardless of WooCommerce's inline-block default. */
.jynn-reserve__summary .wc-proceed-to-checkout {
    margin-top: 1.75rem !important;
    padding: 0 !important;
}

.jynn-reserve__summary .wc-proceed-to-checkout a.checkout-button {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
    padding: 1.05rem 1.5rem !important;
    margin: 0 !important;
    font-family: var(--font-body) !important;
    font-size: 0.75rem !important;
    letter-spacing: 0.22em !important;
    text-transform: uppercase !important;
    border-radius: 2px !important;
}
