/* ==========================================================================
   TU RIFA CASH - HOJA DE ESTILOS PRINCIPAL
   Versión Limpia y Organizada
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap');

/* ==========================================================================
   1. VARIABLES Y ESTILOS GENERALES
   ========================================================================== */
:root {
    --color-bg: #ffffff;
    --color-text: #303030;
    --color-disponible: #0e41b9; /* Verde Principal */
    --color-seleccionado: #b3b3b3; /* Verde Oscuro */
    --color-pendiente: #d97e0a;  /* Naranja */
    --color-comprado: #D92B2B;   /* Rojo */
    --color-dark-grey: #282828;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    margin: 0;
}

h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    text-align: center;
}

.container {
    width: 90%; /* Ajustado para mejor visualización en escritorio */
    max-width: 1100px;
    margin: 2rem auto;
    background-color: #f5f5f5;
    padding: 2rem;
    border-radius: 10px;
    box-sizing: border-box;
    color: #303030;
}

.main-container {
    width: 100%;
    max-width: 80%;
    padding: 0 0 100px 0;
    box-sizing: border-box;
}

.main-button {
    background-color: var(--color-disponible);
    color: var(--color-bg);
    border: none;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}
.main-button:hover {
    background-color: var(--color-dark-grey);
}

/* ==========================================================================
   2. ESTRUCTURA PRINCIPAL (HEADER, FOOTER, TOPBAR)
   ========================================================================== */
.topbar {
    background-color: var(--color-disponible);
    color: var(--color-bg);
    display: flex;
    justify-content: space-around;
    padding: 10px 2rem;
    width: 100%;
    box-sizing: border-box;
    font-weight: 600;
}
.topbar a {
    color: var(--color-bg);
    text-decoration: none;
    transition: color 0.3s;
}
.topbar a:hover {
    color: var(--color-text);
}

.main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    box-sizing: border-box;
    background: #202020;
}
.header-logo img {
    height: 50px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 2rem;
    margin: 0;
}
.main-nav a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
}
.cta-button {
    background-color: var(--color-disponible);
    color: var(--color-bg);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 700;
}

.cta-button:hover {
    background-color: #ffffff;
    color: #000;
}

.widget-footer {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    padding: 3rem 2rem;
    margin-top: 2rem;
    border-top: 1px solid #333;
    box-sizing: border-box;
    background-color: var(--color-dark-grey);
}
.footer-column {
    flex: 1;
    padding: 0 1rem;
}
.footer-column h4 {
    margin-top: 0;
    text-transform: uppercase;
    color: #ffffff;
}
.footer-column ul {
    list-style: none;
    padding: 0;
}
.footer-column a {
    color: #ffffff;
    text-decoration: none;
    line-height: 2;
    transition: color 0.3s;
}
.footer-column a:hover {
    color: var(--color-disponible);
    text-decoration: none;
}

.main-footer {
    background-color: var(--color-disponible);
    color: #ffffff;
    text-align: center;
    padding: 10px 0;
    width: 100%;
    box-sizing: border-box;
    font-weight: 600;
}
.main-footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.3s;
}
.main-footer a:hover {
    color: #202020;
}

/* ==========================================================================
   3. ESTILOS POR PÁGINA
   ========================================================================== */

/* --- 3.1 PÁGINA DE INICIO (inicio.php) --- */
.hero-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 4rem;
    margin: 4rem 0;
}
.hero-left, .hero-right {
    flex: 1;
    min-width: 300px;
}
.hero-left { text-align: center; }
.hero-left h2 { font-size: 2.5rem; margin: 0; }
.prize-title {
    font-size: 5rem;
    color: var(--color-disponible);
    text-shadow: 0 0 20px var(--color-disponible);
    margin: 0;
    line-height: 1;
}
.prize-image { max-width: 100%; margin-top: 0; }
.hero-right ul { list-style: none; padding: 0; margin: 0 0 2rem 0; }
.hero-right ul li { margin-bottom: 1rem; font-size: 1.1rem; }

.progress-container { margin-bottom: 2rem; }
.progress-text { margin-bottom: 0.5rem; font-size: 1.2rem; }
.progress-bar-background {
    width: 100%;
    height: 50px;
    background-color: #E0E0E0;
    border-radius: 5px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background-color: var(--color-disponible);
}

