﻿/* ============================================================
   themes.css - Sandbox de temas (forest / teal / terracotta)
   Se activa con el query param ?theme=forest|teal|terracotta
   theme-switcher.js agrega [data-palette="..."] en <html>.
   (Se usa data-palette y NO data-theme para no chocar con el
   modo claro/oscuro de las plantillas, que usa data-theme.)
   Sin el parámetro, NO se aplica nada: se conserva la paleta actual.
   ============================================================ */

/* ----- Valores por defecto de las variables auxiliares (RGB) ------
   Permiten recolorear los rgba() hardcodeados de las plantillas.
   El tema "actual" (sin data-theme) usa el rojo vino original. */
:root {
    --theme-primary-rgb: 139, 0, 0;      /* #8B0000 */
    --theme-accent-rgb: 212, 175, 55;    /* #D4AF37 */
    --theme-primary: #8B0000;
    --theme-primary-light: #A4343A;
    --theme-accent: #D4AF37;
    --theme-accent-dark: #C5A028;
    --theme-accent-light: #E5C048;
    --theme-bg: #FFFFFF;
    --theme-surface: #F8F9FA;
    --theme-cream: #FFF5E9;
    --theme-text: #2C1810;
    --theme-text-dark: #1A0F0F;
    --theme-dark-bg: #1A0F0F;
}

/* =====================================================================
   TEMA 1: FOREST  (verde bosque #1C7C54 + Ã¡mbar #F2A900)
   ===================================================================== */
html[data-palette="forest"] {
    --theme-primary: #1C7C54;
    --theme-primary-light: #2E9E6B;
    --theme-accent: #F2A900;
    --theme-accent-dark: #D99200;
    --theme-accent-light: #FFC13B;
    --theme-bg: #FFFFFF;
    --theme-surface: #F6F8F6;
    --theme-cream: #EEF5F0;
    --theme-text: #1F2A24;
    --theme-text-dark: #10241B;
    --theme-dark-bg: #10241B;
    --theme-primary-rgb: 28, 124, 84;
    --theme-accent-rgb: 242, 169, 0;

    /* Sobrescribir tokens base de las plantillas */
    --primary-color: #1C7C54;
    --secondary-color: #F2A900;
    --accent-color: #CDE7D9;
    --gold: #F2A900;
    --burgundy: #1C7C54;
    --burgundy-light: #2E9E6B;
    --bg-color: #FFFFFF;
    --surface-color: #F6F8F6;
    --cream: #EEF5F0;
    --cream-color: #EEF5F0;
    --text-color: #1F2A24;
    --text-light: #5F6B63;
    --text-dark: #10241B;
    --dark-bg: #10241B;
}

/* =====================================================================
   TEMA 2: TEAL  (petrÃ³leo #0F766E + Ã¡mbar #F2A900)
   ===================================================================== */
html[data-palette="teal"] {
    --theme-primary: #0F766E;
    --theme-primary-light: #14958B;
    --theme-accent: #F2A900;
    --theme-accent-dark: #D99200;
    --theme-accent-light: #FFC13B;
    --theme-bg: #FFFFFF;
    --theme-surface: #F2F7F6;
    --theme-cream: #E8F3F1;
    --theme-text: #182B29;
    --theme-text-dark: #0A1F1C;
    --theme-dark-bg: #0A1F1C;
    --theme-primary-rgb: 15, 118, 110;
    --theme-accent-rgb: 242, 169, 0;

    --primary-color: #0F766E;
    --secondary-color: #F2A900;
    --accent-color: #CBE7E3;
    --gold: #F2A900;
    --burgundy: #0F766E;
    --burgundy-light: #14958B;
    --bg-color: #FFFFFF;
    --surface-color: #F2F7F6;
    --cream: #E8F3F1;
    --cream-color: #E8F3F1;
    --text-color: #182B29;
    --text-light: #5A6B69;
    --text-dark: #0A1F1C;
    --dark-bg: #0A1F1C;
}

/* =====================================================================
   TEMA 3: TERRACOTTA  (terracota #B45309 + verde salvia #7C8A5A)
   ===================================================================== */
html[data-palette="terracotta"] {
    --theme-primary: #B45309;
    --theme-primary-light: #D97706;
    --theme-accent: #7C8A5A;
    --theme-accent-dark: #66744A;
    --theme-accent-light: #97A576;
    --theme-bg: #FFFBF5;
    --theme-surface: #F7F1E8;
    --theme-cream: #F3EBDD;
    --theme-text: #2E2419;
    --theme-text-dark: #241A10;
    --theme-dark-bg: #241A10;
    --theme-primary-rgb: 180, 83, 9;
    --theme-accent-rgb: 124, 138, 90;

    --primary-color: #B45309;
    --secondary-color: #7C8A5A;
    --accent-color: #EBD9C4;
    --gold: #7C8A5A;
    --burgundy: #B45309;
    --burgundy-light: #D97706;
    --bg-color: #FFFBF5;
    --surface-color: #F7F1E8;
    --cream: #F3EBDD;
    --cream-color: #F3EBDD;
    --text-color: #2E2419;
    --text-light: #7A6A57;
    --text-dark: #241A10;
    --dark-bg: #241A10;
}

