/* style.css - ECOSMART V2.0 Visual Core (unificado con estilos de index.html) */

:root {
    /* Variables originales de style.css */
    --primary-green: #2d5a27;
    --eco-light: #f0f7f0;
    --accent-blue: #1a4f8b;
    --text-dark: #333;
    --glass-bg: rgba(255, 255, 255, 0.8);

    /* Variables de index.html */
    --primary: #2d5a27;
    --secondary: #1a4f8b;
    --bg: #f8faf9;
    --white: #ffffff;
    --text: #334155;
    --accent: #d4ac0d;
    --dark: #1a3317;
    --light: #f4f7f6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Estilos base (globales) */
body {
    background-color: var(--eco-light);
    color: var(--text-dark);
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header con efecto cristal (Glassmorphism) */
header {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--primary-green);
    padding: 1rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

/* Tarjetas de productos modernas */
.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}

/* --- 1. ESTILO BASE (ESCRITORIO) --- */
.mobile-nav, .mobile-menu-panel { 
    display: none; /* Oculto en PC por defecto */
}

/* --- 2. RESPONSIVE DESIGN (APP MÓVIL) --- */
@media (max-width: 768px) {
    .logo img {
        height: 35px;
    }
    /* Ajustes de Estructura */
    .sidebar { display: none !important; }
    
    .main-content { 
        margin-left: 0 !important; 
        padding: 15px !important; 
        padding-bottom: 80px !important; /* Ajuste */
        width: 100%;
        box-sizing: border-box;
    }

    .card-form {
        width: 100% !important;
        padding: 20px !important;
        border-radius: 15px !important;
    }

    .grid-2x2 { grid-template-columns: 1fr !important; gap: 10px; }

    /* Tab Bar Inferior */
    .mobile-nav {
        display: flex !important;
        position: fixed;
        bottom: 0; left: 0;
        width: 100%;
        height: 70px;
        background: var(--dark);
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -5px 15px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    .mobile-link {
        flex: 1;
        color: #bdc3c7;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.65rem;
        gap: 4px;
    }

    .mobile-link i { font-size: 1.3rem; }
    .mobile-link.active { color: #4caf50; }
    
    /* Botón Especial de Recarga */
    .mobile-link.special-btn {
        background: var(--accent);
        color: var(--dark);
        border-radius: 50%;
        width: 60px;
        height: 60px;
        margin-top: -20px; /* Ajustado para no solaparse tanto */
        border: 5px solid var(--light);
        justify-content: center;
        flex: none;
    }

    /* --- 3. PANEL DE MENÚ "SÁBANA" (NUEVO) --- */
    .mobile-menu-panel {
        display: block !important;
        position: fixed;
        bottom: -100%; /* Inicia oculto abajo */
        left: 0;
        width: 100%;
        background: #112210;
        transition: cubic-bezier(0.4, 0, 0.2, 1) 0.4s;
        z-index: 2000;
        border-radius: 25px 25px 0 0;
        padding: 25px;
        box-sizing: border-box;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
    }

    .mobile-menu-panel.open { bottom: 0; }

    .menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        color: white;
        margin-bottom: 20px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        padding-bottom: 10px;
    }

    .menu-header button {
        background: none; border: none; color: white; font-size: 2rem; cursor: pointer;
    }

    .menu-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .menu-grid a {
        background: rgba(255,255,255,0.08);
        color: white;
        padding: 20px;
        border-radius: 15px;
        text-align: center;
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        font-size: 0.8rem;
    }

    .menu-grid a i { font-size: 1.6rem; color: #4caf50; }
}

.btn-secondary {
    background: var(--secondary);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-secondary:hover {
    background: #0d3a6b;
}

/* Animación para el logo */
.logo-animado {
    animation: fadeInScale 1.8s ease-in-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.logo-animado:hover {
    filter: drop-shadow(0 0 8px rgba(45, 90, 39, 0.5));
    transition: filter 0.3s ease;
}

/* ==========================================
   ESTILOS ESPECÍFICOS PARA INDEX (PÁGINA DE LOGIN)
   (antes estaban en la etiqueta <style> de index.html)
   ========================================== */

/* Para evitar conflictos con otras páginas, los estilos del body se aplican solo si el body tiene la clase .index-page */
.index-page {
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* --- HEADER CORPORATIVO (index) --- */
.main-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid #e2e8f0;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
}

.contact-link {
    text-decoration: none;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.3s;
}
.contact-link:hover { color: var(--primary); }

/* --- LOGIN CARD --- */
.login-section {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.login-card {
    background: var(--white);
    padding: 30px;
    border-radius: 24px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 5px;
    color: #1e293b;
}
.login-card p {
    color: #64748b;
    font-size: 0.9rem;
    margin-bottom: 15px;
}

input {
    width: 100%;
    padding: 15px;
    margin-bottom: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 1rem;
    transition: 0.3s;
    text-align: center;
}
input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(45,90,39,0.1);
}

.btn-login {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-login:hover {
    background: #1e3d1a;
    transform: translateY(-2px);
}

/* --- FOOTER PROFESIONAL (index) --- */
.main-footer {
    background: var(--white);
    padding: 40px 20px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-col h4 {
    color: var(--primary);
    margin-bottom: 15px;
}
.footer-col p {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.5;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}
.social-links a {
    font-size: 1.4rem;
    color: #64748b;
    transition: 0.3s;
}
.social-links a:hover {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.75rem;
    color: #94a3b8;
}

/* --- MODAL GENERAL (index) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

.modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    flex-shrink: 0;
}

.modal-content .terms-scroll {
    overflow-y: auto;
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #f9f9f9;
    text-align: left;
}

.modal-content .buttons {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.close {
    float: right;
    cursor: pointer;
    font-size: 1.5rem;
    color: #999;
}
.close:hover {
    color: #333;
}

/* --- BANNER PWA (index) --- */
#install-banner {
    display: none;
    background: var(--accent);
    padding: 15px;
    text-align: center;
    font-weight: bold;
    color: var(--dark);
    border-radius: 8px;
    margin-bottom: 20px;
}
#install-banner a {
    color: var(--dark);
    text-decoration: underline;
    display: inline-block;
    margin-right: 10px;
}
#install-banner a:hover {
    text-decoration: none;
}
#install-banner button {
    margin-left: 10px;
    padding: 5px 15px;
    border-radius: 10px;
    border: 2px solid var(--dark);
    background: var(--dark);
    color: white;
    font-weight: bold;
    cursor: pointer;
}

/* --- BOTÓN WHATSAPP (index) --- */
.whatsapp-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #25D366;
    color: white;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
    border: none;
    cursor: pointer;
}
.whatsapp-button:hover {
    background-color: #128C7E;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}
.whatsapp-button i {
    font-size: 1.5rem;
}

/* --- NOTIFICACIONES TOAST (index) --- */
#notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}
.notification {
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 450px;
    animation: slideIn 0.3s ease forwards;
    border-left: 5px solid transparent;
    font-weight: 500;
}
.notification.error {
    border-left-color: #dc3545;
    background-color: #fff5f5;
}
.notification.success {
    border-left-color: #28a745;
    background-color: #f0fff4;
}
.notification.info {
    border-left-color: #17a2b8;
    background-color: #e3f2fd;
}
.notification i {
    font-size: 1.5rem;
}
.notification.error i { color: #dc3545; }
.notification.success i { color: #28a745; }
.notification.info i { color: #17a2b8; }
.notification .message {
    flex: 1;
    color: #333;
}
.notification .close-btn {
    cursor: pointer;
    color: #999;
    font-size: 1.2rem;
    margin-left: auto;
}
.notification .close-btn:hover {
    color: #333;
}
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
@keyframes fadeOut {
    to { opacity: 0; transform: translateX(100%); }
}

/* Responsive (index) */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        gap: 10px;
    }
    .whatsapp-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .whatsapp-button i {
        font-size: 1.2rem;
    }
}