.buy-button {
    display: block;
    background-color: var(--color-disponible);
    color: #fff;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 10px;
}

.details-section { margin-top: 7rem; }
.details-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}
.details-box {
    background-color: var(--color-disponible);
    color: #fff;
    padding: 3rem;
    border-radius: 10px;
    text-align: center;
    flex-grow: 1;
    min-width: 200px;
}
.details-box strong { display: block; font-size: 3rem; }
.details-box span { font-size: 1.2rem; }

#countdown-timer {
    display: block;
    justify-content: space-between;
    gap: 0.5rem;
    text-align: -webkit-auto;
    margin: 1rem 0;
}
.countdown-unit { display: flex; flex-direction: column; align-items: center; }
.countdown-value {
    background-color: var(--color-disponible);
    color: #ffffff;
    border: 3px solid var(--color-disponible);
    border-radius: 10px;
    padding: 1rem 1.5rem;
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    width: 120px;
    box-sizing: border-box;
}
.countdown-label { margin-top: 0.5rem; font-size: 1rem; font-weight: 600; text-transform: uppercase; }

/* --- 3.2 PÁGINAS DE COMPRA (seleccionar-tickets.php, confirmar-compra.php) --- */
.range-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin-bottom: 2rem;
}
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
}
.ticket {
    padding: 10px;
    text-align: center;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    user-select: none;
    color: #303030;
    transition: transform 0.2s, box-shadow 0.2s;
}
.ticket.disponible { background-color: #bdbdbd; cursor: pointer; border: 1px solid #a3a0a0; }
.ticket.disponible:hover { transform: scale(1.1); box-shadow: 0 0 15px #d97e0a; }
.ticket.seleccionado { background-color: #d48208; color: white; transform: scale(1.1); }
.ticket.pendiente { background-color: var(--color-pendiente); cursor: not-allowed; opacity: 0.8; }
.ticket.comprado { background-color: #676767; cursor: not-allowed; opacity: 0.8; transform: scale(1.1); }

.summary-and-next { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; margin-top: 2rem; width: 100%; }
.summary-display {
    background-color: #202020;
    border-radius: 8px;
    padding: 20px 0;
    display: flex;
    justify-content: space-around;
    width: 100%;
}
.summary-item { text-align: center; }
.summary-item span { display: block; font-size: 1rem; color: #aaa; }
.summary-item strong { font-size: 1.5rem; color: var(--color-disponible); }

#purchase-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}
#purchase-form input[type="text"],
#purchase-form input[type="email"],
#purchase-form input[type="tel"] {
    background-color: #ffffff;
    border: 1px solid #e1d9d9;
    color: var(--color-text);
    padding: 15px;
    border-radius: 5px;
    font-size: 1rem;
}

.payment-methods-images {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}
.payment-method-img {
    height: 150px;
    cursor: pointer;
    border-radius: 8px;
    border: 3px solid transparent;
    transition: all 0.3s ease;
    filter: drop-shadow(2px 4px 6px black);
    opacity: 0.7;
}
.payment-method-img:hover { opacity: 1; filter: grayscale(0%); transform: scale(1.1); }
.payment-method-img.selected { opacity: 1; filter: grayscale(0%); border-color: var(--color-disponible); transform: scale(1.1); }

.instructions-container {
    display: flex;
    flex-wrap: wrap;
    background-color: #dbdbdb;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    gap: 1.5rem;
}
.instructions-text { flex: 2; min-width: 250px; }
.instructions-text h4 { margin-top: 0; color: #303030; }
.instructions-image { flex: 1; display: flex; justify-content: center; align-items: center; }
.instructions-image img { max-width: 100%; border-radius: 8px; }

.upload-area { border: 2px dashed #888; padding: 2rem; text-align: center; cursor: pointer; border-radius: 5px; }

.form-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.form-actions .main-button, .form-actions .back-button { margin-top: 0; }
.back-button {
    display: inline-block;
    padding: 15px 30px;
    background-color: #ababab;
    color: var(--color-text);
    text-align: center;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    border-radius: 5px;
    text-transform: uppercase;
}
.back-button:hover { background-color: var(--color-dark-grey); color: var(--color-bg); }

/* Estilo para el contenedor con scroll de los tickets */
.ticket-scroll-container {
    max-height: 600px; /* Altura máxima del contenedor, ajústala a tu gusto */
    overflow-y: auto; /* AÑADE EL SCROLL VERTICAL SOLO SI ES NECESARIO */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    background-color: #f9f9f9;
    margin-bottom: 2rem;
}

/* --- 3.3 PÁGINAS DE UTILIDAD (mis-tickets.php, resultados.php, etc.) --- */
.tickets-page-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
    margin: 60px auto 0 auto;
    border-radius: 10px;
}
.search-form-tickets {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 400px;
    gap: 0.5rem;
}
.input-icon-wrapper { position: relative; }
.search-form-tickets .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #888; }
.search-form-tickets input {
    background-color: white;
    border: 2px solid #bfbfbf;
    color: #5f5f5f;
    padding: 15px 15px 15px 45px;
    border-radius: 5px;
    width: 100%;
    box-sizing: border-box;
}

.historial-title { text-transform: uppercase; margin-top: 3rem; }
.legend-container { display: flex; justify-content: center; gap: 2rem; margin: 1.5rem 0; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; }
.legend-ticket { display: inline-block; width: 40px; height: 20px; border-radius: 4px; }
.legend-ticket.pendiente { background-color: var(--color-pendiente); }
.legend-ticket.comprado { background-color: var(--color-comprado); }

.historial-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.historial-ticket { color: var(--color-bg); font-weight: 600; padding: 8px 15px; border-radius: 5px; }
.historial-ticket.pendiente { background-color: var(--color-pendiente); }
.historial-ticket.comprado { background-color: var(--color-comprado); }

.results-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
}
.winner-card {
    display: flex;
    flex-wrap: wrap; /* Permitirá que las columnas se apilen en móvil */
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Espacio entre las columnas */
    width: 100%;
    margin-bottom: 2.5rem;
    background-color: #f7f7f7; /* Fondo ligero para la tarjeta del ganador */
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.winner-left-column,
.winner-right-column {
    flex: 1; /* Ambas columnas intentarán ocupar el mismo espacio disponible */
    min-width: 300px; /* Ancho mínimo para que no se aplasten demasiado */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Centrar verticalmente el contenido */
    align-items: center; /* Centrar horizontalmente el contenido */
}

.winner-badge {
    max-width: 100%; /* Asegura que la imagen no se desborde */
    text-align: center; /* Centra la imagen */
}
.winner-badge img { 
    max-width: 100%;
    height: auto;
    display: block; /* Elimina espacio extra debajo de la imagen */
}

.winner-details {
    text-align: center; /* Centra el texto y el botón */
    width: 100%; /* Ocupa el ancho completo de su columna */
}
.winner-details h3 { 
    font-size: 2rem; 
    margin-top: 0;
    color: var(--color-disponible); /* Color del título */
}
.winner-details p { 
    font-size: 1.1rem; 
    margin: 0.8rem 0; 
    line-height: 1.5; 
}

.success-view { text-align: center; }
.success-view .icon { font-size: 5rem; color: var(--color-disponible); }

/* --- 3.4 PÁGINA DE AYUDA --- */
.help-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    border-radius: 10px;
}
.video-responsive-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    margin-bottom: 2rem;
}
.video-responsive-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
}
.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    background-color: var(--color-disponible);
    color: #fff;
    padding: 15px 30px;
    border-radius: 30px;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 700;
}
.whatsapp-button:hover {
}
.whatsapp-icon {
    font-size: 1.5rem;
}

/* --- 3.5 PÁGINAS LEGALES --- */
.legal-page a {
    color: var(--color-disponible);
    font-weight: 600;
    text-decoration: none;
}
.legal-page a:hover {
    text-decoration: none;
}

/* --- 3.6 PÁGINA DE LISTA DE PARTICIPANTES (tickets-comprados.php) --- */
.transparency-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    margin-bottom: 2rem;
}
.transparency-table th, 
.transparency-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
}
.transparency-table thead {
    background-color: var(--color-disponible);
    color: var(--color-bg);
    font-size: 14px;
    text-transform: uppercase;
}

