/* ==========================================================================
   SORTEOWEB · Estilos de la vista MIS TICKETS (view/mis-tickets.php)
   Requiere assets/css/style.css (variables, botones, modal) y tickets.css
   (fondo .tk, tarjeta .tk-step, campos .field/.segmented), cárgalos antes.
   [1] Layout   [2] Botón buscar   [3] Mensajes de estado   [4] Tarjetas de ticket
   [4b] Resultados encontrados (encabezado, ticket, paginación)   [5] Responsive
   ========================================================================== */

/* [1] LAYOUT ============================================================== */
.mt-layout { display: grid; gap: 1.8rem; max-width: 980px; margin-inline: auto; }
.mt-form { width: 100%; max-width: 640px; margin-inline: auto; }
.mt-form .tk-step { max-width: none; }
/* Al saltar a los resultados, que el encabezado no quede debajo del header fijo */
.mt-results, #resTitulo { scroll-margin-top: calc(var(--header-h) + 1rem); }

/* [2] BOTÓN BUSCAR ========================================================= */
.mt-submit { display: flex; justify-content: flex-end; margin-top: 1.3rem; }
.mt-submit .btn { min-width: 220px; }

/* [3] MENSAJES DE ESTADO (vacío / sin resultados) ========================= */
.mt-msg { text-align: center; color: var(--muted); padding: 1.2rem; }
.mt-msg--none p:first-child { color: var(--text); font-weight: 600; margin-bottom: .4rem; }

/* [4] TARJETAS DE TICKET ==================================================== */
.mt-list { display: grid; gap: 1rem; animation: tk-up .5s cubic-bezier(.2, .8, .2, 1) both; }

.mt-card {
    padding: 1.3rem 1.4rem;
    background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 16px 50px rgba(0, 0, 0, .3);
}