/* =====================================================================
   OVERRIDES de colores hardcodeados en las plantillas
   (rgba(139,0,0,...), rgba(212,175,55,...), #E5C048, #C5A028,
    colores por tipo de negocio, etc.)
   Solo se aplican cuando hay un data-theme activo.
   ===================================================================== */

/* --- Sombras y bordes con el primario (antes rgba(139,0,0,X)) --- */
html[data-palette] .feature-item {
    border-color: rgba(var(--theme-primary-rgb), 0.06);
    box-shadow:
        0 10px 30px rgba(var(--theme-primary-rgb), 0.06),
        inset 0 -3px 0 rgba(var(--theme-primary-rgb), 0.12);
}
html[data-palette] .feature-item:hover {
    border-color: var(--theme-primary);
    box-shadow:
        0 20px 40px rgba(var(--theme-primary-rgb), 0.12),
        inset 0 -4px 0 var(--theme-primary);
}
html[data-palette] .feature-icon {
    background: linear-gradient(45deg, var(--theme-primary), var(--theme-primary-light));
}
html[data-palette] .feature-item:hover .feature-icon {
    background: linear-gradient(45deg, var(--theme-primary-light), var(--theme-accent));
}
html[data-palette] .footer-bottom {
    border-top: 1px solid rgba(var(--theme-primary-rgb), 0.1);
}
html[data-palette] .footer-social a {
    box-shadow: 0 4px 10px rgba(var(--theme-primary-rgb), 0.1);
}
html[data-palette] .footer-social a:hover {
    box-shadow: 0 8px 20px rgba(var(--theme-primary-rgb), 0.2);
}
html[data-palette] .form-control:focus,
html[data-palette] .form-select:focus {
    box-shadow: 0 0 0 0.2rem rgba(var(--theme-primary-rgb), 0.1);
}

/* --- Color del tÃ­tulo del hero por tipo de negocio (todos al primario) --- */
html[data-palette] .hero-title.color-quesos,
html[data-palette] .hero-title.color-vinos,
html[data-palette] .hero-title.color-flores,
html[data-palette] .hero-title.color-avicultura,
html[data-palette] .hero-title.color-porcicultura,
html[data-palette] .hero-title.color-acuicultura {
    color: var(--theme-primary) !important;
    text-shadow: 0 2px 4px rgba(var(--theme-primary-rgb), 0.25), 0 0 30px rgba(255,255,255,0.55) !important;
}

/* --- Radiales del hero con el primario --- */
html[data-palette] .hero-section::after {
    background: radial-gradient(circle at 15% 20%, rgba(255,255,255,0.55) 0, rgba(255,255,255,0) 28%),
                radial-gradient(circle at 82% 18%, rgba(255,255,255,0.38) 0, rgba(255,255,255,0) 24%),
                radial-gradient(circle at 50% 85%, rgba(var(--theme-primary-rgb), 0.08) 0, rgba(var(--theme-primary-rgb), 0) 30%);
}

/* --- PÃ¡gina de producto: botÃ³n volver, gradientes y sombras --- */
html[data-palette] .btn-volver-nav {
    background: linear-gradient(135deg, var(--theme-accent) 0%, var(--theme-accent-dark) 100%);
    box-shadow: 0 4px 15px rgba(var(--theme-accent-rgb), 0.3);
}
html[data-palette] .btn-volver-nav:hover {
    background: linear-gradient(135deg, var(--theme-accent-light) 0%, var(--theme-accent) 100%);
    box-shadow: 0 6px 20px rgba(var(--theme-accent-rgb), 0.4);
}
html[data-palette] .qr-float-btn {
    background: var(--theme-accent);
    box-shadow: 0 10px 30px rgba(var(--theme-accent-rgb), 0.4);
    color: #1A1A1A;
}
html[data-palette] .qr-float-btn:hover {
    background: var(--theme-accent-light);
    box-shadow: 0 15px 40px rgba(var(--theme-accent-rgb), 0.5);
}
html[data-palette] .price-badge {
    background: linear-gradient(135deg, var(--theme-primary) 0%, var(--theme-primary-light) 100%);
    box-shadow: 0 10px 30px rgba(var(--theme-primary-rgb), 0.3);
}
html[data-palette] .hero-image-section {
    background: linear-gradient(135deg, var(--theme-cream) 0%, #fff 100%);
}
html[data-palette] .technical-card {
    box-shadow: 0 10px 25px rgba(var(--theme-primary-rgb), 0.15);
}

/* --- Modo oscuro: ajustar superficies para que el tema respire --- */
body.dark-mode {
    --bg-color: #0F1512;
    --surface-color: #16201C;
    --cream: #16201C;
    --text-color: #E8EFEA;
    --text-light: #A8B4AD;
    --text-dark: #F2F7F4;
}
html[data-palette="teal"] body.dark-mode {
    --bg-color: #0A1413;
    --surface-color: #101D1B;
    --cream: #101D1B;
}
html[data-palette="terracotta"] body.dark-mode {
    --bg-color: #17110B;
    --surface-color: #221910;
    --cream: #221910;
    --text-color: #F2E9DD;
    --text-light: #C4B39E;
    --text-dark: #FBF4EA;
}
