/* =========================================================================
 * shop.css — Tienda Reino Chile (tienda, producto, carrito, checkout, gracias)
 * Usa los tokens de base.css (--bg, --surface, --gold, --border, etc.).
 * ========================================================================= */

.shop-wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-md); }

/* ---- Encabezado de sección ---- */
.shop-head { text-align: center; padding: var(--space-2xl) 0 var(--space-lg); }
.shop-head__eyebrow {
    font-size: .72rem; letter-spacing: .32em; text-transform: uppercase;
    color: var(--gold); margin-bottom: 1rem;
}
.shop-head__title {
    font-family: var(--font-script); font-weight: 500; font-style: italic;
    font-size: clamp(1.85rem, 4vw, 2.7rem); line-height: 1.08; color: var(--text);
    margin: 0 0 1rem;
}
.shop-head__subtitle { color: var(--muted); max-width: 60ch; margin: 0 auto; line-height: 1.6; }

/* ---- Grilla de productos ---- */
.product-grid {
    display: grid; gap: var(--space-md);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    padding-bottom: var(--space-2xl);
}
.product-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 14px; transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--gold-deep); box-shadow: 0 18px 40px rgba(0,0,0,.35); }
.product-card__media {
    position: relative; aspect-ratio: 4 / 3; background: var(--bg-2) center/cover no-repeat;
    display: flex; align-items: center; justify-content: center;
}
.product-card__media--ph::after {
    content: attr(data-letter);
    font-family: var(--font-script); font-size: 3.5rem; color: var(--gold-deep); opacity: .6;
}
.product-card__badge {
    position: absolute; top: .75rem; left: .75rem;
    background: rgba(26,24,22,.85); color: var(--gold); border: 1px solid var(--gold-deep);
    font-size: .64rem; letter-spacing: .14em; text-transform: uppercase;
    padding: .35rem .6rem; border-radius: 100px; backdrop-filter: blur(4px);
}
.product-card__body { padding: 1.25rem 1.25rem 1.4rem; display: flex; flex-direction: column; flex: 1; }
.product-card__name { font-size: 1.15rem; font-weight: 600; color: var(--text); margin: 0 0 .3rem; }
.product-card__tagline { font-size: .85rem; color: var(--muted); margin: 0 0 1rem; line-height: 1.5; flex: 1; }
.product-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: auto; }
.product-card__price { font-size: 1.35rem; font-weight: 700; color: var(--gold); }
.product-card__soldout { font-size: .8rem; color: var(--danger); font-weight: 600; }

.price-cur { font-size: .7em; color: var(--muted); font-weight: 500; margin-right: .15em; }

/* ===== Detalle de producto (v2 — "pro") ===== */
.pd { padding-top: 1.5rem; }
.pd__back { display: inline-block; margin: 1.5rem 0 .5rem; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }
.pd__back:hover { color: var(--gold-bright); }
.pd__grid { display: grid; grid-template-columns: 0.95fr 1.05fr; gap: var(--space-xl); padding: 1rem 0 var(--space-2xl); align-items: start; }
.pd__media { position: sticky; top: 100px; }

/* Foto (si hay imagen) */
.pd__photo { position: relative; aspect-ratio: 3 / 4; border-radius: 18px; overflow: hidden; background: var(--bg-2) center/cover no-repeat; border: 1px solid var(--border); }
.pd__badge { position: absolute; top: 1rem; left: 1rem; background: rgba(26,24,22,.85); color: var(--gold); border: 1px solid var(--gold-deep); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; padding: .4rem .75rem; border-radius: 100px; }