/* ==========================================================================
   4. PANEL DE ADMINISTRACIÓN
   ========================================================================== */
.admin-body {
    background-color: #ebebeb;
    font-family: Arial, sans-serif;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 0;
    box-sizing: border-box;
}
.admin-container {
    position: relative;
    width: 100%;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 3rem;
    background: #303030;
}
.admin-header-logo {
    margin-bottom: 25px;
    padding-top: 20px;
}
.admin-header-logo img { 
    width: 100%;
    max-width: 150px;
    height: auto;
    padding-left: 2rem;
    margin-top: 0.5rem;
}

/* --- 4.1 LOGIN DE ADMIN --- */
.login-container {
    background-color: #303030;
    padding: 40px 30px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
    box-sizing: border-box;
    text-align: center;
}
.login-container form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
.login-container input[type="email"],
.login-container input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
    background-color: #ffffff;
    color: var(--color-text);
}
.login-container input[type="email"]:focus,
.login-container input[type="password"]:focus {
    border-color: #007bff;
    box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    outline: none;
}
/* En la sección 6. PANEL DE ADMINISTRACIÓN de tu style.css (o donde tengas estilos para el login) */

.login-container .login-input {
    background-color: #333; /* Fondo oscuro */
    border: 2px solid var(--color-disponible); /* Borde azul */
    color: #fff; /* Texto blanco */
    padding: 15px;
    border-radius: 5px;
    font-size: 1rem;
    width: 100%; /* Para que ocupe todo el ancho disponible */
    box-sizing: border-box; /* Incluye padding y border en el ancho total */
    margin-bottom: 1rem; /* Espacio entre los campos */
}

