/* styles/sorteos.css */

/* =========================================
   0. RESET ESPECÍFICO (CRÍTICO PARA EVITAR DESBORDAMIENTO)
   ========================================= */
.section-sorteos,
.section-sorteos *,
.sorteo-detail-container,
.sorteo-detail-container *,
.success-container,
.success-container *,
.participation-card,
.sorteo-panel-card * {
    box-sizing: border-box;
    max-width: 100%; /* Asegura que nada sea más ancho que la pantalla */
}

/* =========================================
   1. LAYOUT GENERAL
   ========================================= */
.section-sorteos {
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    overflow-x: hidden; 
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

/* =========================================
   2. LISTADO DE SORTEOS (GRID & CARDS)
   ========================================= */
.sorteos-grid {
    display: grid;
    /* AJUSTE CLAVE: auto-fit en vez de auto-fill y minmax 260px para móviles pequeños */
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); 
    gap: 30px;
    width: 100%;
    margin: 0 auto;
    justify-content: center; /* Centra el grid si sobra espacio */
    justify-items: center;   /* Centra las tarjetas dentro de sus celdas */
}

.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%;
    max-width: 400px; /* Ancho máximo para que no se vea gigante */
    margin: 0 auto; 
}

.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: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    backdrop-filter: blur(2px);
}

.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;
    background: #fef2f2;
    border-radius: 6px;
    border: 1px solid #fecaca;
}

/* =========================================
   4. DETALLE DEL SORTEO (CORREGIDO PARA CENTRADO)
   ========================================= */
.sorteo-detail-container {
    display: flex;
    flex-wrap: wrap; /* Permite que caigan en columna */
    gap: 40px;
    padding: 40px 20px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    justify-content: center; /* Centra las columnas horizontalmente */
}

/* Columnas flexibles pero controladas */
.sorteo-info-col { 
    flex: 1 1 320px; /* Base 320px, crece y encoge */
    max-width: 600px; 
    width: 100%;
}

.sorteo-form-col { 
    flex: 1 1 320px; 
    max-width: 500px; 
    width: 100%;
}

.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 {
    font-size: 2.2rem;
    margin-bottom: 25px;
    color: #1a1a1a;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
}

@media (min-width: 900px) {
    .sorteo-title { text-align: center; } 
}

.sorteo-desc-box {
    margin-bottom: 30px;
    line-height: 1.7;
    color: #4b5563;
    font-size: 1.05rem;
    background: #fff;
    width: 100%;
}

.sorteo-desc-box h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
    color: #111;
    font-weight: 700;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 8px;
    display: inline-block;
}

/* 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); }

/* TARJETAS DE INFORMACIÓN (MODALIDADES) */
.modalities-title {
    text-align: center;
    font-size: 1.25rem;
    color: #111;
    font-weight: 700;
    margin: 30px 0 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.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; } }