/* Ticket visual (cuando no hay imagen) */
.ticket {
    position: relative; border-radius: 18px; overflow: hidden;
    background: linear-gradient(160deg, #26221c 0%, #1c1915 55%, #221d15 100%);
    border: 1px solid var(--gold-deep);
    box-shadow: 0 24px 60px rgba(0,0,0,.45), inset 0 1px 0 rgba(240,208,96,.12);
}
.ticket::before { /* halo dorado superior */
    content: ""; position: absolute; inset: -40% 30% auto; height: 60%;
    background: radial-gradient(closest-side, rgba(224,185,74,.22), transparent 70%);
    pointer-events: none;
}
.ticket__top { position: relative; padding: 2.4rem 2rem 2rem; text-align: center; }
.ticket__crown { display: inline-flex; color: var(--gold); }
.ticket__crown svg { width: 40px; height: 40px; }
.ticket__badge { display: inline-block; margin-top: .85rem; padding: .35rem .8rem; border: 1px solid var(--gold-deep); border-radius: 100px; color: var(--gold); font-size: .6rem; letter-spacing: .14em; text-transform: uppercase; }
.ticket__eyebrow { margin-top: 1.1rem; font-size: .68rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted); }
.ticket__title { font-family: var(--font-script); font-style: italic; font-weight: 500; font-size: 1.55rem; line-height: 1.12; color: var(--text); margin: .5rem 0 .4rem; }
.ticket__brand { font-size: .9rem; letter-spacing: .34em; text-transform: uppercase; color: var(--gold-bright); }
.ticket__lines { margin-top: 1.4rem; display: flex; flex-direction: column; gap: .35rem; }
.ticket__line { font-size: .8rem; color: var(--text-soft); }
.ticket__perf { position: relative; height: 0; border-top: 2px dashed var(--gold-deep); opacity: .6; margin: 0 1.25rem; }
.ticket__perf::before, .ticket__perf::after { content: ""; position: absolute; top: -13px; width: 26px; height: 26px; border-radius: 50%; background: var(--bg); border: 1px solid var(--gold-deep); }
.ticket__perf::before { left: -1.9rem; } .ticket__perf::after { right: -1.9rem; }
.ticket__stub { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.4rem 2rem 1.8rem; }
.ticket__stub-info { display: flex; flex-direction: column; text-align: left; }
.ticket__stub-k { font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.ticket__stub-v { font-family: var(--font-script); font-style: italic; font-size: 1.3rem; color: var(--text); }
.ticket__barcode { flex: 1; max-width: 140px; height: 44px; background-image: repeating-linear-gradient(90deg, var(--text-soft) 0 2px, transparent 2px 4px, var(--text-soft) 4px 5px, transparent 5px 9px, var(--text-soft) 9px 12px, transparent 12px 14px); opacity: .55; border-radius: 2px; }

/* Info + compra */
.pd__eyebrow { font-size: .72rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); margin-bottom: .8rem; }
.pd__title { font-family: var(--font-script); font-style: italic; font-weight: 500; font-size: clamp(1.5rem, 3.3vw, 2.4rem); line-height: 1.1; margin: 0 0 1rem; color: var(--text); }
.pd__lead { color: var(--text-soft); font-size: 1.08rem; line-height: 1.7; margin: 0 0 1.75rem; }