.login-container .login-input::placeholder {
    color: #888; /* Color del texto del placeholder */
}

/* *IMPORTANTE*: Revisa si tienes alguna otra regla que afecte específicamente a los input[type="password"] dentro del login-container. Si la encuentras, elimínala o ajústala. */
.login-container .main-button {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 5px;
    background-color: var(--color-disponible);
    color: var(--color-bg);
    cursor: pointer;
    transition: background-color 0.3s ease;
}
.login-container .main-button:hover {
    background-color: #fff;
}
.login-container .message.error {
    margin-top: 20px;
    padding: 10px;
    border-radius: 5px;
    background-color: #f8d7da;
    color: #721c24;
    font-size: 0.9rem;
}
.logout-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding-right: 2rem;
}
.logout-link:hover {
    color: #4bf915;
}

/* --- 4.2 ESCRITORIO DE ADMIN --- */
.request-card {
    background-color: #c9c9c9;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 0 2rem 5rem 2rem;
}
.request-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem; /* Ajustado */
    align-items: center;
}
.request-info-grid span {
    background-color: #ffffff;
    padding: 10px 12px;
    border-radius: 5px;
    word-wrap: break-word;
}
.request-info-grid .correo-solicitud {
    font-size: 0.9rem;
    word-break: break-all;
}
.view-image-bright {
    background-color: var(--color-pendiente);
    color: var(--color-bg);
    font-weight: bold;
}
.view-image-btn {
    text-decoration: none;
    border-radius: 5px;
    padding: 10px 12px;
    font-weight: 600;
    text-align: center;
    transition: transform 0.3s;
}
.view-image-btn:hover {
    transform: scale(1.05);
}
.request-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}
.action-btn {
    flex-grow: 0;
    width: 200px;
    border: none;
    padding: 12px;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 5px;
    cursor: pointer;
    color: white;
}
.action-btn.approve { background-color: var(--color-disponible); }
.action-btn.reject { background-color: var(--color-comprado); }

.historial-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin: 0 2rem 2rem 2rem;
}
.search-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-bottom: 1rem; /* Ajustado */
}
.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
}
.search-form input {
    padding: 12px;
    border: 2px solid #555;
    background-color: #f5f5f5;
    color: var(--color-text);
    border-radius: 5px;
    font-size: 1rem;
}
.download-btn, .download-row-btn {
    background-color: #333;
    color: #ffffff;
    border: 1px solid var(--color-disponible);
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}
.download-btn:hover, .download-row-btn:hover {
    background-color: var(--color-disponible);
    color: var(--color-bg);
}

