/* styles/sorteos.css */

/* Reset de desbordamiento (sin afectar el bloque de título del módulo) */
.section-sorteos .sorteos-grid,
.section-sorteos .sorteos-grid *,
.section-sorteos .ganadores-random-wrapper,
.section-sorteos .ganadores-random-wrapper *,
.sorteo-detail-container,
.sorteo-detail-container *,
.success-container,
.success-container *,
.participation-card,
.sorteo-panel-card * {
    box-sizing: border-box;
    max-width: 100%;
}

/* =========================================
   1. LAYOUT GENERAL — panel blanco full-bleed hasta el footer (como empleos)
   ========================================= */
body.page-sorteos {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body.page-sorteos > header.site-header,
body.page-sorteos > .dir-breadcrumb {
    flex-shrink: 0;
}

body.page-sorteos > footer {
    flex-shrink: 0;
    margin-top: 0;
}

body.site-public main.sorteos-page,
body.site-public main.section-sorteos {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: none;
    margin: 0;
    margin-bottom: 0;
    padding: 0;
    background: #fff !important;
    background-color: #fff !important;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sorteos-page {
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sorteos-page__panel,
.sorteos-panel {
    flex: 1 1 auto;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    background: #fff;
    border: none;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}

.sorteos-page__inner {
    width: 100%;
    max-width: var(--container-max, 1320px);
    margin: 0 auto;
    padding: clamp(18px, 3vw, 28px) clamp(16px, 3vw, 32px) 40px;
    box-sizing: border-box;
}

.sorteos-page__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border-light, #eee);
}

.sorteos-page__intro {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    min-width: 0;
    flex: 1 1 auto;
}

.sorteos-page__title {
    margin: 0;
    font-family: var(--font-heading, inherit);
    font-size: clamp(1.25rem, 2.5vw, 1.65rem);
    color: var(--color-text-heading, #1a1a1a);
    white-space: nowrap;
}

.sorteos-page__subtitle {
    margin: 0;
    color: var(--color-text-medium, #666);
    font-size: 0.9rem;
    line-height: 1.35;
}

.sorteos-page__subtitle::before {
    content: '—';
    margin-right: 12px;
    color: var(--color-border-light, #ddd);
}

.sorteos-page .sorteos-grid {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.sorteos-page .ganadores-random-wrapper {
    max-width: 100%;
    width: 100%;
    margin: 0 0 24px;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    box-sizing: border-box;
}

.sorteos-page .sorteos-tabs {
    margin-top: 0;
}

.sorteos-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin: 0 0 24px;
    padding: 0 0 2px;
    border-bottom: 2px solid #e8e8e8;
}

.sorteos-tab {
    background: none;
    border: none;
    padding: 12px 4px;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    position: relative;
    line-height: 1.3;
}

.sorteos-tab:hover {
    color: #334155;
}

.sorteos-tab.active {
    color: var(--color-primary, #2563eb);
}

.sorteos-tab.active::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    background: var(--color-primary, #2563eb);
}

.sorteos-tab:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

.sorteos-page .sorteos-grid {
    margin: 0;
}

.sorteo-date-badge--finished {
    background: #64748b;
}

.sorteo-card--finished {
    border-color: #e2e8f0;
}

.sorteo-card--finished:hover {
    border-color: #94a3b8;
}

.sorteos-page #carruselGanadoresRandom {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sorteos-page .ganador-mini-item {
    width: 100px !important;
    height: 120px;
    margin: 0 8px;
    outline: none;
    flex-shrink: 0;
}

.sorteos-page .ganador-mini-item img {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--color-primary);
    display: block;
}

.sorteos-page .titulo-ganadores-top {
    font-size: 0.85rem;
    font-weight: bold;
    color: #777;
    text-transform: none;
    margin-bottom: 15px;
    text-align: center;
    display: inline-flex;
}

.sorteos-page #carruselGanadoresRandom .slick-track {
    display: flex !important;
    align-items: center;
}

.sorteos-page .sorteos-loading {
    text-align: center;
    width: 100%;
    margin-top: 30px;
    color: var(--color-text-medium);
}

.section-sorteos .section-header {
    text-align: left;
    margin-bottom: 24px;
}

/* =========================================
   2. LISTADO DE SORTEOS (GRID & CARDS)
   ========================================= */
.sorteos-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    width: 100%;
    margin: 0 auto;
}

.sorteo-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb; 
    display: flex;
    flex-direction: column;
    text-decoration: none; 
    color: inherit;
    cursor: pointer;
    width: 100%;
    margin: 0;
}