.pd__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1.75rem; }
.pd-chip { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .8rem .9rem; }
.pd-chip__ic { display: inline-flex; color: var(--gold); }
.pd-chip__ic svg { width: 22px; height: 22px; }
.pd-chip__k { display: block; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.pd-chip__v { display: block; font-size: .9rem; font-weight: 600; color: var(--text); }
.pd-chip--urgent { border-color: var(--gold-deep); }
.pd-chip--urgent .pd-chip__v { color: var(--gold-bright); }

.pd-includes { border-top: 1px solid var(--border); padding-top: 1.5rem; margin-bottom: 1.75rem; }
.pd-includes__title { font-size: .78rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.pd-includes ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .7rem; }
.pd-includes li { display: flex; align-items: flex-start; gap: .7rem; color: var(--text-soft); line-height: 1.5; }
.pd-includes li svg { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 1px; fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

.buybox { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.6rem; box-shadow: 0 14px 40px rgba(0,0,0,.25); }
.buybox__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.buybox__price { font-size: 2.3rem; font-weight: 700; color: var(--gold); line-height: 1; }
.buybox__cur { font-size: .9rem; color: var(--muted); font-weight: 500; }
.buybox__flag { display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gold-bright); }
.buybox__flag svg { width: 15px; height: 15px; }
.buybox__form { margin: 0; }
.buybox__row { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.buybox__cta { flex: 1; min-width: 180px; }
.buybox__urgent { margin: .9rem 0 0; font-size: .82rem; color: var(--gold-bright); }
.buybox__out { margin: 0; color: var(--danger); font-weight: 600; }
.buybox__trust { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; margin-top: 1.3rem; padding-top: 1.1rem; border-top: 1px solid var(--border); }
.buybox__trust span { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; color: var(--muted); }
.buybox__trust svg { width: 15px; height: 15px; color: var(--success); }

.support-note { display: flex; gap: .8rem; margin-top: 1.5rem; padding: 1rem 1.15rem; border-radius: 12px; background: rgba(224,185,74,.08); border: 1px solid var(--gold-deep); color: var(--text-soft); font-size: .9rem; line-height: 1.55; }
.support-note__ic { display: inline-flex; flex: 0 0 auto; color: var(--gold); margin-top: 1px; }
.support-note__ic svg { width: 20px; height: 20px; }
.support-note strong { color: var(--text); }

.pd__body { margin-top: 1.75rem; padding-top: 1.5rem; border-top: 1px solid var(--border); color: var(--text-soft); line-height: 1.8; }

.checkout-support { border-top: 1px solid var(--border); padding-top: 1.1rem; margin-top: 1.1rem; }

/* ---- Selector de cantidad ---- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 100px; overflow: hidden; background: var(--bg-2); }
.qty__btn { width: 40px; height: 42px; border: 0; background: transparent; color: var(--text); font-size: 1.25rem; cursor: pointer; line-height: 1; transition: background .15s ease; }
.qty__btn:hover { background: var(--surface-2); color: var(--gold); }
.qty__input { width: 46px; height: 42px; border: 0; background: transparent; color: var(--text); text-align: center; font-size: 1rem; font-weight: 600; -moz-appearance: textfield; }
.qty__input::-webkit-outer-spin-button, .qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.buy-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: 1.5rem; }

/* ---- Carrito ---- */
.cart-layout { display: grid; grid-template-columns: 1.6fr .9fr; gap: var(--space-xl); padding: var(--space-lg) 0 var(--space-2xl); align-items: start; }
.cart-list { display: flex; flex-direction: column; gap: 1rem; }
.cart-item {
    display: grid; grid-template-columns: 84px 1fr auto; gap: 1.1rem; align-items: center;
    background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 1rem;
}
.cart-item__media { width: 84px; height: 84px; border-radius: 8px; background: var(--bg-2) center/cover no-repeat; display: flex; align-items: center; justify-content: center; }
.cart-item__media--ph::after { content: attr(data-letter); font-family: var(--font-script); font-size: 2rem; color: var(--gold-deep); opacity: .6; }
.cart-item__name { font-weight: 600; color: var(--text); margin: 0 0 .2rem; }
.cart-item__unit { font-size: .82rem; color: var(--muted); }
.cart-item__right { display: flex; flex-direction: column; align-items: flex-end; gap: .6rem; }
.cart-item__subtotal { font-weight: 700; color: var(--gold); white-space: nowrap; }
.cart-item__remove { background: none; border: 0; color: var(--muted); font-size: .78rem; cursor: pointer; text-decoration: underline; }
.cart-item__remove:hover { color: var(--danger); }
.cart-item__actions { display: flex; align-items: center; gap: .75rem; }

.cart-empty { text-align: center; padding: var(--space-2xl) 0; }
.cart-empty__icon { display: flex; justify-content: center; color: var(--muted-2); margin-bottom: 1rem; }
.cart-empty__icon svg { width: 56px; height: 56px; }

/* ---- Resumen / totales (sticky) ---- */
.summary { position: sticky; top: 100px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.6rem; }
.summary__title { font-size: 1rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text); margin: 0 0 1.2rem; }
.summary__row { display: flex; justify-content: space-between; padding: .5rem 0; color: var(--text-soft); font-size: .92rem; }
.summary__row--total { border-top: 1px solid var(--border); margin-top: .6rem; padding-top: 1rem; font-size: 1.2rem; font-weight: 700; color: var(--text); }
.summary__row--total .summary__amount { color: var(--gold); }
.summary__btn { width: 100%; margin-top: 1.3rem; }
.summary__note { font-size: .75rem; color: var(--muted); text-align: center; margin-top: .9rem; line-height: 1.5; }

/* ---- Checkout ---- */
.checkout-layout { display: grid; grid-template-columns: 1.3fr .9fr; gap: var(--space-xl); padding: var(--space-lg) 0 var(--space-2xl); align-items: start; }
.checkout-items { display: flex; flex-direction: column; gap: .6rem; margin-bottom: 1.2rem; }
.checkout-line { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-soft); }
.checkout-line__q { color: var(--muted); }
.pay-badge { display: inline-flex; align-items: center; gap: .5rem; font-size: .78rem; color: var(--muted); margin-top: 1rem; }
.pay-badge svg { width: 16px; height: 16px; color: var(--success); }