.history-table-container {
    overflow-x: auto;
    margin: 2rem 2rem 8rem 2rem;
}
.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}
.history-table thead {
    background-color: var(--color-disponible);
    color: var(--color-bg);
}
.history-table th, .history-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #333;
}
.ticket-numbers-cell {
    max-width: 250px;
    word-wrap: break-word;
}
.status-badge {
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-bg);
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
    display: inline-block;
}
.status-badge.pendiente { background-color: var(--color-pendiente); }
.status-badge.comprado { background-color: var(--color-disponible); }
.status-badge.rechazado { background-color: var(--color-comprado); }

/* ==========================================================================
   5. COMPONENTES REUTILIZABLES (POPUP, MODAL, ETC.)
   ========================================================================== */

/* --- 5.1 COMPONENTES POPUP --- */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}
.popup-content {
    background-color: var(--color-dark-grey);
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    border-top: 5px solid var(--color-disponible);
}
.popup-content h3 { margin-top: 0; font-size: 1.5rem; color: #fff; }
.popup-content p { line-height: 1.6; color: #ccc; }
.popup-actions { display: flex; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.popup-button {
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
}
.popup-button.primary { background-color: var(--color-disponible); color: var(--color-bg); }
.popup-button.secondary { background-color: #555; color: var(--color-text); }

/* --- 5.2 NEWSLETTER --- */
#mc_embed_signup { margin-top: 1.5rem; }
#mc_embed_signup_scroll { display: flex; align-items: center; gap: 0.5rem; }
#mc_embed_signup .mc-field-group { flex-grow: 1; }
#mc_embed_signup input.email {
    width: 100%;
    padding: 12px;
    border-radius: 5px;
    border: 2px solid #555;
    background-color: #333;
    color: var(--color-bg);
    box-sizing: border-box;
}
#mc_embed_signup input.email:focus { border-color: var(--color-disponible); outline: none; }
#mc_embed_signup .button {
    background-color: var(--color-disponible);
    color: var(--color-bg);
    border: none;
    padding: 12px 20px;
    border-radius: 5px;
    font-weight: 700;
    cursor: pointer;
}
.message.error {
    background-color: #dc3545;
    color: white;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    text-align: center;
}

/* --- 5.3 MODAL DE IMÁGENES --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
}
.modal-contenido {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 700px;
    animation-name: zoom;
    animation-duration: 0.6s;
}
@keyframes zoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}
.modal-cerrar {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
}
.modal-cerrar:hover,
.modal-cerrar:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* ==========================================================================
   6. MENÚ RESPONSIVO (HAMBURGUESA)
   ========================================================================== */
.hamburger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 101;
}
.hamburger-line {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-text); /* Color blanco para las líneas */
    margin: 5px 0;
}

/* ==========================================================================
   7. RESPONSIVIDAD GENERAL (MEDIA QUERIES)
   ========================================================================== */

/* --- Para Tablets (a partir de 992px hacia abajo) --- */
@media (max-width: 992px) {
    .container { width: 90%; }
    .main-container { max-width: 90%; }
}