.sorteos-grid > .sorteo-card:only-child {
    grid-column: 1 / -1;
    justify-self: center;
    width: calc((100% - 30px) / 2);
    max-width: calc((100% - 30px) / 2);
}

.sorteo-card:hover {
    transform: translateY(-5px);
    border-color: var(--color-primary);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
}

.sorteo-img-wrap {
    position: relative;
    height: 200px;
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
}

.sorteo-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.sorteo-card:hover .sorteo-img-wrap img {
    transform: scale(1.05);
}

.sorteo-date-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--color-header-btn-uno, var(--color-primary));
    color: var(--color-header-btn-uno-text, #fff);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.3;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sorteo-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1; 
    justify-content: space-between;
    align-items: center; 
}

.sorteo-body h3 {
    margin-bottom: 15px;
    font-size: 1.25rem;
    color: #1f2937;
    line-height: 1.3;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.sorteo-body .btn {
    text-decoration: none;
    display: block;
    width: auto;
    min-width: 140px;
    max-width: 90%;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    padding: 10px 25px;
    border-radius: 30px;
    background-color: var(--color-header-btn-uno);
    color: var( --color-header-btn-uno-text);
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.sorteo-card:hover .btn {
    opacity: 0.9;
    transform: scale(1.02);
}

/* =========================================
   3. MINI CONTADOR (LISTADO)
   ========================================= */
.mini-countdown {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    background: #f8fafc;
    padding: 12px 10px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    width: 100%;
    flex-wrap: wrap; /* Para que no se rompa en pantallas muy pequeñas */
}

.mini-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 30px;
}

.mini-box span {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--color-primary);
    line-height: 1;
}

.mini-box small {
    font-size: 0.6rem;
    text-transform: uppercase;
    color: #64748b;
    margin-top: 3px;
    font-weight: 600;
}

.mini-separator {
    font-weight: bold;
    color: #cbd5e1;
    margin-top: -12px;
}

.mini-finished {
    color: #ef4444;
    font-weight: 700;
    text-align: center;
    width: 100%;
    padding: 10px;
    margin-bottom: 20px;
    background: #fef2f2;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

.sorteo-card--finished .sorteo-body .btn {
    margin-top: 0;
}

/* =========================================
   4. DETALLE DEL SORTEO (CORREGIDO PARA CENTRADO)
   ========================================= */
main.main--sorteo-detalle {
    padding-top: 14px;
}

.sorteo-detail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    padding: 20px 16px 48px;
    max-width: var(--container-max, 1320px);
    margin: 0 auto;
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
}

main.main--sorteo-detalle .sorteo-detail-container {
    padding-top: 20px;
}

/* Columnas flexibles pero controladas */
.sorteo-info-col {
    flex: 1 1 320px;
    max-width: calc(50% - 20px);
    width: 100%;
    min-width: 0;
}

.sorteo-form-col {
    flex: 1 1 320px;
    max-width: calc(50% - 20px);
    width: 100%;
    min-width: 0;
}

.sorteo-banner-img { 
    width: 100%; 
    height: auto;
    border-radius: 12px; 
    margin-bottom: 25px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
    display: block; 
}

