/* ============================================================
ESTILOS ESPECÍFICOS PARA RIFAS
Sistema SaaS de Rifas - Versión 2.0
============================================================ */

/* ============================================================
1. NÚMEROS - GRID
============================================================ */
.numero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
}

.numero-item {
    position: relative;
    aspect-ratio: 2 / 1;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #000;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
    background: linear-gradient(135deg, #e6c27a 0%, #ffdf73 30%, #d4af37 60%, #aa771c 100%);
    clip-path: polygon(
        0 0, 100% 0, 
        100% 12.5%, 95% 18.75%, 100% 25%, 95% 31.25%, 100% 37.5%, 95% 43.75%, 100% 50%, 95% 56.25%, 100% 62.5%, 95% 68.75%, 100% 75%, 95% 81.25%, 100% 87.5%, 95% 93.75%, 100% 100%, 
        0 100%, 
        5% 93.75%, 0 87.5%, 5% 81.25%, 0 75%, 5% 68.75%, 0 62.5%, 5% 56.25%, 0 50%, 5% 43.75%, 0 37.5%, 5% 31.25%, 0 25%, 5% 18.75%, 0 12.5%
    );
}

.numero-item::after {
    content: "";
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 10px;
    right: 10px;
    border: 1px solid rgba(0, 0, 0, 0.75);
    border-radius: 4px;
    pointer-events: none;
}

.numero-item-sm {
    width: 70px !important;
    height: 35px !important;
    font-size: 0.8rem !important;
    flex: 0 0 auto !important;
}
.numero-item-sm::after {
    top: 2px !important;
    bottom: 2px !important;
    left: 6px !important;
    right: 6px !important;
    border-radius: 3px !important;
}

/* Estados */
.numero-item.disponible {
    background: linear-gradient(135deg, #e6c27a 0%, #ffdf73 30%, #d4af37 60%, #aa771c 100%);
    color: #000;
}
.numero-item.disponible:hover {
    filter: brightness(1.15);
    transform: scale(1.05);
}

.numero-item.reservado {
    background: linear-gradient(135deg, #e69a7a 0%, #ff9873 30%, #d46b37 60%, #aa421c 100%);
    color: #fff;
    cursor: not-allowed;
    opacity: 0.95;
}
.numero-item.reservado::after {
    border-color: rgba(255, 255, 255, 0.6);
}

.numero-item.vendido {
    background: linear-gradient(135deg, #d3d3d3 0%, #e0e0e0 30%, #a9a9a9 60%, #808080 100%);
    color: #555;
    cursor: not-allowed;
    opacity: 0.8;
}
.numero-item.vendido::after {
    border-color: rgba(85, 85, 85, 0.5);
}

.numero-item.ganador {
    background: linear-gradient(135deg, #ffd700 0%, #fffacd 30%, #ffb300 60%, #ff8f00 100%);
    color: #000;
    cursor: not-allowed;
    animation: pulse-gold 1.5s infinite;
}
.numero-item.ganador::after {
    border-color: rgba(0, 0, 0, 0.8);
}

.numero-item.seleccionado {
    background: linear-gradient(135deg, #7ab4e6 0%, #73b8ff 30%, #378fd4 60%, #1c5eaa 100%);
    color: #fff;
    transform: scale(1.1);
}
.numero-item.seleccionado::after {
    border-color: rgba(255, 255, 255, 0.8);
}

@keyframes pulse-gold {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================================
2. COMPARTIR
============================================================ */
.compartir-btn {
    transition: all 0.3s;
}
.compartir-btn:hover {
    transform: translateY(-3px);
}

/* ============================================================
3. RESUMEN DE COMPRA
============================================================ */
.resumen-compra {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
}
body.dark-mode .resumen-compra {
    background: #1a2744;
}

/* ============================================================
4. MÉTODOS DE PAGO
============================================================ */
.metodo-pago-card {
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
    border-radius: 12px;
    padding: 15px;
    background: white;
}
.metodo-pago-card:hover {
    border-color: #0d6efd;
    transform: translateY(-3px);
}
.metodo-pago-card.seleccionado {
    border-color: #0d6efd;
    background: #e7f1ff;
}
body.dark-mode .metodo-pago-card {
    background: #16213e;
}
body.dark-mode .metodo-pago-card.seleccionado {
    background: #1a2744;
    border-color: #3498db;
}

/* ============================================================
5. QR
============================================================ */
.qr-container {
    background: white;
    padding: 20px;
    border-radius: 15px;
    display: inline-block;
}
body.dark-mode .qr-container {
    background: #16213e;
}

/* ============================================================
6. RESPONSIVE
============================================================ */
@media (max-width: 768px) {
    .numero-grid {
        grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
        gap: 10px;
    }
    .numero-item {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .numero-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }
    .numero-item {
        font-size: 0.85rem;
    }
}
/* ============================================================
7. RESPONSIVE MEJORADO PARA RIFAS
============================================================ */

/* Tablet (? 991px): sticky cart becomes static */
@media (max-width: 991.98px) {
    .carrito-sticky {
        position: static !important;
        top: auto !important;
    }
    .carrito-card {
        max-height: none !important;
    }
    .hero-inner {
        padding: 20px 0 24px !important;
    }
}

/* Mobile (? 767px) */
@media (max-width: 767.98px) {
    .rifa-hero {
        padding: 0;
    }
    .hero-titulo {
        font-size: 1.5rem !important;
    }
    .hero-img-wrap {
        display: none !important;
    }
    .numeros-header {
        flex-direction: column !important;
        align-items: flex-start !important;
    }
    .numeros-filtros {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }
    .filtro-num {
        flex-shrink: 0;
    }
    .search-numero {
        max-width: 100% !important;
        width: 100% !important;
    }
    .rifa-body {
        padding: 18px !important;
    }
    .numeros-section {
        padding: 18px !important;
    }
    .compartir-section {
        padding: 18px !important;
    }
    .carrito-body {
        padding: 16px !important;
    }
    .info-stats {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Small phones (? 575px) */
@media (max-width: 575.98px) {
    .numero-grid {
        grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)) !important;
        gap: 5px !important;
    }
    .numero-item {
        font-size: 0.78rem !important;
        padding: 6px 2px !important;
    }
    .btn-aleatorio {
        width: 100% !important;
        justify-content: center !important;
    }
    .numeros-header > div {
        width: 100%;
    }
    .hero-stats {
        gap: 6px;
    }
    .hero-stat-chip {
        font-size: 0.72rem !important;
        padding: 5px 10px !important;
    }
}