.meta-card { flex: 1; background: #fff; border: 2px solid #f3f4f6; 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%; }
.meta-card.compra { background-color: #eff6ff; border-color: #bfdbfe; }
.meta-card.canje { background-color: #f0fdf4; border-color: #bbf7d0; }
.meta-card:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(0,0,0,0.05); }

.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; }
.compra .meta-icon-circle { background: #fff; color: #1e40af; }
.canje .meta-icon-circle { background: #fff; color: #15803d; }

.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 */
.participation-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-bottom: 25px; border-bottom: none; width: 100%; }
.tab-btn { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    padding: 15px 5px; 
    background: #fcfcfc; 
    border: 2px solid #e5e7eb; 
    border-radius: 12px; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    color: #6b7280; 
    font-weight: 700; 
    font-size: 0.95rem; 
    text-align: center;
    height: 100%;
    width: 100%;
}
.tab-btn i { font-size: 1.8rem; margin-bottom: 8px; margin-right: 0; }
.tab-btn:hover { border-color: #cbd5e1; background-color: #f3f4f6; transform: translateY(-2px); }
.tab-btn.active { border-color: var(--color-primary); background-color: #fff; color: var(--color-primary); box-shadow: 0 4px 15px rgba(0,0,0,0.08); transform: translateY(-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
   ========================================= */
.success-container { max-width: 800px; margin: 40px auto; padding: 0 20px; width: 100%; }
.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;
    }
    
    /* 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) {
    .section-sorteos { 
        padding: 20px 10px;
        width: 100%;
        overflow-x: hidden;
    }
    
    /* Grid de sorteos centrado y flexible */
    .sorteos-grid { 
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); /* 260px para celulares pequeños */
        justify-items: center; /* Centra las tarjetas */
        gap: 20px;
    }
    
    .sorteo-card {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
    }
    
    /* DETALLE DEL SORTEO */
    .sorteo-title { font-size: 1.6rem; }
    
    /* 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; 
    }
    
    .tab-btn { 
        padding: 10px 5px; 
        font-size: 0.85rem; 
    }
    
    /* 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;
}

/* =========================================
   9. REDISEÑO V12 (sorteos.php)
   ========================================= */
.sorteos-v12 {
    --so-green: #076313;
    --so-deep: #004a13;
    --so-yellow: #ffd20a;
    max-width: 1448px;
    margin: 0 auto;
    padding: 14px 20px 40px;
    color: #17361d;
}
.sorteos-v12 svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.so-hero {
    position: relative;
    height: min(469px, 52vw);
    min-height: 220px;
    border-radius: 17px;
    overflow: hidden;
    background: #063f16;
    box-shadow: 0 1px 2px rgba(0,0,0,.08);
}
.so-hero-track { position: absolute; inset: 0; }
.so-hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity .45s ease;
}
.so-hero img.is-active { opacity: 1; }
.so-hero-dots {
    position: absolute;
    left: 50%;
    bottom: 12px;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}
.so-hero-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255,255,255,.45);
    cursor: pointer;
}
.so-hero-dots button.is-active { background: #fff; }
.so-hero[data-count="0"] .so-arrow,
.so-hero[data-count="1"] .so-arrow,
.so-hero[data-count="0"] .so-hero-dots,
.so-hero[data-count="1"] .so-hero-dots { display: none; }
.so-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 68px;
    border: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    color: #0b7b1d;
    font-size: 40px;
    cursor: pointer;
    z-index: 2;
}
.so-arrow.left { left: 6px; }
.so-arrow.right { right: 6px; }
.so-hero-hotspot {
    position: absolute;
    left: 68.5%;
    top: 78%;
    width: 18%;
    height: 11%;
    background: transparent;
    border: 0;
    border-radius: 30px;
    cursor: pointer;
}
.so-intro {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin: 22px 4px 8px;
}
.so-eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    color: #128629;
    margin-bottom: 6px;
}
.so-intro h2 {
    margin: 0 0 6px;
    font-size: 28px;
    color: #0b3d16;
}
.so-intro p { margin: 0; color: #667066; font-size: 14px; }
.so-legend { display: flex; gap: 16px; font-size: 13px; color: #445046; white-space: nowrap; }
.so-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin-right: 6px;
}
.so-dot.available { background: #16a34a; }
.so-dot.upcoming { background: #9ca3af; }
.so-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 16px;
}
.so-card {
    background: #fff;
    border: 1px solid #e2e5e2;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,.06);
    position: relative;
}
.so-flyer { height: 240px; background: #075217; position: relative; }
.so-flyer img { width: 100%; height: 100%; object-fit: cover; display: block; }
.so-card-tag, .so-price-chip {
    position: absolute;
    top: 12px;
    background: rgba(255,255,255,.92);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #14521c;
}
.so-card-tag { left: 12px; }
.so-price-chip { right: 12px; }
.so-card.featured .so-card-tag { background: #ffd20a; color: #3b2c00; }
.so-card-bottom {
    min-height: 76px;
    display: grid;
    grid-template-columns: 1.05fr 1.05fr 1.15fr;
    align-items: stretch;
}
.so-meta {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-right: 1px solid #edf0ed;
}
.so-meta svg { color: #168025; width: 22px; height: 22px; flex: 0 0 auto; }
.so-meta p { margin: 0; font-size: 11px; color: #444; line-height: 1.2; }
.so-meta strong { font-size: 12px; color: #303030; display: block; }
.so-join-wrap { display: flex; align-items: center; padding: 0 10px; }
.so-join {
    height: 41px;
    border: 0;
    border-radius: 8px;
    background: #08701a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
}
.so-join svg { width: 18px; height: 18px; }
.so-join:disabled, .so-join[aria-disabled="true"] {
    background: #6b7a6e;
    cursor: not-allowed;
}
.so-upcoming-overlay {
    position: absolute;
    inset: 0;
    background: rgba(20,30,22,.55);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 12px;
}
.so-upcoming-cd { display: flex; gap: 6px; }
.so-upcoming-cd div {
    min-width: 44px;
    background: rgba(0,0,0,.35);
    border-radius: 6px;
    padding: 4px 6px;
}
.so-upcoming-cd b { display: block; font-size: 16px; }
.so-upcoming-cd span { font-size: 8px; letter-spacing: .04em; }
.so-loading, .so-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 28px;
    color: #667;
}
.so-participation { margin-top: 28px; }
.so-participation-grid {
    display: grid;
    grid-template-columns: 43.5% 56.5%;
    gap: 14px;
}
.so-register-panel, .so-payment-panel {
    background: #f5f7f3;
    border: 1px solid #dfe6dc;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,.06);
}
.so-panel-head {
    min-height: 91px;
    color: #fff;
    background: linear-gradient(180deg,#138024,#006512);
    display: flex;
    align-items: center;
    padding: 12px 24px;
    position: relative;
    top: auto;
    z-index: 0;
}
.sorteos-v12 .so-panel-head .so-panel-title,
.sorteos-v12 .so-panel-head .so-panel-sub {
    color: #fff !important;
    font-family: Poppins, Arial, Helvetica, sans-serif;
    text-align: left;
}
.sorteos-v12 .so-panel-head .so-panel-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: .04em;
    line-height: 1.15;
    text-transform: uppercase;
}
.sorteos-v12 .so-panel-head .so-panel-sub {
    margin: 6px 0 0;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
}
.so-register-head { gap: 16px; }
.so-head-icon { width: 44px; height: 52px; color: #ffd523; flex: 0 0 auto; }
.so-head-icon svg { width: 100%; height: 100%; stroke-width: 3; }
.so-payment-head { justify-content: space-between; gap: 12px; }
.so-ticket-price {
    background: #fffdeb;
    color: #17451d;
    border-radius: 10px;
    min-width: 120px;
    padding: 8px 12px;
    text-align: center;
}
.so-ticket-price small { font-size: 11px; font-weight: 800; display: block; }
.so-ticket-price strong { font-size: 26px; }
.so-panel-body {
    background: #fff;
    margin: 0 13px 12px;
    border-radius: 0 0 12px 12px;
    border: 1px solid #e2e7df;
    border-top: 0;
    padding: 18px 22px 15px;
}
.so-selected {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    background: #f3f8f1;
    border: 1px solid #d8e9d5;
    border-radius: 8px;
    padding: 8px 11px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #58705c;
}
.so-selected strong { color: #0a6e18; }
.so-reg-group { margin-bottom: 10px; }
.so-reg-label { display: block; font-size: 12px; font-weight: 700; margin-bottom: 6px; color: #35503a; }
.so-doc-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.so-doc-option {
    height: 52px;
    border-radius: 14px;
    border: 1.5px solid #d5e3d1;
    background: #f2f7ef;
    color: #4a5844;
    font-weight: 800;
    cursor: pointer;
}
.so-doc-option.active {
    border-color: #128629;
    background: #f7fff5;
    color: #164f1d;
    box-shadow: 0 0 0 3px rgba(18,134,41,.12);
}
.so-field {
    height: 50px;
    border: 1px solid #dfe4df;
    border-radius: 8px;
    display: flex;
    align-items: center;
    padding: 0 12px;
}
.so-field:focus-within { border-color: #218a2c; box-shadow: 0 0 0 3px rgba(33,138,44,.1); }
.so-field.invalid { border-color: #d33; }
.so-field input { border: 0; outline: 0; width: 100%; height: 100%; background: transparent; font-size: 14px; }
.so-terms { font-size: 12px; color: #555; line-height: 1.45; }
.so-terms button { border: 0; background: none; color: #145d1c; text-decoration: underline; cursor: pointer; padding: 0; }
.so-proof-box {
    display: grid;
    grid-template-columns: 36px 1fr auto;
    gap: 10px;
    align-items: center;
    border: 1.5px dashed #b7cfb8;
    border-radius: 12px;
    padding: 12px;
    margin: 12px 0;
    background: #f7fbf6;
}
.so-proof-icon { color: #168025; }
.so-proof-copy strong { display: block; font-size: 13px; }
.so-proof-copy span { font-size: 11px; color: #59805e; }
.so-proof-status { margin-top: 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; }
.so-proof-status[hidden] { display: none; }
.so-proof-status button { border: 0; background: none; color: #b91c1c; cursor: pointer; }
.so-proof-btn {
    border: 0;
    background: linear-gradient(#168128,#00600d);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 800;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.so-proof-btn svg { width: 16px; height: 16px; }
.so-continue {
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: #ffd000;
    color: #153d1a;
    font-weight: 900;
    cursor: pointer;
}
.so-continue:disabled { opacity: .6; cursor: wait; }
.so-pay-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.so-pay-card {
    border: 2px solid #d9cde2;
    border-radius: 13px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #fff;
    cursor: pointer;
}
.so-pay-card.plin { border-color: #c7e2e1; }
.so-pay-card.selected { box-shadow: 0 0 0 4px rgba(18,128,36,.14); }
.so-pay-top { height: 52px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.so-yape-logo { font-family: cursive; font-size: 26px; color: #6b2390; font-style: italic; }
.so-plin-logo {
    width: 42px; height: 42px; border-radius: 50%;
    background: #12c8c5; color: #fff; display: grid; place-items: center; font-size: 12px;
}
.so-qr { width: 160px; height: 150px; object-fit: contain; background: #f6f6f6; margin: 6px 0; }
.so-merchant, .so-pay-number { font-size: 13px; text-align: center; color: #252525; }
.so-pay-note {
    display: block;
    text-align: center;
    font-size: 12px;
    color: #667066;
    min-height: 1em;
}
.so-pay-action {
    margin-top: auto;
    width: 100%;
    min-height: 58px;
    color: #fff;
    border: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}
.so-pay-action.yape { background: #682091; }
.so-pay-action.plin { background: #08b9b5; }
.so-note {
    margin-top: 14px;
    border: 1px solid #d1dec9;
    background: #f6faf0;
    border-radius: 9px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #276b31;
    font-size: 12px;
}
.so-shield {
    width: 28px; height: 28px; border-radius: 50%;
    background: #2c9c3a; color: #fff; display: grid; place-items: center; font-weight: 900;
}
.so-countdown-banner {
    margin-top: 15px;
    border-radius: 14px;
    background: radial-gradient(circle at 52% 150%, #08791f 0, #054d14 42%, #003d0e 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    color: #fff;
    padding: 18px 24px;
}
.so-countdown { display: flex; gap: 8px; margin-top: 8px; }
.so-countdown > div {
    width: 62px; height: 66px;
    border: 2px solid #85a900;
    border-radius: 7px;
    background: #064814;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.so-countdown b { font-size: 22px; color: #ffcf00; }
.so-countdown span { font-size: 8px; margin-top: 6px; }
.so-urgency h3 { font-size: 22px; color: #ffd214; margin: 0 0 5px; }
.so-urgency p { margin: 0; font-size: 14px; }
.so-trust {
    margin-top: 18px;
    border: 1px solid #e1e5e1;
    border-radius: 12px;
    background: #fff;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}
.so-trust-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 18px 16px;
    position: relative;
}
.so-trust-item:not(:last-child)::after {
    content: "";
    position: absolute;
    right: 0; top: 18px;
    height: 48px; width: 1px;
    background: #e8ebe8;
}
.so-trust-item svg { width: 36px; height: 36px; color: #08701a; stroke-width: 1.7; flex: 0 0 auto; }
.so-trust-item strong { display: block; font-size: 14px; }
.so-trust-item span { font-size: 12px; color: #5d635e; }
.so-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0,30,7,.62);
    display: grid;
    place-items: center;
    padding: 20px;
}
.so-modal-backdrop[hidden] { display: none; }
.so-modal {
    width: min(470px, 95vw);
    background: #fff;
    border-radius: 18px;
    padding: 30px;
    text-align: center;
    position: relative;
}
.so-modal-close { position: absolute; right: 15px; top: 10px; background: none; border: 0; font-size: 28px; cursor: pointer; }
.so-modal-icon {
    width: 65px; height: 65px; border-radius: 50%;
    background: #e9f7e9; color: #08701a;
    display: grid; place-items: center; font-size: 32px; margin: 0 auto;
}
.so-modal h2 { color: #0a6418; margin: 14px 0 12px; }
.so-ticket-code {
    font-size: 22px; font-weight: 900; color: #0a6418;
    background: #eef7ee; border: 1px dashed #65a46d;
    border-radius: 9px; padding: 12px; margin: 14px 0;
}
.so-modal-primary {
    height: 44px; padding: 0 30px; border-radius: 9px;
    background: #08701a; color: #fff; font-weight: 800; border: 0; cursor: pointer;
}
.so-toast {
    position: fixed; z-index: 120; left: 50%; bottom: 28px;
    transform: translate(-50%, 30px);
    background: #173b1e; color: #fff;
    padding: 13px 20px; border-radius: 10px;
    opacity: 0; pointer-events: none; transition: .2s;
}
.so-toast.show { opacity: 1; transform: translate(-50%, 0); }
.so-payment-panel.highlight { box-shadow: 0 0 0 4px rgba(18,128,36,.25); }

@media (max-width: 1100px) {
    .so-cards { grid-template-columns: 1fr 1fr; }
    .so-participation-grid, .so-trust { grid-template-columns: 1fr; }
    .so-trust-item:not(:last-child)::after { display: none; }
    .so-intro { flex-direction: column; align-items: flex-start; }
    .so-countdown-banner { flex-direction: column; text-align: center; }
    .so-countdown { justify-content: center; }
}
@media (max-width: 720px) {
    .sorteos-v12 { padding: 10px 10px 28px; }
    .so-cards, .so-pay-cards, .so-card-bottom { grid-template-columns: 1fr; }
    .so-meta { border-right: 0; border-bottom: 1px solid #edf0ed; }
    .so-arrow { width: 40px; height: 52px; font-size: 30px; }
    .so-proof-box { grid-template-columns: 1fr; }
    .so-intro h2 { font-size: 22px; }
}