.mt-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; }
.mt-card__sorteo { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
.mt-card__fecha { color: var(--muted); font-size: .85rem; margin-top: .3rem; }

.mt-badge {
    flex: none; padding: .25rem .7rem; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
    border-radius: 999px; white-space: nowrap;
}
.mt-badge--pendiente { color: #ffe08a; background: rgba(255, 200, 87, .15); border: 1px solid rgba(255, 200, 87, .5); }
.mt-badge--aprobado,
.mt-badge--pagado    { color: #8bf6bd; background: rgba(58, 222, 140, .15); border: 1px solid rgba(58, 222, 140, .5); }
.mt-badge--anulado   { color: #ffb4c0; background: rgba(255, 77, 109, .16); border: 1px solid rgba(255, 77, 109, .5); }

.mt-card__code {
    display: flex; align-items: center; justify-content: center;
    margin-top: 1rem; padding: .7rem 1rem;
    border: 1.5px dashed rgba(var(--blue-bright-rgb), .6);
    border-radius: 14px;
    background: rgba(var(--blue-bright-rgb), .1);
}
.mt-card__code span {
    font-family: var(--font-num); font-weight: 800; font-size: 1.1rem; letter-spacing: .07em;
    color: #fff; text-shadow: 0 0 14px rgba(var(--blue-bright-rgb), .7); user-select: all;
}

.mt-card__list { margin: 1rem 0 0; display: grid; gap: .5rem; }
.mt-card__list > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .88rem; }
.mt-card__list dt { color: var(--muted); }
.mt-card__list dd { margin: 0; font-weight: 600; text-align: right; }

/* [4b] RESULTADOS ENCONTRADOS: encabezado, tickets en cuadrícula y paginación === */
.mt-found { animation: tk-up .5s cubic-bezier(.2, .8, .2, 1) both; }
.mt-found[hidden] { display: none; }
.mt-found__head {
    padding: 1.2rem 1.4rem; margin-bottom: 1rem;
    background: linear-gradient(160deg, rgba(var(--blue-bright-rgb), .2), rgba(255, 255, 255, .03));
    border: 1px solid var(--border); border-radius: var(--radius);
}
.mt-found__head h2 { font-size: 1.3rem; outline: none; }
.mt-found__who { margin-top: .35rem; font-size: 1rem; }
.mt-found__who strong { color: var(--white); }
.mt-found__meta { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.mt-found__chips { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: .7rem; }

.mt-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); align-items: start; }

/* Tarjeta con forma de ticket: cuerpo + talón con el código, separados por una
   línea perforada con dos muescas laterales */
.mt-ticket {
    position: relative; display: grid;
    background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
    border: 1px solid var(--border); border-radius: 18px;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .28);
    transition: transform .2s ease, border-color .2s ease;
}
.mt-ticket:hover { transform: translateY(-3px); border-color: rgba(var(--sky-rgb), .5); }
.mt-ticket__main { padding: 1rem 1.1rem .9rem; }
.mt-ticket__top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.mt-ticket__label { font-size: .78rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--sky); }
.mt-ticket__data { margin: .7rem 0 0; display: grid; gap: .45rem; }
.mt-ticket__data > div { display: grid; gap: .05rem; }
.mt-ticket__data dt { color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.mt-ticket__data dd { margin: 0; font-weight: 700; font-size: .95rem; line-height: 1.3; overflow-wrap: anywhere; }

.mt-ticket__stub {
    position: relative; display: grid; justify-items: center; gap: .15rem;
    padding: .8rem 1rem; border-top: 2px dashed rgba(var(--sky-rgb), .35);
    background: rgba(var(--blue-bright-rgb), .1);
}
.mt-ticket__stub::before, .mt-ticket__stub::after {
    content: ""; position: absolute; top: -11px; width: 20px; height: 20px; border-radius: 50%;
    background: var(--bg); border: 1px solid var(--border);
}
.mt-ticket__stub::before { left: -11px; }
.mt-ticket__stub::after { right: -11px; }
.mt-ticket__stub-label { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.mt-ticket__code {
    font-family: var(--font-num); font-weight: 800; font-size: 1.12rem; letter-spacing: .07em;
    color: #fff; text-shadow: 0 0 14px rgba(var(--blue-bright-rgb), .7); user-select: all; overflow-wrap: anywhere; text-align: center;
}

.mt-ticket__more { padding: .15rem 1.1rem .8rem; background: rgba(var(--blue-bright-rgb), .1); border-radius: 0 0 18px 18px; }
.mt-ticket__more summary { cursor: pointer; font-size: .82rem; font-weight: 600; color: var(--sky); text-align: center; list-style: none; padding: .3rem 0; }
.mt-ticket__more summary::-webkit-details-marker { display: none; }
.mt-ticket__more summary::after { content: " ▾"; }
.mt-ticket__more[open] summary::after { content: " ▴"; }
.mt-ticket__more .mt-card__list { margin-top: .4rem; }
.mt-ticket__more .mt-card__list > div { font-size: .82rem; }

.mt-pager { display: flex; align-items: center; justify-content: center; gap: .8rem; flex-wrap: wrap; margin-top: 1.2rem; }
.mt-pager[hidden] { display: none; }
.mt-pager__info { color: var(--muted); font-size: .85rem; text-align: center; }
.mt-pager .btn:disabled { opacity: .4; cursor: not-allowed; animation: none; }

/* [4c] ESTADO DE LA COMPRA: motivo de anulación y nota de "en revisión" ===== */
.mt-motivo {
    margin-top: .8rem; padding: .7rem .85rem; border-radius: 12px;
    background: rgba(255, 77, 109, .1); border: 1px solid rgba(255, 77, 109, .45); color: #ffd3da; font-size: .86rem;
}
.mt-motivo strong { display: block; color: #ffb4c0; font-size: .78rem; letter-spacing: .04em; text-transform: uppercase; }
.mt-motivo p { margin: .25rem 0 0; overflow-wrap: anywhere; }
.mt-estado-nota { margin: .7rem 0 0; font-size: .8rem; color: #ffe08a; }

/* [4d] BUSCADOR DE TICKETS (filtra sin recargar) ============================ */
.mt-filtros { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: .6rem; margin: 0 0 1rem; }
.mt-filtros[hidden] { display: none; }
.mt-filtros__buscar { position: relative; display: block; }
.mt-filtros__buscar svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.mt-filtros__buscar .input { padding-left: 2.5rem; width: 100%; }
.mt-filtros select.input { min-width: 0; }
.mt-chip { cursor: pointer; font-family: inherit; transition: transform .15s, box-shadow .15s; }
.mt-chip:hover { transform: translateY(-1px); }
.mt-chip.is-active { box-shadow: 0 0 0 2px currentColor; }
.mt-msg--filtro { margin: 0 0 1rem; }
.mt-msg--filtro[hidden] { display: none; }
.mt-link { background: none; border: 0; padding: 0; color: var(--sky); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* [5] RESPONSIVE ============================================================ */
@media (max-width: 560px) {
    .mt-card__top { flex-direction: column; }
    .mt-submit .btn { width: 100%; min-width: 0; }
    .mt-list { grid-template-columns: 1fr; }
    .mt-found__head { padding: 1rem; }
    .mt-pager__info { order: -1; flex-basis: 100%; }
    .mt-filtros { grid-template-columns: 1fr 1fr; }
    .mt-filtros__buscar { grid-column: 1 / -1; }
}