.sorteo-title-box {
    margin-bottom: 25px;
    padding: 18px 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 55%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

.sorteo-title {
    font-size: 1.75rem;
    margin: 0;
    color: #1a1a1a;
    font-weight: 800;
    line-height: 1.25;
    text-align: center;
}

@media (min-width: 900px) {
    .sorteo-title { text-align: center; } 
}

.sorteo-desc-box {
    margin-bottom: 28px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #f8fafc 0%, #fff 55%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.sorteo-desc-title {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sorteo-desc-title i {
    color: var(--color-primary, #2563eb);
}

.sorteo-desc-content {
    margin: 0;
    line-height: 1.7;
    color: #4b5563;
    font-size: 1.05rem;
    text-align: left;
}

/* CONTADOR GRANDE */
.countdown-wrapper {
    background-color: var(--color-primary); 
    color: #fff;
    padding: 25px 20px;
    border-radius: 16px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    width: 100%;
}
.countdown-wrapper::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 60%); pointer-events: none;
}
.end-date-label { margin-bottom: 20px; font-size: 1.1rem; color: rgba(255, 255, 255, 0.95); font-weight: 500; position: relative; z-index: 1; }
.end-date-label strong { color: #fff; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,0.1); }
.end-date-label i { color: #fff; margin-right: 8px; }

.countdown-grid { display: flex; justify-content: center; gap: 15px; position: relative; z-index: 1; flex-wrap: wrap; }
.time-box { background-color: #fff; color: var(--color-primary); width: 70px; height: 75px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.time-box span { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.time-box small { font-size: 0.65rem; text-transform: uppercase; margin-top: 5px; color: #555; font-weight: 700; letter-spacing: 0.5px; }

.finished-badge { background: #fff; color: #ef4444; padding: 15px; border-radius: 12px; font-weight: 800; font-size: 1.5rem; text-transform: uppercase; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }

.sorteo-finish-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 12px 20px;
    border-radius: 12px;
    background: var(--color-header-btn-uno, var(--color-primary));
    color: var(--color-header-btn-uno-text, #fff);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}

.sorteo-finish-date i {
    font-size: 1.05rem;
}

/* PREMIOS DEL SORTEO (DETALLE PÚBLICO) */
.sorteo-premios-box {
    margin-bottom: 28px;
    padding: 20px 22px;
    background: linear-gradient(135deg, #fffbeb 0%, #fff 55%);
    border: 1px solid #fde68a;
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.08);
}

.sorteo-premios-title {
    margin: 0 0 16px;
    font-size: 1.2rem;
    font-weight: 700;
    color: #92400e;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sorteo-premios-title i {
    color: #d97706;
}

.sorteo-premios-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

@media (min-width: 600px) {
    .sorteo-premios-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

.sorteo-premio-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #fde68a;
    border-radius: 10px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.sorteo-premio-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.sorteo-premio-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-primary, #2563eb);
    color: #fff;
    font-weight: 800;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sorteo-premio-nombre {
    font-weight: 600;
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.sorteo-confirmacion-box {
    margin-top: 20px;
    margin-bottom: 0;
    padding: 16px 20px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}

.sorteo-confirmacion-text {
    margin: 0;
    color: #9a3412;
    font-size: 0.95rem;
    line-height: 1.5;
    text-align: center;
}

.sorteo-confirmacion-text a {
    color: #c2410c;
    font-weight: 600;
    text-decoration: underline;
}

.sorteo-confirmacion-text a:hover {
    color: #9a3412;
}

/* TÍTULO MODALIDADES (solo encabezado, las tarjetas quedan fuera) */
.sorteo-modalidades-title-box {
    margin: 30px 0 20px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #fff 55%);
    border: 1px solid #bfdbfe;
    border-radius: 16px;
    width: 100%;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.08);
}

.sorteo-modalidades-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e40af;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sorteo-modalidades-title i {
    color: #2563eb;
}

/* TARJETAS DE INFORMACIÓN (MODALIDADES) — mismo diseño azul que "Comprando tickets" */
.sorteo-meta-cards { display: flex; flex-direction: column; gap: 20px; margin-bottom: 30px; width: 100%; }
@media (min-width: 768px) { .sorteo-meta-cards { flex-direction: row; } }

.sorteo-meta-cards .meta-card,
.meta-card.compra {
    flex: 1;
    background-color: #eff6ff;
    border: 2px solid #bfdbfe;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    width: 100%;
}

.sorteo-meta-cards .meta-card:hover,
.meta-card.compra:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.12);
}

.sorteo-meta-cards .meta-icon-circle,
.compra .meta-icon-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px auto;
    font-size: 1.4rem;
    background: #fff;
    color: #1e40af;
}

.meta-title { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; margin-bottom: 5px; color: #333; }
.meta-desc { font-size: 0.85rem; color: #666; margin-bottom: 10px; line-height: 1.4; min-height: 2.5em; }
.meta-price { font-size: 1.6rem; font-weight: 800; color: var(--color-primary); }
.meta-price small { display: block; font-size: 0.85rem; font-weight: 600; color: #555; margin-bottom: 2px; }

/* =========================================
   5. FORMULARIO DE PARTICIPACIÓN
   ========================================= */
.participation-card { 
    background: #fff; 
    padding: 30px; 
    border-radius: 16px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); 
    border: 1px solid #e5e7eb; 
    width: 100%;
}

/* Pestañas de modalidad de participación */
.participation-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
    width: 100%;
    align-items: stretch;
}

.participation-card .tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 8px;
    background: #fcfcfc;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    cursor: pointer;
    transition: border-color 0.25s ease, background 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
    color: #6b7280;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    text-align: center;
    height: 100%;
    width: 100%;
    min-height: 90px;
}

.participation-card .tab-btn i {
    font-size: 1.8rem;
    margin: 0;
    color: inherit;
}

.participation-card .tab-btn span {
    display: block;
    max-width: 100%;
}

.participation-card .tab-btn:hover:not(.active) {
    border-color: #cbd5e1;
    background: #f3f4f6;
    color: #475569;
}

.participation-card .tab-btn.active {
    border: 2px solid var(--color-primary, #10b981);
    background: #fff;
    color: var(--color-primary, #10b981);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

.participation-card .tab-btn.active::after {
    content: none;
    display: none;
}

.participation-card .tab-btn:focus-visible {
    outline: 2px solid var(--color-primary, #10b981);
    outline-offset: 2px;
}

/* Inputs */
.form-group { margin-bottom: 20px; width: 100%; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 600; color: #374151; font-size: 0.9rem; }
.form-group input { width: 100%; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 1rem; transition: border 0.2s; box-sizing: border-box; }
.form-group input:focus { border-color: var(--color-primary); outline: none; }

/* Inputs Pequeños y Centrados */
#input-cantidad-compra { max-width: 120px; text-align: center; font-size: 1.2rem; font-weight: 700; display: block; margin-left: auto; margin-right: auto; }
#input-monto-boleta { max-width: 120px; text-align: center; font-size: 1.2rem; font-weight: 700; display: block; margin-left: auto; margin-right: auto; }

.total-display { text-align: center; font-size: 1.3rem; font-weight: bold; color: var(--color-primary); margin-bottom: 15px; background: #f9fafb; padding: 12px; border-radius: 8px; border: 1px dashed #d1d5db; }

.qr-placeholder { text-align: center; border: 1px solid #eee; padding: 15px; margin-bottom: 20px; border-radius: 12px; background: #fff; }
.qr-placeholder img { max-width: 100%; width: 160px; border-radius: 8px; border: 1px solid #eee; }

.upload-group { 
    background: #f9fafb; 
    padding: 20px; 
    border-radius: 12px; 
    border: 2px dashed #d1d5db; 
    text-align: center; 
    margin-top: 20px; 
    width: 100%; 
    box-sizing: border-box; 
    overflow: hidden; 
}
.upload-group input[type="file"] { 
    max-width: 100%; 
    width: 100%;
    box-sizing: border-box; 
    font-size: 0.9rem; 
    background: #fff; 
    padding: 10px; 
    height: auto; 
}

/* =========================================
   6. CAJA LOGIN / REGISTRO
   ========================================= */
.login-required-box { text-align: center; padding: 50px 30px; background: #fff; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); border: 1px solid #f3f4f6; width: 100%; }

/* Contenedor Flex para botones */
.auth-buttons-group { 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 15px; 
    flex-wrap: wrap; 
    margin-top: 25px; 
    width: 100%;
}

.auth-buttons-group .btn { 
    text-decoration: none; 
    display: inline-block; 
    text-align: center; 
    padding: 12px 25px; 
    border-radius: 30px; 
    min-width: 140px; 
    font-weight: 600; 
    font-size: 1rem; 
    transition: all 0.3s ease; 
}

/* =========================================
   7. PÁGINA DE ÉXITO
   ========================================= */
.sorteo-exito-container {
    display: block;
    max-width: var(--container-max, 1320px);
    margin: 0 auto;
    padding: 20px 16px 48px;
    width: 100%;
    box-sizing: border-box;
}

@keyframes sorteo-exito-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.85; }
    100% { transform: scale(1); opacity: 1; }
}

.sorteo-exito-box {
    background: #fff;
    padding: 32px 28px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    margin-bottom: 24px;
    width: 100%;
    box-sizing: border-box;
}

.sorteo-exito-status {
    text-align: center;
}

.sorteo-exito-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.sorteo-exito-icon--pendiente {
    color: #f59e0b;
    animation: sorteo-exito-pulse 2s infinite;
}

.sorteo-exito-icon--aprobado { color: #10b981; }
.sorteo-exito-icon--rechazado { color: #ef4444; }

.sorteo-exito-title {
    margin: 0 0 12px;
    color: var(--color-text-dark, #1a1a1a);
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.25;
}

.sorteo-exito-text {
    margin: 0;
    font-size: 1.05rem;
    color: var(--color-text-medium, #4b5563);
    line-height: 1.6;
}

.sorteo-exito-luck {
    margin: 12px 0 0;
    color: #059669;
    font-weight: 600;
}

.sorteo-exito-info {
    margin-top: 24px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: left;
}

.sorteo-exito-info-title {
    margin: 0 0 12px;
    color: #334155;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sorteo-exito-info-list {
    margin: 0;
    padding-left: 20px;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
}

.sorteo-exito-box--confirmacion {
    text-align: center;
}

.sorteo-exito-confirm-title {
    margin: 0 0 12px;
    color: #1e293b;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.sorteo-exito-confirm-text {
    margin: 0;
    color: #475569;
    line-height: 1.55;
}

.sorteo-exito-confirm-btn {
    display: inline-block;
    margin-top: 16px;
    text-decoration: none;
    padding: 10px 24px;
    border-radius: 99px;
}

.sorteo-exito-actions {
    margin-top: 8px;
    text-align: center;
}

.sorteo-exito-action-btn {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 99px;
}

.sorteo-exito-actions .btn-outline-primary {
    background: #fff;
    color: var(--color-primary, #10b981);
    border: 2px solid var(--color-primary, #10b981);
}

.sorteo-exito-actions .btn-outline-primary:hover {
    background: #f8fafc;
    color: var(--color-primary, #10b981);
}

.success-container {
    max-width: var(--container-max, 1320px);
    margin: 40px auto;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}
.success-header { text-align: center; margin-bottom: 30px; }
.icon-circle { width: 80px; height: 80px; background: #dcfce7; color: #16a34a; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; margin: 0 auto 20px; }
.success-header h1 { color: var(--color-primary); margin-bottom: 10px; font-size: 1.8rem; }
.next-steps-box { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 12px; padding: 20px; color: #1e40af; margin-bottom: 30px; line-height: 1.6; text-align: justify; }
.next-steps-box h4 { margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

.tickets-display-area h3 { text-align: center; margin-bottom: 20px; color: #444; }
.tickets-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 15px; margin-bottom: 30px; }
.ticket-stub { background: #fff; border: 2px dashed var(--color-primary); border-radius: 8px; display: flex; position: relative; overflow: hidden; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.ticket-left { flex: 2; padding: 15px; background: #fff; display: flex; flex-direction: column; justify-content: center; }
.ticket-right { flex: 1; background: var(--color-primary); color: #fff; padding: 10px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; border-left: 2px dashed #fff; }
.ticket-label { font-size: 0.7rem; color: #888; letter-spacing: 1px; font-weight: bold; }
.ticket-number { font-size: 1.1rem; font-weight: 800; color: #333; font-family: monospace; }
.ticket-sec-label { font-size: 0.6rem; opacity: 0.8; }
.ticket-sec-code { font-weight: bold; font-family: monospace; font-size: 0.95rem; }
.ticket-status-badge { position: absolute; top: 5px; right: 5px; font-size: 0.6rem; background: #fff; color: #555; padding: 2px 6px; border-radius: 4px; opacity: 0.8; font-weight: bold; text-transform: uppercase; }
.success-actions { display: flex; justify-content: center; gap: 15px; flex-wrap: wrap; }
.btn-outline-primary { border: 2px solid var(--color-primary); color: var(--color-primary); padding: 10px 25px; border-radius: 30px; text-decoration: none; font-weight: 600; transition: 0.3s; }
.btn-outline-primary:hover { background: var(--color-primary); color: #fff; }

/* =========================================
   8. RESPONSIVE OPTIMIZADO (SOLUCIÓN DEFINITIVA)
   ========================================= */

@media (max-width: 900px) {
    /* Centrado de columnas en el detalle */
    .sorteo-detail-container {
        flex-direction: column;
        align-items: center; /* Centrar items */
        padding: 20px 10px;
    }

    main.main--sorteo-detalle .sorteo-detail-container {
        padding-top: 14px;
    }
    
    /* Columnas full width en móvil y centradas */
    .sorteo-info-col, 
    .sorteo-form-col {
        min-width: 0; /* Permite que se encoja */
        width: 100%;
        max-width: 600px;
        margin: 0 auto 30px auto;
    }
}

@media (max-width: 768px) {
    .sorteos-page {
        padding: 0;
    }

    .sorteos-page__panel,
    .sorteos-panel {
        padding: 0;
    }

    .sorteos-page__inner {
        padding: 16px 14px 22px;
    }

    .sorteos-tabs {
        gap: 4px 16px;
    }

    .sorteos-page .ganador-mini-item {
        margin: 0 5px;
    }

    /* Grid de sorteos: 1 columna en móvil */
    .sorteos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .sorteos-grid > .sorteo-card:only-child {
        width: 100%;
        max-width: 100%;
    }

    .sorteo-card {
        width: 100%;
        margin: 0;
    }

    .sorteo-date-badge {
        font-size: 0.82rem;
        padding: 7px 12px;
    }

    .sorteo-finish-date {
        font-size: 0.92rem;
        padding: 10px 16px;
    }
    
    /* DETALLE DEL SORTEO */
    .sorteo-title-box { padding: 14px 16px; min-height: 60px; }
    .sorteo-title { font-size: 1.35rem; }

    .sorteo-exito-box {
        padding: 24px 18px;
    }

    .sorteo-exito-title {
        font-size: 1.45rem;
    }

    .sorteo-exito-icon {
        font-size: 3rem;
    }

    .sorteo-exito-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .sorteo-exito-action-btn {
        width: 100%;
        text-align: center;
    }
    
    /* Contador que quepa en pantalla */
    .countdown-grid { gap: 8px; }
    .time-box { width: 60px; height: 65px; }
    .time-box span { font-size: 1.4rem; }
    
    /* Tarjetas de modalidad una debajo de otra */
    .sorteo-meta-cards {
        flex-direction: column;
    }
    
    /* Inputs y botones que ocupen ancho completo pero con padding */
    .participation-card { 
        padding: 20px 15px; 
    }
    
    .participation-tabs {
        gap: 10px;
        grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    }

    .participation-card .tab-btn {
        padding: 12px 6px;
        font-size: 0.85rem;
        min-height: 80px;
    }

    .participation-card .tab-btn i {
        font-size: 1.5rem;
    }
    
    /* Botones de Auth apilados */
    .auth-buttons-group { 
        flex-direction: column; 
        gap: 12px; 
        width: 100%; 
    }
    
    .auth-buttons-group .btn { 
        width: 100%; 
        display: block; 
    }

    .login-required-box { 
        padding: 30px 20px; 
    }

    /* Éxito: Tickets en 1 columna */
    .tickets-grid { 
        grid-template-columns: 1fr; 
    }
    
    .success-actions {
        flex-direction: column;
    }
    
    .success-actions .btn {
        width: 100%;
        text-align: center;
    }
}

.ganadores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}
.ganador-card {
    background: #fff;
    padding: 10px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}
.ganador-card:hover {
    transform: translateY(-5px);
}
.foto-ganador {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: 10px;
    cursor: pointer;
}

/* Página pública ver ganadores */
.catalogo-section.section-ganadores {
    max-width: var(--container-max, 1320px);
    margin-left: auto;
    margin-right: auto;
    padding: 20px 16px 48px;
    box-sizing: border-box;
    width: 100%;
}

.ganadores-panel {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 28px 24px 32px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    width: 100%;
    box-sizing: border-box;
}

.ganadores-panel__head {
    text-align: center;
    margin-bottom: 28px;
}

.ganadores-panel__title {
    margin: 0 0 8px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.3;
}

.ganadores-panel__subtitle {
    margin: 0;
    color: #64748b;
    font-size: 1rem;
}

.ganadores-panel .ganadores-grid {
    margin: 0;
}

.ganadores-panel .ganador-card {
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.ganadores-panel__empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 16px;
    color: #64748b;
}

.ganadores-panel__empty i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 16px;
    display: block;
}

.ganadores-panel__actions {
    text-align: center;
    margin-top: 32px;
}

.ganadores-panel__back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #f1f5f9;
    color: #334155;
    text-decoration: none;
    border-radius: 999px;
    font-weight: 600;
    border: 1px solid #e2e8f0;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.ganadores-panel__back:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

@media (max-width: 768px) {
    .ganadores-panel {
        padding: 20px 16px 24px;
    }

    .ganadores-panel__title {
        font-size: 1.25rem;
    }

    .ganadores-grid {
        grid-template-columns: 1fr;
    }

    .foto-ganador {
        height: 280px;
    }
}

.sorteos-page__pagination {
    margin-top: 1.25rem;
}

.sorteos-page__pagination.admin-pagination-root {
    --pg-primary: var(--color-brand-gold, #B9984B);
    --pg-primary-soft: color-mix(in srgb, var(--color-brand-gold, #B9984B) 18%, transparent);
}