/*
 * ================================================
 * LIQUID GLASS UI V4.0 - SISTEMA COMPLETO CENTRALIZADO
 * ================================================
 */

/* ==========================================================================
   1. CONFIGURACIÓN DE TEMAS (VARIABLES)
   ========================================================================== */

/* --- TEMA 1: GLASS (Por defecto - Lujo / Moda / Vibrante) --- */
:root {
    /* Fondos: DEGRADADO ROSA/MORADO ORIGINAL */
    --bg-body: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%);
    --bg-hero: linear-gradient(135deg, rgba(255, 154, 158, 0.5) 0%, rgba(254, 207, 239, 0.6) 100%);
    
    /* Tarjetas: Más cristalinas para que resalten sobre el color */
    --card-bg: rgba(255, 255, 255, 0.35); /* Más opaco para que se lea */
    --card-hover-bg: rgba(255, 255, 255, 0.55);
    --card-border: 1px solid rgba(255, 255, 255, 0.6);
    
    /* Efectos Visuales */
    --backdrop: blur(15px);
    --shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    --radius: 20px;
    
    /* Tipografía y Colores */
    --font-heading: 'Poppins', sans-serif;
    --text-color: #4a4a4a; /* Gris oscuro suave */
    --text-muted: rgba(0, 0, 0, 0.6);
    --primary-color: #e040fb; /* Morado Vibrante */
    
    /* Nav, Inputs y Tablas */
    --nav-bg: rgba(255, 255, 255, 0.2);
    --input-bg: rgba(255, 255, 255, 0.4);
    --table-header-bg: rgba(255, 255, 255, 0.4);
    --table-border: rgba(255, 255, 255, 0.5);

    /* Footer */
    --bg-footer: linear-gradient(to bottom, #1a1a1a, #000000);
    --footer-text: rgba(255, 255, 255, 0.7);
    --footer-heading: #ffffff;
    --footer-border: 1px solid rgba(255, 255, 255, 0.1);
    /* Variable NUEVA para el menú */
    --nav-text: #ffffff; /* Blanco puro */
}


/* --- TEMA 2: MINIMALISTA (Muebles / Elegante) --- */
body.theme-minimal {
    --bg-body: #ffffff;
    --bg-hero: #f4f4f4; 
    
    --card-bg: #ffffff;
    --card-hover-bg: #fafafa;
    --card-border: 1px solid #e5e5e5;
    
    --backdrop: none;
    --shadow: none;
    --radius: 0px; /* Cuadrado */
    
    --font-heading: 'Playfair Display', serif;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --primary-color: #000000; /* Negro puro */
    
    --nav-bg: #ffffff;
    --input-bg: #f9f9f9;
    --table-header-bg: #f4f4f4;
    --table-border: #e5e5e5;
    /* Footer Minimalista (Claro) */
    --bg-footer: #f9f9f9;
    --footer-text: #666666;
    --footer-heading: #1a1a1a;
    --footer-border: 1px solid #e5e5e5;
    /* Variable NUEVA para el menú */
    --nav-text: #000000; /* Negro puro */
    --nav-bg: rgba(255, 255, 255, 0.9); /* Fondo blanco semitransparente al bajar */
}

