/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #e74c3c;
    --secondary-color: #c0392b;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --text-color: #2c3e50;
    --light-bg: #ecf0f1;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f39c12 0%, #e74c3c 100%);
    min-height: 100vh;
    color: var(--text-color);
}

/* Container Principal */
.container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Login y Registro */
.main-box,
.login-box,
.register-box {
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    padding: 40px;
    width: 100%;
    max-width: 550px;
}

.register-box {
    max-width: 550px;
}

.main-box {
    max-width: 700px;
}

.logo {
    text-align: center;
    margin-bottom: 30px;
}

.logo-img {
    max-width: 250px;
    width: 100%;
    height: auto;
    margin-bottom: 15px;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 2.5em;
    margin-bottom: 10px;
}

.logo p {
    color: #7f8c8d;
    font-size: 1.1em;
    margin-top: 10px;
}

/* Texto de Bienvenida */
.welcome-text {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-text h2 {
    color: var(--text-color);
    font-size: 1.5em;
    margin-bottom: 10px;
}

.welcome-text p {
    color: #7f8c8d;
    font-size: 1em;
}

/* Sección de Información */
.info-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid var(--light-bg);
}

.info-section h3 {
    text-align: center;
    color: var(--text-color);
    margin-bottom: 25px;
    font-size: 1.3em;
}

/* Grid de Beneficios */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.benefit-card {
    text-align: center;
    padding: 20px;
    background: var(--light-bg);
    border-radius: 8px;
    transition: transform 0.3s;
}

.benefit-card:hover {
    transform: translateY(-5px);
}

.benefit-icon {
    font-size: 3em;
    margin-bottom: 15px;
}

.benefit-card h4 {
    color: var(--text-color);
    margin-bottom: 10px;
    font-size: 1.1em;
}

