/* ==========================================================================
   STC Loterías - Estilos del selector de rifa (frontend)
   ========================================================================== */

.stc-lottery-page {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    border-radius: 10px;
    overflow: hidden;
}

/* -------------------- Columna izquierda: póster -------------------- */

.stc-lottery-left {
    flex: 1 1 55%;
    min-width: 320px;
    background: #ffffff;
    padding: 24px;
    box-sizing: border-box;
}

.stc-lottery-logo {
    max-width: 90px;
    display: block;
    margin-bottom: 12px;
}

.stc-lottery-title {
    font-size: 28px;
    font-weight: 800;
    color: #1a1a1a;
    margin: 0 0 16px;
    line-height: 1.15;
}

/* Cuenta regresiva */

.stc-countdown {
    margin-bottom: 18px;
}

.stc-countdown-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stc-countdown-boxes {
    display: flex;
    gap: 8px;
}

.stc-countdown-box {
    flex: 1;
    background: #0d1b2a;
    color: #fff;
    border-radius: 8px;
    text-align: center;
    padding: 10px 4px;
}

.stc-countdown-value {
    display: block;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
}

.stc-countdown-unit {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ff9f1c;
    margin-top: 4px;
}

.stc-progress-bar {
    position: relative;
    background: #e9edf2;
    border-radius: 6px;
    height: 34px;
    margin-bottom: 18px;
    overflow: hidden;
}

.stc-progress-fill {
    background: linear-gradient(90deg, #2f6fed, #1c4fd6);
    height: 100%;
    transition: width 0.4s ease;
}

/*
 * Cuando ya hay al menos una venta/reserva, aseguramos un
 * ancho mínimo visible — de lo contrario, en rifas con
 * muchos números (ej. 1000), vender 1 o 2 tickets redondea
 * a un porcentaje tan chico que la barra se ve vacía.
 */
.stc-progress-fill.has-sales {
    min-width: 6px;
}

.stc-progress-label {
    position: absolute;
    top: 0;
    left: 14px;
    height: 100%;
    display: flex;
    align-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.stc-poster img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* -------------------- Columna derecha: selector + pago -------------------- */

.stc-lottery-right {
    flex: 1 1 40%;
    min-width: 320px;
    background: #ffffff;
    padding: 24px;
    box-sizing: border-box;
    border-left: 1px solid #eee;
}

/* Modos de selección */

.stc-selection-mode {
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.stc-mode-btn {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #e2e6ea;
    background: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #333;
    transition: all 0.15s ease;
}

.stc-mode-btn:hover {
    border-color: #ff9f1c;
}

.stc-mode-btn.active {
    background: #0d1b2a;
    border-color: #0d1b2a;
    color: #fff;
}

/* -------------------- Cantidades rápidas (modo automático) -------------------- */

.stc-quick-amounts {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.stc-quick-amount {
    padding: 20px 8px;
    border: none;
    border-radius: 10px;
    background: #eeeeee;
    color: #ff9f1c;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.15s ease;
}

.stc-quick-amount:hover {
    background: #e2e2e2;
}

.stc-quick-amount.active {
    background: #ff9f1c;
    color: #fff;
}

/* Cantidad de tickets (contador -/+, solo modo automático) */

.stc-quantity-box {
    margin-bottom: 16px;
}

.stc-quantity-box label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
    font-weight: 600;
}

.stc-quantity-controls {
    display: flex;
    align-items: stretch;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e6ea;
}

.stc-quantity-controls button {
    background: #ff9f1c;
    color: #1a1a1a;
    border: none;
    width: 60px;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    flex-shrink: 0;
}

.stc-quantity-controls button:hover {
    background: #f08c00;
}

.stc-quantity-controls input {
    flex: 1;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    border: none;
    background: #fff;
    color: #1a1a1a;
    -moz-appearance: textfield;
}

.stc-quantity-controls input::-webkit-outer-spin-button,
.stc-quantity-controls input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Leyenda */

.stclw-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 14px;
    font-size: 12px;
    color: #555;
}

.stclw-legend span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stclw-legend i {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.stclw-legend .available i { background: #2ecc71; }
.stclw-legend .reserved i { background: #f5b700; }
.stclw-legend .sold i { background: #e74c3c; }
.stclw-legend .selected i { background: #2f6fed; }

/* Grid de números */

.stc-manual-box {
    margin-bottom: 4px;
}

.stc-ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
    gap: 6px;
    max-height: 320px;
    overflow-y: auto;
    padding: 10px;
    margin-bottom: 16px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.stc-ticket {
    padding: 8px 0;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    color: #fff;
}

.stc-ticket.available {
    background: #2ecc71;
}

.stc-ticket.available:hover {
    background: #27ae60;
}

.stc-ticket.reserved {
    background: #f5b700;
    cursor: not-allowed;
}

.stc-ticket.sold {
    background: #e74c3c;
    cursor: not-allowed;
    opacity: 0.85;
}

.stc-ticket.selected {
    background: #2f6fed;
    box-shadow: 0 0 0 2px #0d1b2a inset;
}

.stc-ticket:disabled {
    opacity: 0.7;
}

/* Resumen de selección */

.stc-selection-summary {
    background: #f6f8fa;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 20px;
    font-size: 14px;
}

.stc-selected-numbers {
    margin-top: 4px;
    color: #2f6fed;
    font-weight: 600;
    word-break: break-word;
}

/* -------------------- Monto a transferir (caja con resplandor) -------------------- */

.stc-monto-wrapper {
    text-align: center;
    margin-bottom: 20px;
}

.stc-monto-label {
    margin: 0 0 10px;
    font-size: 14px;
    color: #555;
    font-weight: 600;
}

.stc-monto-pagar {
    display: block;
    background: #ff9f1c;
    color: #fff;
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    box-shadow: 0 0 24px 4px rgba(255, 159, 28, 0.55);
}

.stc-monto-titulo {
    display: block;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.stc-monto-valor {
    display: block;
    font-size: 22px;
    font-weight: 800;
}

/* Métodos de pago */

.stc-metodos-pago h3 {
    font-size: 17px;
    margin-bottom: 12px;
    color: #1a1a1a;
}

.stc-banco-card {
    border: 1px solid #e2e6ea;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    text-align: center;
    background: #fafbfc;
}

.stc-banco-card img {
    max-width: 90px;
    max-height: 60px;
    display: block;
    margin: 0 auto 10px;
    object-fit: contain;
}

.stc-banco-card strong {
    display: block;
    font-size: 16px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.stc-banco-card p {
    margin: 4px 0;
    font-size: 13px;
    color: #444;
}

/* Botón de compra */

.stc-add-to-cart-form {
    margin-top: 20px;
}

.stc-confirm-selection {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #0d1b2a, #16283d);
    color: #fff;
    border: 2px solid transparent;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.stc-confirm-selection:not(:disabled):hover {
    border-color: #ff9f1c;
}

.stc-confirm-selection:disabled {
    background: #c9cfd6;
    cursor: not-allowed;
}

/* Vacío */

.stc-lottery-empty {
    padding: 30px;
    text-align: center;
    color: #888;
    font-size: 15px;
}

/* -------------------- Responsive -------------------- */

@media (max-width: 780px) {
    .stc-lottery-page {
        flex-direction: column;
    }

    .stc-lottery-right {
        border-left: none;
        border-top: 1px solid #eee;
    }

    .stc-ticket-grid {
        grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    }

    .stc-quick-amount {
        padding: 16px 6px;
    }

    .stc-countdown-value {
        font-size: 18px;
    }
}