/* ============================================
   ONA Club · Mis compras (app v2, F4) — prefijo cmp-
   Bonos (caducidad muy visible), eventos, Armario y justificante imprimible.
   Incluye el distintivo «Acceso anticipado socias» de los eventos (F8b).
   ============================================ */

.cmp {
    --cmp-ok: #4f8a5b;      --cmp-ok-bg: #e7f0e8;
    --cmp-warn: #a8701a;    --cmp-warn-bg: #fbeed6;
    --cmp-danger: #b5473a;  --cmp-danger-bg: #f8e1dc;
    --cmp-brown: #7d6853;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ── Tarjeta base ── */
.cmp-card {
    background: rgba(255, 255, 255, .78);
    border: 1px solid rgba(255, 255, 255, .95);
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(94, 79, 63, .07), 0 1px 3px rgba(94, 79, 63, .05);
    padding: 16px;
    min-width: 0;
}
.cmp-skel { min-height: 210px; background: linear-gradient(100deg, rgba(255,255,255,.6) 30%, rgba(255,255,255,.95) 50%, rgba(255,255,255,.6) 70%); background-size: 300% 100%; animation: cmpShine 1.4s linear infinite; }
.cmp-skel--sm { min-height: 110px; }
@keyframes cmpShine { to { background-position: -150% 0; } }

/* ── Cabecera ── */
.cmp-head { display: flex; align-items: flex-start; gap: 12px; margin-top: 4px; }
.cmp-back {
    flex: 0 0 auto; width: 40px; height: 40px; margin-top: 4px; border-radius: 50%; border: 1px solid rgba(255,255,255,.95);
    background: rgba(255,255,255,.85); color: var(--text-heading); display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(94,79,63,.08); cursor: pointer;
}
.cmp-head__txt { min-width: 0; }
.cmp-eyebrow { font-size: 11px; letter-spacing: .3em; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.cmp-title { margin: 2px 0 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(30px, 8.6vw, 40px); line-height: 1.05; color: var(--text-heading); }
.cmp-title em { font-style: italic; font-weight: 500; color: var(--cmp-brown); }
.cmp-sub { margin: 4px 0 0; font-size: 14px; color: var(--text-secondary); }

/* ── Pestañas (píldora segmentada) ── */
.cmp-tabs {
    display: flex; gap: 4px; padding: 4px; border-radius: 999px;
    background: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.95);
    box-shadow: 0 6px 18px rgba(94,79,63,.06);
}
.cmp-tab {
    position: relative; flex: 1 1 0; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 6px; border: 0; border-radius: 999px; background: transparent; cursor: pointer; white-space: nowrap;
    font: 600 14px var(--font-family); color: var(--text-secondary); transition: background .2s ease, color .2s ease;
}
.cmp-tab.is-active { color: #fff; background: linear-gradient(160deg, #a38d76, #7b6754); box-shadow: 0 6px 14px rgba(94,79,63,.22); }
.cmp-tab__n { font-size: 11px; font-weight: 700; min-width: 20px; padding: 1px 6px; border-radius: 999px; background: rgba(94,79,63,.08); }
.cmp-tab.is-active .cmp-tab__n { background: rgba(255,255,255,.22); }
.cmp-tab__dot { position: absolute; top: 7px; right: 10px; width: 7px; height: 7px; border-radius: 50%; background: var(--cmp-warn); box-shadow: 0 0 0 2px #fff; }

.cmp-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.cmp-body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ── Rótulo de sección ── */
.cmp-sec { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 4px 0; }
.cmp-sec__title { margin: 0; font-size: 12px; letter-spacing: .3em; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.cmp-sec__more {
    display: inline-flex; align-items: center; gap: 2px; padding: 4px 0; border: 0; background: none; cursor: pointer;
    font: 500 13.5px var(--font-family); color: var(--text-heading); white-space: nowrap;
}

/* ── Botones píldora ── */
.cmp-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 10px 18px;
    border-radius: 999px; border: 1px solid transparent; cursor: pointer; font: 600 14px var(--font-family); white-space: nowrap;
    transition: transform .15s ease, box-shadow .2s ease;
}
.cmp-btn:active { transform: scale(.97); }
.cmp-btn--primary { color: #fff; background: linear-gradient(160deg, #a38d76, #7b6754); box-shadow: 0 8px 18px rgba(94,79,63,.22); }
.cmp-btn--ghost { color: var(--text-heading); background: #fff; border-color: rgba(94,79,63,.14); }
.cmp-btn--sm { min-height: 36px; padding: 7px 13px; font-size: 13px; }
.cmp-btn:focus-visible, .cmp-tab:focus-visible, .cmp-back:focus-visible, .cmp-sec__more:focus-visible, .cmp-doc__close:focus-visible {
    outline: 3px solid var(--color-primary, #baa68e); outline-offset: 2px;
}
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cmp-actions:empty { display: none; }

/* ── Distintivos de estado ── */
.cmp-badge {
    flex: 0 0 auto; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; white-space: nowrap;
    font-size: 11px; font-weight: 700; letter-spacing: .06em;
}
.cmp-badge--ok { color: var(--cmp-ok); background: var(--cmp-ok-bg); }
.cmp-badge--warn { color: var(--cmp-warn); background: var(--cmp-warn-bg); }
.cmp-badge--danger { color: var(--cmp-danger); background: var(--cmp-danger-bg); }
.cmp-badge--info { color: var(--color-primary-darker, #5e4f3f); background: #efe6da; }
.cmp-badge--neutral { color: var(--text-secondary); background: #f1ebe3; }
.cmp-badge--muted { color: var(--text-muted); background: #f3efea; }

/* ── Bonos ── */
.cmp-bono__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cmp-bono__id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cmp-bono__ico {
    flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    color: #fff; background: linear-gradient(160deg, #a38d76, #7b6754); box-shadow: 0 6px 14px rgba(94,79,63,.2);
}
.cmp-bono__ico--warn { color: var(--cmp-warn); background: var(--cmp-warn-bg); box-shadow: none; }
.cmp-kicker { font-size: 10.5px; letter-spacing: .22em; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.cmp-bono__name { margin: 2px 0 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; color: var(--text-heading); overflow-wrap: anywhere; }
.cmp-bono--hero { padding: 18px 18px 16px; }
.cmp-bono--hero .cmp-bono__name { font-size: 26px; }

/* Caducidad: el dato más visible de la tarjeta */
.cmp-exp { display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 12px 14px; border-radius: 18px; background: #f7f1ea; color: var(--text-heading); }
.cmp-exp__ico { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #fff; color: var(--cmp-brown); }
.cmp-exp__txt { display: flex; flex-direction: column; min-width: 0; }
.cmp-exp__txt b { font-family: var(--font-display); font-size: 21px; font-weight: 500; line-height: 1.15; }
.cmp-exp__txt span { font-size: 13.5px; color: var(--text-secondary); font-weight: 600; }
.cmp-bono--hero .cmp-exp__txt b { font-size: 24px; }
.cmp-exp--warn { background: var(--cmp-warn-bg); }
.cmp-exp--warn .cmp-exp__ico, .cmp-exp--warn .cmp-exp__txt span { color: var(--cmp-warn); }
.cmp-exp--danger { background: var(--cmp-danger-bg); }
.cmp-exp--danger .cmp-exp__ico, .cmp-exp--danger .cmp-exp__txt span, .cmp-exp--danger .cmp-exp__txt b { color: var(--cmp-danger); }

.cmp-ses { margin-top: 14px; }
.cmp-ses__num { font-size: 14px; color: var(--text-secondary); }
.cmp-ses__num--txt { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text-heading); }
.cmp-ses__num--txt svg { color: #8a7762; }
.cmp-ses__num b { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--text-heading); margin-right: 2px; }
.cmp-bar { height: 8px; margin-top: 8px; border-radius: 999px; background: #efe7dc; overflow: hidden; }
.cmp-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b9a48c, #8a7762); }
.cmp-ses__foot { margin-top: 6px; font-size: 12.5px; color: var(--text-muted); }

.cmp-note { display: flex; align-items: center; gap: 6px; margin: 12px 0 0; font-size: 13px; color: var(--text-secondary); }
.cmp-note svg { flex: 0 0 auto; color: var(--cmp-brown); }

/* Pendientes de pago */
.cmp-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cmp-price b { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--text-heading); }
.cmp-price s { color: var(--text-muted); font-size: 14px; }
.cmp-price__code { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--cmp-ok); }
.cmp-meta { margin-top: 4px; font-size: 13px; color: var(--text-secondary); overflow-wrap: anywhere; }
.cmp-meta--strong { margin-top: 12px; font-weight: 600; color: var(--text-heading); }
.cmp-howto { margin-top: 12px; padding: 12px 14px; border-radius: 18px; background: #f7f1ea; border: 1px dashed rgba(138,119,98,.35); }
.cmp-howto__title { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .2em; font-weight: 700; color: var(--cmp-brown); text-transform: uppercase; }
.cmp-howto p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--text-heading); }
.cmp-howto .cmp-btn { margin-top: 10px; }

/* Listas compactas (historial, eventos anteriores) */
.cmp-list { padding: 4px 16px; }
.cmp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; flex-wrap: wrap; }
.cmp-row + .cmp-row { border-top: 1px solid rgba(94,79,63,.08); }
.cmp-row__main { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmp-row__title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.cmp-row__title b { font-size: 15px; color: var(--text-heading); overflow-wrap: anywhere; }
.cmp-row__main > span, .cmp-ped__body > span { font-size: 12.5px; color: var(--text-secondary); overflow-wrap: anywhere; }
.cmp-row__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Eventos ── */
.cmp-ev__top { display: flex; gap: 12px; min-width: 0; }
.cmp-ev__img {
    position: relative; flex: 0 0 96px; height: 104px; border-radius: 18px; background: linear-gradient(135deg, #cdbba5, #8a7762) center/cover no-repeat;
}
.cmp-ev__date {
    position: absolute; left: 8px; top: 8px; display: flex; flex-direction: column; align-items: center; min-width: 40px; padding: 4px 6px;
    border-radius: 12px; background: rgba(255,255,255,.92); font-size: 10.5px; letter-spacing: .08em; font-weight: 600; color: var(--text-secondary); text-transform: uppercase;
}
.cmp-ev__date b { font-family: var(--font-display); font-size: 19px; line-height: 1; color: var(--text-heading); }
.cmp-ev__body { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cmp-ev__body > span:not(.cmp-badge) { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-secondary); min-width: 0; overflow-wrap: anywhere; }
.cmp-ev__body > span svg { flex: 0 0 auto; color: #8a7762; }
.cmp-ev__title { margin: 0; font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.15; color: var(--text-heading); overflow-wrap: anywhere; }

/* ── Armario ── */
.cmp-ped.is-off { opacity: .72; }
.cmp-ped__top { display: flex; gap: 12px; min-width: 0; }
.cmp-ped__img {
    flex: 0 0 72px; height: 72px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
    color: #8a7762; background: #efe6da center/cover no-repeat;
}
.cmp-ped__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }

/* ── Vacío ── */
.cmp-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 26px 20px; }
.cmp-empty__ico { width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f3ebe1; color: var(--cmp-brown); margin-bottom: 4px; }
.cmp-empty b { font-family: var(--font-display); font-weight: 500; font-size: 20px; color: var(--text-heading); }
.cmp-empty p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-secondary); max-width: 320px; }

/* ── Justificante a pantalla completa ── */
.cmp-doc {
    position: fixed; inset: 0; z-index: 450; display: flex; flex-direction: column;
    background: rgba(247, 241, 234, .98); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    animation: cmpDocIn .25s ease;
}
@keyframes cmpDocIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.cmp-doc__bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 10px;
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px;
}
.cmp-doc__close {
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,.95); background: #fff; color: var(--text-heading);
    display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 12px rgba(94,79,63,.1);
}
.cmp-doc__title { font-size: 12px; letter-spacing: .3em; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
.cmp-doc__scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 24px); }
.cmp-doc__paper { max-width: 720px; margin: 0 auto; }
html.cmp-doc-open, html.cmp-doc-open body { overflow: hidden; }

@media print {
    html.cmp-doc-open, html.cmp-doc-open body { overflow: visible !important; height: auto !important; background: #fff !important; padding: 0 !important; margin: 0 !important; }
    html.cmp-doc-open body > *:not(.cmp-doc) { display: none !important; }
    html.cmp-doc-open .cmp-doc { position: static; display: block; background: #fff; backdrop-filter: none; -webkit-backdrop-filter: none; animation: none; }
    html.cmp-doc-open .cmp-doc__bar { display: none; }
    html.cmp-doc-open .cmp-doc__scroll { overflow: visible; padding: 0; }
}

/* ── Eventos: distintivo «Acceso anticipado socias» (F8b, assets/js/events.js) ── */
.cmp-early {
    display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; white-space: nowrap;
    font-size: 11px; font-weight: 700; letter-spacing: .06em; color: #fff;
    background: linear-gradient(160deg, #a38d76, #7b6754); box-shadow: 0 4px 10px rgba(94,79,63,.25);
}
.ona-event-card__img .cmp-early { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); }
.cmp-early-note {
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 var(--space-md, 16px);
    padding: 12px 14px; border-radius: 18px; background: #f7f1ea; font-size: 13.5px; color: var(--text-heading);
}

@media (max-width: 350px) {
    .cmp-tab { font-size: 13px; padding: 9px 4px; }
    .cmp-tab__n { display: none; }
}
@media (max-width: 380px) {
    .cmp-ev__img { flex-basis: 80px; height: 92px; }
    .cmp-bono--hero .cmp-bono__name { font-size: 23px; }
    .cmp-bono__top { flex-wrap: wrap; }
}