/* ---- Página de gracias ---- */
.thanks { max-width: 640px; margin: 0 auto; padding: var(--space-2xl) var(--space-md); text-align: center; }
.thanks__icon { width: 84px; height: 84px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; margin-bottom: 1.5rem; }
.thanks__icon svg { width: 42px; height: 42px; stroke-width: 2.2; }
.thanks__title { font-family: var(--font-script); font-style: italic; font-weight: 500; font-size: clamp(1.7rem, 5vw, 2.2rem); margin: 0 0 .6rem; color: var(--text); }
.thanks__msg { color: var(--text-soft); line-height: 1.7; margin: 0 0 2rem; }
.thanks__card { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 1.6rem; margin-bottom: 2rem; }
.thanks__card h3 { font-size: .8rem; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.thanks__row { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .92rem; color: var(--text-soft); }
.thanks__row--total { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .8rem; font-weight: 700; color: var(--text); }

/* ---- Estados de pedido ---- */
.ostatus { display: inline-block; padding: .25rem .7rem; border-radius: 100px; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.ostatus--paid { background: rgba(95,165,106,.15); color: var(--success); border: 1px solid var(--success); }
.ostatus--pending { background: rgba(224,185,74,.12); color: var(--gold-bright); border: 1px solid var(--gold-deep); }
.ostatus--rejected, .ostatus--canceled { background: rgba(201,58,58,.12); color: var(--danger); border: 1px solid var(--danger); }

/* ---- Header: icono carrito ---- */
.cart-link { position: relative; }
.cart-link__count {
    position: absolute; top: -6px; right: -8px; min-width: 17px; height: 17px; padding: 0 4px;
    background: var(--gold); color: var(--invert-text); border-radius: 100px;
    font-size: .64rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .pd__grid, .cart-layout, .checkout-layout { grid-template-columns: 1fr; }
    .summary { position: static; }
    .pd__media { position: static; max-width: 460px; margin: 0 auto; }
}
@media (max-width: 520px) {
    .cart-item { grid-template-columns: 64px 1fr; }
    .cart-item__media { width: 64px; height: 64px; }
    .cart-item__right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; }
    /* Títulos más contenidos en móvil */
    .shop-head__title { font-size: 1.7rem; }
    .pd__title { font-size: 1.5rem; }
    .ticket__title { font-size: 1.4rem; }
    .thanks__title { font-size: 1.65rem; }
    .shop-head { padding: var(--space-xl) 0 var(--space-md); }
}