/* --- Para Tablets y Móviles (a partir de 768px hacia abajo) --- */
@media (max-width: 768px) {
    /* --- Estilos Generales --- */
    h2 { font-size: 1.5rem; }
    b { font-size: 15px; }
    .main-footer { font-weight: 600; font-size: 14px; }

    /* --- Contenedor Principal --- */
    .container { width: auto; padding: 20px; }
    .main-container { max-width: 100%; padding: 20px; }

    /* --- Encabezado y Navegación --- */
    .main-header { justify-content: space-between; }
    .hamburger-menu {
        display: block;
        background: #fff; /* Fondo blanco */
        border-radius: 100%;
        padding: 0.4rem 0.5rem;
    }
    .hamburger-line {
        background-color: #303030; /* Líneas negras */
    }
    .nav-links {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background-color: #303030;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        z-index: 100;
    }
    .nav-links.active { display: flex; }
    .main-nav ul { flex-direction: column; text-align: center; padding: 0; }
    .main-nav li { margin-bottom: 2rem; }
    .main-nav a { font-size: 1.5rem; }
    .header-cta { margin-top: 2rem; }
    
    /* --- Topbar --- */
    .topbar {
        justify-content: space-around;
        align-items: center;
        padding: 8px 0.5rem;
        gap: 0.5rem;
    }
    .topbar-column { font-size: 0.75rem; text-align: center; }

    /* --- Estructura de Páginas --- */
    .widget-footer { flex-direction: column; text-align: center; }
    .form-grid { grid-template-columns: 1fr; }
    .hero-section { flex-direction: column; margin: 1rem 0; gap: 1rem; }
    .details-grid { flex-direction: column; }
    .instructions-container { flex-direction: column; text-align: left; }

    /* --- Tabla de Transparencia (Tickets Comprados) --- */
    .transparency-table thead { display: none; }
    .transparency-table, .transparency-table tbody, .transparency-table tr, .transparency-table td {
        display: block;
        width: 90%;
        place-self: center;
    }
    .transparency-table tr {
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 5px;
        background-color: #fdfdfd;
        box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    }
    .transparency-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 10px; 
        border-bottom: 1px dashed #eee;
        text-align: right;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    .transparency-table td:last-child { border-bottom: none; }
    .transparency-table td::before {
        content: attr(data-label);
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.85em;
        color: #555;
        text-align: left;
        padding-right: 10px;
    }

    /* --- Panel de Administración --- */
    .request-info-grid { grid-template-columns: 1fr; }
    .historial-controls { flex-direction: column; align-items: stretch; }
    .history-table th:nth-child(3), .history-table td:nth-child(3), /* Apellido */
    .history-table th:nth-child(4), .history-table td:nth-child(4), /* Teléfono */
    .history-table th:nth-child(6), .history-table td:nth-child(6)  /* Método */
    {
        display: none;
    }
}

/* --- Para Móviles Pequeños (a partir de 576px hacia abajo) --- */
@media (max-width: 576px) {
    .container { padding: 1rem; } /* Menos padding en pantallas muy pequeñas */
    .countdown-value { font-size: 2rem; padding: 0.5rem; width: 70px; }
    .countdown-label { font-size: 0.7rem; }
    .payment-methods-images { gap: 0.5rem; }
    .payment-method-img { height: 60px; }
    .modal-contenido { width: 95%; }
}
/* ==========================================================
   ESTILOS PARA NUEVOS CONTROLES DE TICKETS
   ========================================================== */

.ticket-controls {
    display: flex;
    flex-direction: column; /* <-- AÑADIDO: Apila los elementos verticalmente */
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;   /* <-- ESTO LOS CENTRA HORIZONTALMENTE */
    gap: 15px; /* Reducimos el espacio general un poco */
    padding: 20px;
    margin-bottom: 30px;
    background-color: #f0f0f0;
    border-radius: 10px;
}
/* Margen superior para el buscador de tickets */
.search-box {
    margin-top: 30px; /* <-- Tu margen superior solicitado */
}

/* --- Estilos del Buscador --- */
.search-box {
    display: flex;
    align-items: center;
}
#search-ticket-input {
    border: 2px solid #ccc;
    border-right: none;
    padding: 10px 15px;
    border-radius: 20px 0 0 20px;
    font-size: 1rem;
    width: 120px;
    outline: none;
}
#search-ticket-input:focus {
    border-color: var(--color-disponible);
}
.search-button {
    border: 2px solid #ccc;
    background-color: #fff;
    padding: 10px 15px;
    border-radius: 0 20px 20px 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #555;
    transition: all 0.3s;
}
.search-button:hover {
    background-color: var(--color-disponible);
    border-color: var(--color-disponible);
    color: #000;
}

/* --- Estilos de Selección al Azar --- */
.random-select-box {
    display: flex;
    flex-direction: column; /* <-- AÑADIDO: Apila los elementos verticalmente */
    align-items: center;   /* <-- ESTO LOS CENTRA HORIZONTALMENTE */
    gap: 15px;             /* Espacio entre el selector y el botón */
}
.quantity-selector {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: 25px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.quantity-selector button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background-color: #0e41b9;
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}
.quantity-display {
    padding: 0 15px;
    text-align: center;
}
#quantity-number {
    font-size: 1.8rem;
    font-weight: bold;
    display: block;
    line-height: 1;
}
.quantity-display small {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
}
.random-button {
    background-color: transparent;
    border: 2px solid #303030;
    color: #303030;
    padding: 12px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
}
.random-button:hover {
    background-color: #86aaff;
    border-color: var(--color-disponible);
}
/* ==========================================================
   ESTILOS PARA NUEVO PANEL DE RESUMEN DE TICKETS
   ========================================================== */

