/* ================================================================
   Rassuerte – Selección de Números v1.1.0
   ============================================================== */

/* ---- Variables ---- */
:root {
    --rsn-primary:   #e74c3c;
    --rsn-success:   #27ae60;
    --rsn-warning:   #f39c12;
    --rsn-sold:      #c0392b;
    --rsn-selected:  #2980b9;
    --rsn-bg:        #fdf9f0;
    --rsn-border:    #e8d5b0;
    --rsn-radius:    10px;
}

/* ================================================================
   SELECTOR PRINCIPAL (página de producto)
   ============================================================== */
.rsn-selector {
    background: var(--rsn-bg);
    border: 2px solid var(--rsn-border);
    border-radius: var(--rsn-radius);
    padding: 22px 20px 18px;
    margin: 18px 0 10px;
}

.rsn-titulo {
    font-size: 1.1em;
    font-weight: 800;
    color: var(--rsn-primary);
    margin: 0 0 16px;
    text-align: center;
    letter-spacing: .02em;
}

/* -- Input + botón -- */
.rsn-input-wrap {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
}

.rsn-input {
    flex: 1;
    padding: 11px 14px;
    font-size: 1.4em;
    font-weight: 700;
    text-align: center;
    letter-spacing: .25em;
    border: 2px solid var(--rsn-border);
    border-radius: 8px;
    background: #fff;
    color: #333;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    font-family: 'Courier New', monospace;
    min-width: 0;
}
.rsn-input:focus {
    border-color: var(--rsn-selected);
    box-shadow: 0 0 0 3px rgba(41,128,185,.15);
}

.rsn-btn {
    padding: 11px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    flex-shrink: 0;
}
.rsn-btn-agregar {
    background: var(--rsn-primary);
    color: #fff;
}
.rsn-btn-agregar:hover:not(:disabled) {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231,76,60,.3);
}
.rsn-btn-agregar:disabled { opacity: .5; cursor: not-allowed; }

/* -- Estado / mensaje -- */
.rsn-estado {
    min-height: 20px;
    font-size: .88em;
    font-weight: 600;
    text-align: center;
    margin: 4px 0 10px;
}
.rsn-estado--ok    { color: var(--rsn-success); }
.rsn-estado--error { color: var(--rsn-sold); }
.rsn-estado--info  { color: #7f8c8d; }

/* -- Chips de seleccionados -- */
.rsn-lista-seleccionados {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-height: 36px;
    margin-bottom: 12px;
    align-items: center;
}

.rsn-chip-vacio {
    color: #bbb;
    font-size: .82em;
    font-style: italic;
}

.rsn-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: var(--rsn-selected);
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    border-radius: 24px;
    padding: 5px 10px 5px 14px;
    letter-spacing: .12em;
    font-family: 'Courier New', monospace;
    animation: rsn-pop .2s ease;
}

@keyframes rsn-pop {
    0%   { transform: scale(0.7); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

.rsn-chip-remove {
    background: rgba(255,255,255,.25);
    border: none;
    color: #fff;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background .15s;
}
.rsn-chip-remove:hover { background: rgba(255,255,255,.45); }

/* -- Precio total -- */
.rsn-precio-total-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--rsn-border);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: .95em;
}
.rsn-precio-label { color: #777; flex-shrink: 0; }
.rsn-precio-total { color: #333; font-weight: 500; }

/* -- Mapa de números -- */
.rsn-mapa-wrap { margin-top: 14px; border-top: 1px dashed var(--rsn-border); padding-top: 10px; }

.rsn-mapa-summary {
    cursor: pointer;
    font-size: .8em;
    color: #999;
    user-select: none;
    outline: none;
    padding: 2px 0;
}
.rsn-mapa-summary:hover { color: #666; }

.rsn-mapa-scroll {
    position: relative;
    overflow-y: auto;
    height: 260px;
    background: #fafafa;
    border-radius: 6px;
    margin-top: 6px;
}

.rsn-mapa-btn {
    font-size: .65em;
    font-weight: 700;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    transition: background .1s;
    font-family: 'Courier New', monospace;
    line-height: 24px;
    padding: 0;
    box-sizing: border-box;
}
.rsn-mapa-btn--disponible  { background: #d5f5e3; color: #1e8449; }
.rsn-mapa-btn--disponible:hover { background: var(--rsn-success); color: #fff; }
.rsn-mapa-btn--vendido     { background: #fdecea; color: #c0392b; cursor: not-allowed; opacity: .6; text-decoration: line-through; }
.rsn-mapa-btn--seleccionado{ background: var(--rsn-selected); color: #fff; }

/* ================================================================
   NÚMEROS BENDECIDOS
   Diseño que replica el estilo de tarjeta de lotería
   ============================================================== */
.rsn-grilla-bendecidos {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
}

.rsn-grilla-titulo {
    font-size: .85em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--rsn-warning);
    margin: 0;
    text-align: center;
}

.rsn-grilla-botones {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

/* Botón base — aspecto de tarjeta de número */
.rsn-bendecido {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 12px 18px;
    font-size: 1.25em;
    font-weight: 900;
    letter-spacing: .18em;
    font-family: 'Courier New', monospace;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: transform .18s, box-shadow .18s, opacity .18s;
    line-height: 1;
    text-decoration: none;
    /* Sin outline feo */
    outline: none;
}
.rsn-bendecido:focus-visible {
    box-shadow: 0 0 0 3px rgba(243,156,18,.5);
}

/* Disponible: dorado brillante */
.rsn-bendecido--disponible {
    background: linear-gradient(145deg, #f5c518 0%, #e67e22 100%);
    color: #fff;
    box-shadow: 0 4px 14px rgba(230,126,34,.35), inset 0 1px 0 rgba(255,255,255,.2);
    text-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.rsn-bendecido--disponible:hover {
    transform: translateY(-3px) scale(1.06);
    box-shadow: 0 8px 22px rgba(230,126,34,.5), inset 0 1px 0 rgba(255,255,255,.2);
}
.rsn-bendecido--disponible:active {
    transform: translateY(-1px) scale(1.02);
}

/* Vendido: gris apagado, no clicable */
.rsn-bendecido--vendido {
    background: #dfe6e9;
    color: #95a5a6;
    box-shadow: none;
    cursor: not-allowed;
    opacity: .55;
}

/* Badge "VENDIDO" encima del número */
.rsn-vendido-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--rsn-sold);
    color: #fff;
    font-size: 8px;
    font-weight: 900;
    font-family: sans-serif;
    letter-spacing: .05em;
    border-radius: 8px;
    padding: 2px 5px;
    text-shadow: none;
    text-decoration: none;
    pointer-events: none;
}

/* Estado badge (shortcode rsn_estado_numero) */
.rsn-estado-badge    { display: inline-block; padding: 3px 10px; border-radius: 20px; font-weight: bold; font-size: .9em; margin: 2px; }
.rsn-estado-disponible { background: #d5f5e3; color: #1e8449; }
.rsn-estado-vendido    { background: #fdecea; color: var(--rsn-sold); }

/* ================================================================
   RESPONSIVE
   ============================================================== */
@media (max-width: 480px) {
    .rsn-input-wrap  { flex-direction: column; }
    .rsn-btn-agregar { width: 100%; }
    .rsn-bendecido   { font-size: 1.05em; min-width: 68px; padding: 10px 14px; }
    .rsn-mapa        { grid-template-columns: repeat(auto-fill, minmax(36px,1fr)); }
    .rsn-mapa-btn    { font-size: .6em; }
}