/* --- TEMA 3: NEUTRO / TECH (Celulares / Tecnología) --- */
body.theme-neutral {
    --bg-body: #f3f4f6; 
    --bg-hero: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    
    --card-bg: #ffffff;
    --card-hover-bg: #ffffff;
    --card-border: 1px solid #d1d5db;
    
    --backdrop: none;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --radius: 8px; /* Redondeado estándar */
    
    --font-heading: 'Inter', sans-serif;
    --text-color: #111827;
    --text-muted: #4b5563;
    --primary-color: #2563eb; /* Azul Tech */
    
    --nav-bg: #1e293b; 
    --input-bg: #ffffff;
    --table-header-bg: #e2e8f0;
    --table-border: #cbd5e1;
    
    /* Footer Neutro (Oscuro Técnico) */
    --bg-footer: #0f172a;
    --footer-text: #cbd5e1;
    --footer-heading: #ffffff;
    --footer-border: 1px solid #334155;
    /* Variable NUEVA para el menú */
    --nav-text: #ffffff;
}
/* --- TEMA 4: AGRO / CAFÉ (Orgánico / Naturaleza / Tierra) --- */
body.theme-agro {
    /* Fondos: Tonos crema y tierra suave */
    --bg-body: #fdfbf7; 
    --bg-hero: linear-gradient(135deg, #efebe9 0%, #d7ccc8 100%);
    
    /* Tarjetas: Limpias y cálidas */
    --card-bg: #ffffff;
    --card-hover-bg: #fffbf5;
    --card-border: 1px solid #e0e0e0;
    
    /* Efectos */
    --backdrop: none;
    --shadow: 0 4px 12px rgba(93, 64, 55, 0.1);
    --radius: 12px; /* Redondeado suave */
    
    /* Tipografía y Colores */
    --font-heading: 'Merriweather', serif; /* Fuente clásica y elegante */
    --text-color: #3e2723; /* Marrón muy oscuro */
    --text-muted: #6d4c41;
    --primary-color: #2e7d32; /* Verde Bosque (Botones) */
    
    /* Nav & UI */
    --nav-bg: #4e342e; /* Marrón Café */
    --nav-text: #ffffff;
    --input-bg: #ffffff;
    --table-header-bg: #efebe9;
    --table-border: #d7ccc8;
    
    /* Footer */
    --bg-footer: #3e2723;
    --footer-text: #d7ccc8;
    --footer-heading: #ffffff;
    --footer-border: 1px solid #5d4037;
}

/* --- TEMA 5: AUTOMOTRIZ (Industrial / Repuestos / Motos) --- */
body.theme-auto {
    /* Fondos: Gris metálico y asfalto */
    --bg-body: #f3f4f6;
    --bg-hero: linear-gradient(160deg, #111827 0%, #374151 100%);
    
    /* Tarjetas: Estilo técnico/industrial */
    --card-bg: #ffffff;
    --card-hover-bg: #f9fafb;
    --card-border: 1px solid #9ca3af;
    
    /* Efectos: Sombras duras y bordes casi cuadrados */
    --backdrop: none;
    --shadow: 4px 4px 0px rgba(0, 0, 0, 0.2); /* Sombra sólida técnica */
    --radius: 4px; 
    
    /* Tipografía y Colores */
    --font-heading: 'Exo 2', sans-serif; /* Fuente tecnológica/racing */
    --text-color: #111827;
    --text-muted: #4b5563;
    --primary-color: #dc2626; /* Rojo Motor */
    
    /* Nav & UI */
    --nav-bg: #000000; /* Negro Puro */
    --nav-text: #ffffff;
    --input-bg: #e5e7eb;
    --table-header-bg: #d1d5db;
    --table-border: #9ca3af;
    
    /* Footer */
    --bg-footer: #111827;
    --footer-text: #9ca3af;
    --footer-heading: #f3f4f6;
    --footer-border: 1px solid #374151;
}
/* ==========================================================================
   2. ESTILOS BASE Y UTILIDADES
   ========================================================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-body);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Títulos y Enlaces */
h1, h2, h3, h4, h5, h6 { 
    font-family: var(--font-heading);
    color: var(--text-color); 
    font-weight: 700; 
    line-height: 1.2;
    margin-bottom: 1rem;
}
h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

a { color: var(--text-color); text-decoration: none; transition: 0.3s; }
a:hover { opacity: 0.7; }

p, li, span, label { color: var(--text-color); }

/* Corrección forzada para contenedores de texto */
.uk-container p, .uk-container li, .uk-container span {
    color: var(--text-color) !important; 
}

img { max-width: 100%; height: auto; display: block; }

/* ==========================================================================
   3. COMPONENTES PRINCIPALES
   ========================================================================== */

/* --- Navbar --- */
.navbar-glass {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 80px;
    z-index: 1000;
    display: flex; align-items: center;
    border-bottom: var(--card-border);
    background: var(--nav-bg);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    transition: 0.3s;
}

/* Ajuste específico para modo neutro (fondo oscuro) */
body.theme-neutral .navbar-glass a,
body.theme-neutral .navbar-brand {
    color: white !important;
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.5rem; font-weight: 800; text-transform: uppercase;
}

/* --- Hero & Slideshow UIkit Tweaks --- */

/* Ajuste para móviles: Altura del slider */
@media (max-width: 768px) {
    .uk-slideshow-items {
        min-height: 500px !important; 
        height: 60vh !important;
    }
}

/* Redefinición del Glass Content para UIkit */
.hero-glass-content {
    padding: 2rem;
    max-width: 700px;
    width: 90vw; /* Responsive width */
    background: rgba(255, 255, 255, 0.25); /* Un poco más transparente */
    border: 1px solid rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    color: #fff !important; /* Forzar texto blanco en el banner para contraste */
}

/* Forzar colores dentro del glass del hero */
.hero-glass-content h1, 
.hero-glass-content p {
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Placeholder de carga de archivos (Admin) */
.js-upload.uk-placeholder {
    border: 2px dashed #e0e0e0;
    padding: 30px;
    background: #fafafa;
    border-radius: 10px;
    transition: all 0.3s ease;
}
.js-upload.uk-placeholder:hover {
    border-color: var(--primary-color);
    background: #fff;
}
/* --- Tarjetas Universales (Productos, Categorías, Info) --- */
.glass-card, .card-glass, .category-card, .gallery-card {
    background: var(--card-bg);
    border: var(--card-border);
    backdrop-filter: var(--backdrop);
    -webkit-backdrop-filter: var(--backdrop);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: 0.3s;
    overflow: hidden;
}

.glass-card:hover, .card-glass:hover, .gallery-card:hover {
    transform: translateY(-5px);
    background: var(--card-hover-bg);
    border-color: var(--primary-color);
}

/* --- Galería "Apple Style" (Migrado desde index.php) --- */
.apple-gallery-section { padding: 2rem 0; background: transparent; overflow: hidden; }
.gallery-row { margin-bottom: 3rem; padding-left: max(1rem, env(safe-area-inset-left)); }
.gallery-header { 
    display: flex; justify-content: space-between; align-items: baseline; 
    margin-bottom: 1rem; padding-right: 1rem; max-width: 1200px; 
    margin-left: auto; margin-right: auto; 
}
.gallery-title { 
    font-size: 1.5rem; font-weight: 700; margin: 0; color: var(--text-color);
}
.gallery-scroller { 
    display: grid; grid-auto-flow: column; grid-auto-columns: 80%; gap: 1.2rem; 
    overflow-x: auto; overscroll-behavior-inline: contain; padding-bottom: 1.5rem; 
    scrollbar-width: none; 
}
.gallery-scroller::-webkit-scrollbar { display: none; }

.gallery-card { position: relative; height: 420px; padding: 0 !important; }
.gallery-click-area { text-decoration: none; color: inherit; height: 100%; display: flex; flex-direction: column; }
.img-wrapper { flex: 1; overflow: hidden; position: relative; }
.img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.gallery-card:hover .img-wrapper img { transform: scale(1.05); }
.gallery-info { padding: 1.2rem; background: var(--card-bg); z-index: 2; border-top: var(--card-border); }
.gallery-info h3 { 
    font-size: 1.1rem; font-weight: 600; color: var(--text-color); margin: 0;
}

@media (min-width: 768px) { .gallery-scroller { grid-auto-columns: 40%; gap: 1.5rem; } .gallery-card { height: 500px; } }
@media (min-width: 1024px) { .gallery-scroller { grid-auto-columns: 28%; padding-left: calc((100vw - 1200px) / 2); } }

/* --- Tablas (Para el Admin y Frontend) --- */
.table-responsive { overflow-x: auto; }
.table, .uk-table { 
    width: 100%; border-collapse: collapse; margin-bottom: 1rem; 
    color: var(--text-color);
}
.table th, .table td, .uk-table th, .uk-table td {
    padding: 1rem; vertical-align: middle; 
    border-top: 1px solid var(--table-border);
    color: var(--text-color);
}
.table thead th, .uk-table thead th {
    vertical-align: bottom; border-bottom: 2px solid var(--table-border);
    background-color: var(--table-header-bg);
    color: var(--text-color); font-weight: bold; text-transform: uppercase; font-size: 0.85rem;
}
/* Arreglo para Admin Dashboard */
#content-wrapper .table { color: #5a5c69 !important; } 

/* --- Botones --- */
.btn-glass-lg, .uk-button-primary, .uk-button-secondary {
    background: var(--primary-color);
    color: #fff !important; 
    border-radius: var(--radius);
    padding: 12px 30px;
    border: none; font-weight: bold;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer; transition: 0.3s;
    text-transform: uppercase; font-size: 0.9rem; display: inline-block;
}
.btn-glass-lg:hover, .uk-button-primary:hover {
    opacity: 0.9; transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* --- Botón Whatsapp Glow --- */
.btn-whatsapp-glow { 
    box-shadow: 0 0 20px rgba(37, 211, 102, 0.4); 
    animation: pulseGreen 2s infinite; 
    background-color: #25D366 !important;
}
@keyframes pulseGreen { 
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7); } 
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); } 
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); } 
}

