/* ============================================
   BASE - MAREA SECA
   Reset + variables + tipografía
   ============================================ */

/* ============================================
   FUENTES
   ============================================ */
@font-face {
    font-family: 'Fraunces';
    src: url('../assets/fonts/Fraunces-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('../assets/fonts/Fraunces-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Fraunces';
    src: url('../assets/fonts/Fraunces-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('../assets/fonts/WorkSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('../assets/fonts/WorkSans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Work Sans';
    src: url('../assets/fonts/WorkSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   VARIABLES
   ============================================ */
:root {
    /* Colores del negocio (del JSON) */
    --primario: #1F4E5F;
    --secundario: #C97B4A;
    --fondo: #F4EFE6;
    --texto: #22201C;

    /* Variaciones */
    --primario-oscuro: #163A47;
    --primario-claro: #2E6B7E;
    --secundario-oscuro: #A86238;
    --secundario-claro: #E0A47E;
    --texto-suave: #5A554D;
    --texto-tenue: #8A847A;
    --blanco: #FFFFFF;
    --crema: #FAF6EF;
    --arena: #EDE5D8;
    --borde: #DDD4C4;
    --borde-fuerte: #C9BFAE;
    --exito: #3E8E5A;
    --error: #B84A3A;
    --aviso: #D9A23B;

    /* Tipografía */
    --fuente-titulos: 'Fraunces', Georgia, 'Times New Roman', serif;
    --fuente-cuerpo: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    /* Espaciado */
    --esp-1: 4px;
    --esp-2: 8px;
    --esp-3: 12px;
    --esp-4: 16px;
    --esp-5: 20px;
    --esp-6: 24px;
    --esp-8: 32px;
    --esp-10: 40px;
    --esp-12: 48px;
    --esp-16: 64px;
    --esp-20: 80px;
    --esp-24: 96px;

    /* Radios (artesanal, sutil) */
    --radio-sm: 2px;
    --radio-md: 4px;
    --radio-lg: 8px;
    --radio-full: 999px;

    /* Sombras (naturales, suaves) */
    --sombra-sm: 0 1px 4px rgba(34, 32, 28, 0.06);
    --sombra-md: 0 4px 16px rgba(34, 32, 28, 0.08);
    --sombra-lg: 0 8px 32px rgba(34, 32, 28, 0.12);

    /* Transiciones */
    --transicion: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    --transicion-lenta: 0.6s cubic-bezier(0.16, 1, 0.3, 1);

    /* Ancho máximo */
    --max-ancho: 1280px;
    --max-ancho-texto: 760px;
}

/* ============================================
   RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--fuente-cuerpo);
    background: var(--fondo);
    color: var(--texto);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--fuente-titulos);
    font-weight: 700;
    line-height: 1.15;
    color: var(--texto);
    letter-spacing: -0.01em;
}

p {
    margin-bottom: var(--esp-4);
}

a {
    color: var(--primario);
    text-decoration: none;
    transition: color var(--transicion);
}

a:hover {
    color: var(--secundario);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    color: inherit;
}

ul, ol {
    list-style: none;
}

/* ============================================
   CONTENEDOR
   ============================================ */
#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.contenedor {
    width: 100%;
    max-width: var(--max-ancho);
    margin: 0 auto;
    padding: 0 var(--esp-6);
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--arena);
}

::-webkit-scrollbar-thumb {
    background: var(--secundario);
    border-radius: var(--radio-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primario);
}

/* ============================================
   SELECCIÓN
   ============================================ */
::selection {
    background: var(--secundario);
    color: var(--blanco);
}

/* ============================================
   UTILIDADES
   ============================================ */
.oculto {
    display: none !important;
}

.texto-centro {
    text-align: center;
}

/* ============================================
   EVITAR SELECCIÓN DE TEXTO EN INTERACTIVOS
   ============================================ */
button,
a,
.btn,
.producto-card,
.categoria-card,
.filtro,
.header-nav-link,
.header-menu-btn,
.header-cta,
.header-logo,
.header-menu-movil-link,
.header-menu-movil-cta {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================
   RESPETO POR PREFERS-REDUCED-MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   AVISO DE PROYECTO FICTICIO
   ============================================ */
.aviso-ficticio {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--esp-4);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.aviso-ficticio-visible {
    opacity: 1;
}

.aviso-ficticio-overlay {
    position: absolute;
    inset: 0;
    background: rgba(34, 32, 28, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.aviso-ficticio-card {
    position: relative;
    z-index: 1;
    max-width: 480px;
    width: 100%;
    padding: var(--esp-8) var(--esp-6);
    background: var(--crema);
    border: 1px solid var(--borde);
    border-radius: var(--radio-lg);
    box-shadow: 0 24px 64px rgba(34, 32, 28, 0.25);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--esp-3);
    transform: scale(0.95) translateY(20px);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.aviso-ficticio-visible .aviso-ficticio-card {
    transform: scale(1) translateY(0);
}

.aviso-ficticio-icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--secundario);
    color: var(--blanco);
    font-family: var(--fuente-titulos);
    font-size: 28px;
    font-weight: 700;
    border-radius: 50%;
    line-height: 1;
    margin-bottom: var(--esp-2);
}

.aviso-ficticio-titulo {
    font-family: var(--fuente-titulos);
    font-size: 24px;
    font-weight: 700;
    color: var(--primario);
    margin: 0;
}

.aviso-ficticio-texto {
    font-family: var(--fuente-cuerpo);
    font-size: 14px;
    line-height: 1.6;
    color: var(--texto-suave);
    margin: 0;
}

.aviso-ficticio-texto strong {
    color: var(--primario);
    font-weight: 600;
}

.aviso-ficticio-texto-pequeno {
    font-size: 12px;
    color: var(--texto-tenue);
    font-style: italic;
}

.aviso-ficticio-btn {
    margin-top: var(--esp-4);
    width: 100%;
    max-width: 280px;
}

@media (max-width: 600px) {
    .aviso-ficticio-card {
        padding: var(--esp-6) var(--esp-5);
    }

    .aviso-ficticio-titulo {
        font-size: 20px;
    }

    .aviso-ficticio-icono {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
}

/* ============================================
   ANIMACIONES LIGERAS
   ============================================ */

/* Entrada de página (fade-in suave) */
body.pagina-entrando {
    opacity: 0;
}

body.pagina-entrada {
    opacity: 1;
    transition: opacity 0.4s ease;
}

/* Keyframes base */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(32px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.94);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Clases de animación */
.animar {
    opacity: 0;
}

.animar.visible {
    animation: fadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animar-izq {
    opacity: 0;
}

.animar-izq.visible {
    animation: slideInLeft 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animar-der {
    opacity: 0;
}

.animar-der.visible {
    animation: slideInRight 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animar-escala {
    opacity: 0;
}

.animar-escala.visible {
    animation: scaleIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Retrasos escalonados para grids */
.productos-grid > .animar:nth-child(1),
.categorias-grid > .animar:nth-child(1),
.testimonios-grid > .animar:nth-child(1),
.sobre-equipo-grid > .animar:nth-child(1),
.sobre-valores-grid > .animar:nth-child(1) {
    animation-delay: 0.05s;
}

.productos-grid > .animar:nth-child(2),
.categorias-grid > .animar:nth-child(2),
.testimonios-grid > .animar:nth-child(2),
.sobre-equipo-grid > .animar:nth-child(2),
.sobre-valores-grid > .animar:nth-child(2) {
    animation-delay: 0.12s;
}

.productos-grid > .animar:nth-child(3),
.categorias-grid > .animar:nth-child(3),
.testimonios-grid > .animar:nth-child(3),
.sobre-equipo-grid > .animar:nth-child(3),
.sobre-valores-grid > .animar:nth-child(3) {
    animation-delay: 0.19s;
}

.productos-grid > .animar:nth-child(4),
.categorias-grid > .animar:nth-child(4) {
    animation-delay: 0.26s;
}

/* Hero: animación al cargar */
.hero-texto {
    animation: fadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.hero-visual {
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.1s forwards;
    opacity: 0;
}

/* Respeto por prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .animar,
    .animar-izq,
    .animar-der,
    .animar-escala,
    .hero-texto,
    .hero-visual {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
}

/* Micro-interacciones: botones con presión */
.btn:active {
    transform: translateY(0) scale(0.98);
    transition: transform 0.1s ease;
}

/* Cards con hover suave */
.producto-card,
.categoria-card,
.testimonio-card,
.sobre-equipo-card,
.sobre-valor {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}