.benefit-card p {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Botones */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-primary:hover {
    background: var(--secondary-color);
}

.btn-logout {
    padding: 8px 20px;
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-logout:hover {
    background: var(--primary-color);
    color: var(--white);
}


/* Footer del Formulario */
.form-footer {
    text-align: center;
    margin-top: 20px;
}

.form-footer p {
    color: #7f8c8d;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Mensajes de Error y Éxito */
.error-message,
.success-message {
    padding: 12px;
    border-radius: 5px;
    margin-top: 15px;
    text-align: center;
}

.error-message {
    background: #fadbd8;
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.success-message {
    background: #d4edda;
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

/* Header del Dashboard */
.header {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    height: 80px;
    width: auto;
}

.header h1 {
    color: var(--primary-color);
    font-size: 1.8em;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info span {
    font-weight: 600;
    color: var(--text-color);
}

/* Dashboard */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

.points-summary {
    margin-bottom: 30px;
}

.points-card {
    background: var(--white);
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    box-shadow: var(--shadow);
}

.points-card h2 {
    color: var(--text-color);
    margin-bottom: 20px;
}

.points-display {
    font-size: 4em;
    font-weight: bold;
    color: var(--primary-color);
    margin: 20px 0;
}

.points-info {
    color: #7f8c8d;
    font-size: 0.9em;
}

/* Grid de Contenido */
.content-grid {
    display: grid;
    gap: 30px;
}

.section {
    background: var(--white);
    border-radius: 10px;
    padding: 25px;
    box-shadow: var(--shadow);
}

.section h3 {
    color: var(--text-color);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--light-bg);
}

/* Info de Canje */
.info-canje {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.info-canje p {
    margin: 0;
    color: #856404;
    font-weight: 600;
    font-size: 1em;
}

.seccion-info {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 15px;
    font-style: italic;
}

/* Tablas */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: var(--light-bg);
}

table th,
table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

table th {
    font-weight: 600;
    color: var(--text-color);
}

table tbody tr:hover {
    background: #f8f9fa;
}

.loading {
    text-align: center;
    color: #7f8c8d;
    padding: 20px;
}

/* Grid de Premios */
.premios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.premio-card {
    background: var(--light-bg);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.premio-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.premio-card h4 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.premio-card .puntos-requeridos {
    font-size: 1.5em;
    color: var(--primary-color);
    font-weight: bold;
    margin: 15px 0;
}

.premio-card .descripcion {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* Estado de Canjes */
.estado {
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    font-weight: 600;
}

.estado.pendiente {
    background: #fff3cd;
    color: #856404;
}

.estado.completado {
    background: #d4edda;
    color: #155724;
}

.estado.entregado {
    background: #d1ecf1;
    color: #0c5460;
}

/* Selector Tipo de Cliente */
.tipo-cliente-selector {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.tipo-option {
    flex: 1;
    cursor: pointer;
}

.tipo-option input[type="radio"] {
    display: none;
}

.tipo-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    transition: all 0.3s;
    background: var(--light-bg);
}

.tipo-option:hover .tipo-content {
    border-color: var(--primary-color);
}

.tipo-option.selected .tipo-content {
    border-color: var(--primary-color);
    background: #fef5f5;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.tipo-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.tipo-label {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1.1em;
}

.tipo-desc {
    font-size: 0.85em;
    color: #7f8c8d;
    margin-top: 5px;
}

/* Badge Tipo de Cliente */
.badge-tipo-cliente {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-left: 10px;
}

.badge-tipo-cliente.natural {
    background: #e3f2fd;
    color: #1976d2;
}

.badge-tipo-cliente.empresa {
    background: #fff3e0;
    color: #f57c00;
}

.user-details {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Badge Tipo de Premio */
.badge-tipo-premio {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.badge-tipo-premio.canje {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-tipo-premio.descuento {
    background: #fce4ec;
    color: #c2185b;
}

.badge-tipo-premio-mini {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.7em;
    font-weight: 700;
}

.badge-tipo-premio-mini.canje {
    background: #e8f5e9;
    color: #2e7d32;
}

.badge-tipo-premio-mini.descuento {
    background: #fce4ec;
    color: #c2185b;
}

/* Tipo de Entrega */
.tipo-entrega {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 600;
}

.tipo-entrega.presencial {
    background: #e3f2fd;
    color: #1565c0;
}

.tipo-entrega.delivery {
    background: #fff8e1;
    color: #ff8f00;
}

.tipo-entrega.na {
    background: #f5f5f5;
    color: #757575;
}

.premio-entrega {
    font-size: 0.8em;
    color: #7f8c8d;
    margin-top: 10px;
    font-style: italic;
}

/* Info Validación Factura */
.info-validacion {
    background: #e8f5e9;
    border: 1px solid #4caf50;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
}

.info-validacion p {
    margin: 0;
    color: #2e7d32;
    font-size: 0.9em;
    text-align: center;
}

/* Estado Factura */
.estado-factura {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

.estado-factura.verificada {
    background: #e8f5e9;
    color: #2e7d32;
}

.estado-factura.duplicada {
    background: #ffebee;
    color: #c62828;
}

/* Grid de Sucursales */
.sucursales-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.sucursal-card {
    background: var(--light-bg);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.sucursal-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.sucursal-icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.sucursal-card h4 {
    color: var(--text-color);
    font-size: 1.2em;
    margin-bottom: 15px;
}

.sucursal-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sucursal-telefono {
    font-size: 1.1em;
    margin: 0;
}

.sucursal-telefono a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.sucursal-telefono a:hover {
    text-decoration: underline;
}

.sucursal-direccion {
    color: #7f8c8d;
    font-size: 0.95em;
    margin: 5px 0;
}

.btn-maps {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 20px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.3s;
}

.btn-maps:hover {
    background: #3367d6;
    transform: scale(1.05);
}

/* ========================================
   RESPONSIVE - Mobile First
   ======================================== */

/* Tablets y pantallas medianas */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    .main-box,
    .register-box {
        padding: 25px 20px;
    }

    .logo-img {
        max-width: 180px;
    }

    .welcome-text h2 {
        font-size: 1.3em;
    }

    .header-logo {
        height: 60px;
    }

    .header-content {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .user-info {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .user-details {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .badge-tipo-cliente {
        margin-left: 0;
    }

    .btn-logout {
        width: 100%;
    }

    .dashboard {
        padding: 20px 15px;
    }

    .points-card {
        padding: 20px;
    }

    .points-card h2 {
        font-size: 1.1em;
    }

    .points-display {
        font-size: 3em;
    }

    .section {
        padding: 20px 15px;
    }

    .section h3 {
        font-size: 1.1em;
    }

    .premios-grid {
        grid-template-columns: 1fr;
    }

    .premio-card {
        padding: 18px;
    }

    .benefits-grid {
        grid-template-columns: 1fr;
    }

    .tipo-cliente-selector {
        flex-direction: column;
    }

    .tipo-content {
        padding: 15px;
    }

    .tipo-icon {
        font-size: 2em;
    }

    .sucursales-grid {
        grid-template-columns: 1fr;
    }

    /* Tabla responsiva - cards en móvil */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    table td {
        padding: 10px 8px;
        font-size: 0.85em;
    }

    .info-canje p {
        font-size: 0.9em;
    }
}

/* Móviles pequeños */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .main-box,
    .register-box {
        padding: 20px 15px;
        border-radius: 8px;
    }

    .logo-img {
        max-width: 150px;
    }

    .welcome-text h2 {
        font-size: 1.1em;
    }

    .welcome-text p {
        font-size: 0.9em;
    }

    .form-group input {
        padding: 10px 12px;
        font-size: 16px; /* Previene zoom en iOS */
    }

    .btn-primary {
        padding: 14px;
        font-size: 1em;
    }

    .header-logo {
        height: 50px;
    }

    .points-display {
        font-size: 2.5em;
    }

    .points-info {
        font-size: 0.85em;
    }

    .premio-card .puntos-requeridos {
        font-size: 1.3em;
    }

    .premio-card .descripcion {
        font-size: 0.85em;
    }

    .sucursal-card {
        padding: 20px;
    }

    .sucursal-card h4 {
        font-size: 1.1em;
    }

    .btn-maps {
        width: 100%;
        padding: 12px;
    }

    /* Ocultar algunas columnas en móvil muy pequeño */
    .hide-mobile {
        display: none;
    }
}

/* ========================================
   SECCIONES INDEX - Sucursales y Redes
   ======================================== */

.section-subtitle {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.95em;
    margin-bottom: 20px;
}

/* Sucursales mejoradas para index */
.sucursales-section {
    background: linear-gradient(135deg, #fff9f9 0%, #fff 100%);
    border-radius: 12px;
    padding: 30px 20px;
    margin-top: 30px;
}

.sucursal-card .sucursal-nombre {
    font-weight: 700;
    font-size: 1.1em;
    color: var(--text-color);
    margin-bottom: 8px;
}

.sucursal-card .sucursal-direccion {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 12px;
}

.sucursal-card .sucursal-telefono {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.05em;
    text-decoration: none;
    margin-bottom: 15px;
}

.sucursal-card .sucursal-telefono:hover {
    text-decoration: underline;
}

.btn-ver-mapa {
    display: inline-block;
    padding: 10px 20px;
    background: #4285f4;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.85em;
    transition: all 0.3s;
}

.btn-ver-mapa:hover {
    background: #3367d6;
    transform: scale(1.05);
}

/* ========================================
   REDES SOCIALES
   ======================================== */
.redes-section {
    text-align: center;
}

.redes-grid {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.red-social {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: all 0.3s ease;
}

.red-social:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.red-social.facebook {
    background: #1877f2;
    color: white;
}

.red-social.instagram {
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: white;
}

.red-social.whatsapp {
    background: #25d366;
    color: white;
}

.red-icono {
    font-size: 1.2em;
    font-weight: 700;
}

.red-nombre {
    font-size: 0.9em;
}

/* ========================================
   FOOTER MINI
   ======================================== */
.footer-mini {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    border-top: 1px solid var(--light-bg);
}

.footer-mini p {
    color: #7f8c8d;
    font-size: 0.85em;
    margin: 0;
}

/* Responsive para nuevas secciones */
@media (max-width: 768px) {
    .redes-grid {
        flex-direction: column;
        align-items: center;
    }

    .red-social {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
}