.ticket-summary-panel {
    background-color: #d5d5d5;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 2rem;
    color: #fff;
    display: flex;
    flex-wrap: wrap; /* Para que los elementos se envuelvan en móvil */
    align-items: center;
    justify-content: space-between;
    gap: 15px; /* Espacio entre los elementos */
}

.ticket-summary-panel .summary-info {
    text-align: center;
    flex-basis: 150px; /* Ancho base para 'Cantidad' y 'Total' */
    flex-grow: 1; /* Permite que crezcan si hay espacio */
    min-width: 120px; /* Evita que se aplaste demasiado */
}

.ticket-summary-panel .summary-info p {
    margin: 0;
    font-size: 0.9em;
    color: #0e41b9;
}

.ticket-summary-panel .summary-info span {
    font-size: 1.8em;
    font-weight: bold;
    color: var(--color-disponible);
    display: block;
}

.selected-tickets-display {
    flex-grow: 3; /* Permite que el área de tickets seleccionados ocupe más espacio */
    min-width: 250px; /* Ancho mínimo para esta sección */
    text-align: left;
}

.selected-tickets-display p {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: #0e41b9;
}

.tickets-pills-container {
    background-color: #b7b7b7;
    border-radius: 8px;
    padding: 10px;
    max-height: 80px; /* Altura máxima para el scroll de tickets */
    overflow-y: auto; /* Scroll vertical si hay muchos tickets */
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* Estilo para los "pills" de tickets seleccionados */
.ticket-pill {
    background-color: var(--color-pendiente); /* Color de pill */
    color: #fff;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap; /* Evita que el número se parta */
}

/* Estilo para el botón "Siguiente" */
.next-button-container {
    text-align: center;
    margin-top: 2rem;
}
.next-button-container .main-button {
    min-width: 250px; /* Ancho mínimo para el botón */
}


/* --- Responsive para el Panel de Resumen --- */
@media (max-width: 768px) {
    .ticket-summary-panel {
        flex-direction: column; /* Apila los elementos en móvil */
        text-align: center;
        padding: 15px;
    }

    .ticket-summary-panel .summary-info,
    .selected-tickets-display {
        flex-basis: auto; /* Restablece el flex-basis */
        width: 100%; /* Ocupa todo el ancho disponible */
        margin-bottom: 10px; /* Espacio entre elementos apilados */
    }

    .tickets-pills-container {
        max-height: 100px; /* Ajusta la altura en móvil si es necesario */
    }
}
/* Estilos para el header del display de tickets y el botón Limpiar */
.display-header {
    display: flex;
    justify-content: space-between; /* Alinea el título a la izquierda y el botón a la derecha */
    align-items: center;
    margin-bottom: 5px;
}

.display-header p {
    margin: 0;
}

.clear-button {
    background: none;
    border: 1px solid #0e41b9;
    color: #0e41b9;
    padding: 3px 10px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.clear-button:hover {
    background-color: #1556ed; /* Naranja */
    color: white;
    border-color: #1556ed;
}
/* Estilo para el temporizador en confirmar-compra.php */
.countdown-timer {
    text-align: center;
    background-color: #e50013; /* Naranja */
    color: white;
    padding: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
/* ==========================================================
   ESTILOS PARA FORMULARIO Y UPLOAD DENTRO DE MÉTODOS DE PAGO
   ========================================================== */

.instructions-content {
    /* Contenedor principal para cada método de pago */
    background-color: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5rem;
    display: none; /* MUY IMPORTANTE: Oculto por defecto */
}

/* Formulario del comprador */
.buyer-form {
    margin-top: 1.5rem;
    border-top: 1px dashed #ccc;
    padding-top: 1.5rem;
}

.buyer-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}
.buyer-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

/* Área para subir archivo */
.upload-area-internal {
    border: 2px dashed var(--color-pendiente);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    border-radius: 8px;
    margin-top: 1.5rem;
    background-color: #fff;
    transition: background-color 0.3s;
}
.upload-area-internal:hover {
    background-color: #fafafa;
}
.upload-area-internal p { margin: 0; font-weight: 600; color: #555; }
.upload-area-internal .file-name-display { font-size: 0.9em; color: #777; font-style: italic; }