/* --- Formularios --- */
.form-input, .uk-input, .uk-select, .uk-textarea, .glass-input-white {
    width: 100%; padding: 12px 15px;
    border: var(--card-border) !important;
    border-radius: var(--radius) !important;
    background: var(--input-bg) !important;
    color: var(--text-color) !important;
    font-size: 1rem; transition: all 0.2s;
}
.form-input:focus, .uk-input:focus {
    outline: none; border-color: var(--primary-color) !important;
    background: #fff !important; color: #333 !important;
}

/* --- Ajustes Móviles --- */
@media (max-width: 768px) {
    .hero-slider-container { padding-top: 0; height: 60vh; }
    h1 { font-size: 2rem; }
    .gallery-card { height: 350px; }
}

/* --- ARREGLO DE CATEGORÍAS --- */
.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 180px; /* Altura mínima para que se vean uniformes */
    padding: 2rem !important;
}

.category-icon {
    margin-bottom: 1rem;
    color: var(--primary-color); /* Icono color morado/tema */
    transition: transform 0.3s ease;
}

.category-name {
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 1rem;
    color: var(--text-color);
}

/* Efecto Hover bonito */
.category-card:hover .category-icon {
    transform: scale(1.2) rotate(-5deg);
}

/* Línea decorativa al hacer hover */
.hover-line {
    width: 0;
    height: 3px;
    background: var(--primary-color);
    margin-top: 10px;
    transition: width 0.3s;
}
.category-card:hover .hover-line {
    width: 40px;
}

/* --- Footer --- */
.site-footer {
    background: var(--bg-footer);
    color: var(--footer-text);
    padding: 60px 0 30px;
    margin-top: 50px;
    border-top: var(--footer-border);
}
.site-footer h4, .site-footer h5 {
    color: var(--footer-heading);
}
.footer-link {
    color: var(--footer-text);
    text-decoration: none;
    transition: 0.3s;
}
.footer-link:hover {
    color: var(--primary-color);
    padding-left: 5px;
}