/* ── Uruamerica Participaciones – Frontend Styles ── */

:root {
    --urap-available:  #2ecc71;
    --urap-reserved:   #f39c12;
    --urap-sold:       #e74c3c;
    --urap-selected:   #3498db;
    --urap-bg:         #f8f9fa;
    --urap-border:     #dee2e6;
    --urap-radius:     8px;
    --urap-font:       inherit;
}

/* ── Wrap ── */
.urap-selector-wrap {
    margin: 24px 0;
    font-family: var(--urap-font);
}

/* ── Barra de progreso ── */
.urap-progress-section { margin-bottom: 20px; }

.urap-progress-bar {
    height: 14px;
    background: #e9ecef;
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.urap-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--urap-sold), #c0392b);
    border-radius: 99px;
    transition: width .5s ease;
}
.urap-progress-legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: .85rem;
}
.urap-legend-item { display: flex; align-items: center; gap: 5px; }
.urap-dot {
    width: 12px; height: 12px;
    border-radius: 3px;
    display: inline-block;
}
.urap-dot-sold       { background: var(--urap-sold); }
.urap-dot-reserved   { background: var(--urap-reserved); }
.urap-dot-available  { background: var(--urap-available); }

/* ── Precio ── */
.urap-price-info {
    background: var(--urap-bg);
    border: 1px solid var(--urap-border);
    border-radius: var(--urap-radius);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: .95rem;
}

/* ── Buscador de número ── */
.urap-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}
.urap-search-box input {
    flex: 1;
    max-width: 200px;
    padding: 7px 10px;
    border: 1px solid var(--urap-border);
    border-radius: var(--urap-radius);
}
.urap-search-box button {
    padding: 7px 14px;
    background: #555;
    color: #fff;
    border: none;
    border-radius: var(--urap-radius);
    cursor: pointer;
}

/* ── Header grilla ── */
.urap-numbers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: .9rem;
    font-weight: 600;
}
.urap-btn-random {
    background: #6f42c1;
    color: #fff;
    border: none;
    border-radius: var(--urap-radius);
    padding: 6px 12px;
    cursor: pointer;
    font-size: .85rem;
}
.urap-btn-random:hover { background: #5a32a3; }

/* ── Grilla de números ── */
.urap-numbers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 5px;
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--urap-border);
    border-radius: var(--urap-radius);
    padding: 12px;
    background: #fff;
    margin-bottom: 16px;
    scrollbar-width: thin;
}

.urap-number-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    border-radius: 6px;
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform .1s, box-shadow .1s;
    user-select: none;
    position: relative;
}

/* Disponible */
.urap-number-cell.available {
    background: #eafaf1;
    color: #1e8449;
    border-color: var(--urap-available);
}
.urap-number-cell.available:hover {
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(46,204,113,.4);
}

/* Seleccionado por el usuario */
.urap-number-cell.selected {
    background: var(--urap-selected);
    color: #fff;
    border-color: #2980b9;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(52,152,219,.5);
}

/* Reservado (amarillo, tachado) */
.urap-number-cell.reserved {
    background: #fef9e7;
    color: #b7950b;
    border-color: var(--urap-reserved);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .85;
}

/* Vendido (rojo, tachado) */
.urap-number-cell.sold {
    background: #fdedec;
    color: #922b21;
    border-color: var(--urap-sold);
    cursor: not-allowed;
    text-decoration: line-through;
    opacity: .8;
}

/* Highlight de búsqueda */
.urap-number-cell.highlighted {
    outline: 3px solid #f39c12;
    outline-offset: 2px;
    animation: urap-pulse .5s ease 2;
}
@keyframes urap-pulse {
    0%, 100% { outline-color: #f39c12; }
    50%       { outline-color: #e74c3c; }
}

.urap-loading {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    color: #888;
}

/* ── Sección de seleccionados ── */
.urap-selected-section {
    background: #eaf4fb;
    border: 1px solid #aed6f1;
    border-radius: var(--urap-radius);
    padding: 14px 16px;
    margin-bottom: 16px;
}
.urap-selected-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: .9rem;
}
.urap-selected-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    min-height: 30px;
}
.urap-chip {
    background: var(--urap-selected);
    color: #fff;
    padding: 3px 10px;
    border-radius: 99px;
    font-size: .82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.urap-chip:hover { background: #2471a3; }
.urap-chip-remove { font-size: 1rem; line-height: 1; }

.urap-total-row {
    font-size: .95rem;
    margin-bottom: 8px;
}
.urap-total-row strong { font-size: 1.1rem; }

.urap-btn-secondary {
    background: #fff;
    border: 1px solid #aed6f1;
    color: #2471a3;
    padding: 5px 12px;
    border-radius: var(--urap-radius);
    cursor: pointer;
    font-size: .82rem;
}

/* ── Notices ── */
.urap-notices { margin: 10px 0; }
.urap-notice {
    padding: 10px 14px;
    border-radius: var(--urap-radius);
    margin-bottom: 6px;
    font-size: .9rem;
}
.urap-notice-error   { background: #fdedec; border-left: 4px solid var(--urap-sold); color: #922b21; }
.urap-notice-success { background: #eafaf1; border-left: 4px solid var(--urap-available); color: #1e8449; }
.urap-notice-info    { background: #eaf4fb; border-left: 4px solid var(--urap-selected); color: #21618c; }

/* ── Cerrado ── */
.urap-closed {
    background: #fdedec;
    border: 1px solid var(--urap-sold);
    border-radius: var(--urap-radius);
    padding: 14px;
    color: #922b21;
    margin: 16px 0;
}

/* ── Precio display ── */
.urap-price { font-size: 1.4rem; font-weight: 700; }
.urap-price small { font-size: .75rem; font-weight: 400; color: #666; }

/* ── Responsive ── */
@media (max-width: 480px) {
    .urap-numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    }
    .urap-number-cell { height: 36px; font-size: .72rem; }
}

/* ── Botón de compra propio ── */
.urap-buy-wrap {
    margin: 16px 0 8px;
}
.urap-checkout-btn {
    width: 100%;
    padding: 14px 20px !important;
    font-size: 1.1rem !important;
    font-weight: 700 !important;
    border-radius: var(--urap-radius) !important;
    cursor: pointer;
    background: #2ecc71 !important;
    color: #fff !important;
    border: none !important;
    transition: background .2s, transform .1s;
    letter-spacing: .3px;
}
.urap-checkout-btn:hover:not(:disabled) {
    background: #27ae60 !important;
    transform: translateY(-1px);
}
.urap-checkout-btn:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}
