/**
 * BOSSA GRILL — Custom CSS & Design System Tokens
 * 
 * Sistema de diseño oficial, variables CSS, animaciones, utilidades
 * de glassmorphism, tipografía e interacciones.
 * 
 * @package BossaGrill
 * @version 1.0.0
 */

/* ==========================================================================
   1. VARIABLES CSS (TOKENS DEL DESIGN SYSTEM)
   ========================================================================== */
:root {
    /* --- Paleta Core (HEX) --- */
    --color-primary: #1C1A17;        /* Carbón Profundo */
    --color-secondary: #8B5E3C;      /* Cuero Tostado */
    --color-accent: #C9A84C;         /* Dorado Antiguo */
    --bg-light: #F5F0E8;             /* Marfil Cálido */
    --bg-dark: #141210;              /* Ébano Cálido */
    --color-button: #8B1A1A;         /* Rojo Carmesí */
    --color-cta: #C9A84C;            /* Dorado Antiguo (CTA) */
    --color-hover: #B87333;          /* Ámbar Cobre */
    --text-primary: #F5F0E8;         /* Marfil */
    --text-secondary: #9E9285;       /* Gris Arena */
    --text-dark: #2C2724;            /* Grafito Oscuro */

    /* --- Tokens Semánticos --- */
    --border-subtle: #2C2724;
    --border-gold: rgba(201, 168, 76, 0.30);
    --border-gold-strong: #C9A84C;
    --border-light: #D4CFC5;

    /* --- Overlays & Glassmorphism --- */
    --overlay-dark: rgba(20, 18, 16, 0.85);
    --overlay-medium: rgba(20, 18, 16, 0.60);
    --overlay-light: rgba(20, 18, 16, 0.30);
    --overlay-glass: rgba(28, 26, 23, 0.80);
    --glass-border: rgba(201, 168, 76, 0.15);

    /* --- Sombras Cálidas --- */
    --shadow-sm: 0 2px 8px rgba(20, 18, 16, 0.30);
    --shadow-md: 0 4px 16px rgba(20, 18, 16, 0.40);
    --shadow-lg: 0 8px 32px rgba(20, 18, 16, 0.60);
    --shadow-warm: 0 8px 32px rgba(201, 168, 76, 0.12);
    --shadow-warm-lg: 0 12px 48px rgba(201, 168, 76, 0.18);
    --shadow-float: 0 16px 64px rgba(20, 18, 16, 0.50);

    /* --- Tipografías --- */
    --font-heading: 'Playfair Display', Georgia, serif;
    --font-quote: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;

    /* --- Transiciones --- */
    --transition-fast: 200ms ease-in-out;
    --transition-normal: 300ms ease-in-out;
    --transition-slow: 600ms ease-in-out;

    /* --- Border Radius (Regla: Máximo 4px para elementos rectangulares) --- */
    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-full: 9999px;

    /* --- Espaciado Escala 8pt --- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;
    --space-12: 48px;
    --space-16: 64px;
    --space-24: 96px;
}

/* ==========================================================================
   2. RESETS Y ESTILOS BASE
   ========================================================================== */
html {
    scroll-behavior: smooth;
    background-color: var(--color-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    overflow-x: hidden;
    background-color: var(--color-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Selección de texto */
::selection {
    background-color: var(--color-accent);
    color: var(--color-primary);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px;
}

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

/* ==========================================================================
   3. TIPOGRAFÍA Y JERARQUÍA
   ========================================================================== */
h1, h2, h3, .font-heading {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

.font-quote, blockquote, cite {
    font-family: var(--font-quote);
}

.font-sans {
    font-family: var(--font-sans);
}

/* Clases de utilidad de texto */
.text-gold { color: var(--color-accent); }
.text-copper { color: var(--color-secondary); }
.text-sand { color: var(--text-secondary); }
.text-marfil { color: var(--text-primary); }
.text-dark-grafito { color: var(--text-dark); }

/* Label superior (pretítulo) */
.section-label {
    font-family: var(--font-sans);
    font-size: 0.75rem; /* 12px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--color-accent);
    display: inline-block;
}

/* ==========================================================================
   4. COMPONENTES Y UTILIDADES DE GLASSMORPHISM
   ========================================================================== */
.glass-panel {
    background-color: var(--overlay-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.header-glass {
    background-color: rgba(20, 18, 16, 0.90);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(201, 168, 76, 0.12);
}

/* Fallback si backdrop-filter no es soportado */
@supports not (backdrop-filter: blur(12px)) {
    .glass-panel {
        background-color: rgba(20, 18, 16, 0.95);
    }
    .header-glass {
        background-color: #141210;
    }
}

/* ==========================================================================
   5. NAVEGACIÓN Y EFECTOS HOVER
   ========================================================================== */
.nav-link {
    position: relative;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8125rem; /* 13px */
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    padding-top: 4px;
    padding-bottom: 4px;
    transition: color var(--transition-fast);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-accent);
    transition: width var(--transition-normal);
}

.nav-link:hover {
    color: var(--color-accent);
}

.nav-link:hover::after,
.nav-link.is-active::after {
    width: 100%;
}

.nav-link.is-active {
    color: var(--color-accent);
}

/* ==========================================================================
   6. BOTONES Y ESTADOS VISUALES
   ========================================================================== */
.btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-size: 0.8125rem; /* 13px */
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    min-height: 44px; /* Touch target min WCAG */
}

/* Botón Primario (Dorado) */
.btn-primary {
    background-color: var(--color-accent);
    color: var(--color-primary);
    border: 1px solid var(--color-accent);
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background-color: var(--color-hover);
    border-color: var(--color-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-warm);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.btn-primary:active {
    transform: translateY(0);
}

/* Botón Secundario (Outline Dorado) */
.btn-secondary {
    background-color: transparent;
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
}

.btn-secondary:hover {
    background-color: var(--color-accent);
    color: var(--color-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-warm);
}

/* Botón Terciario (Carmesí) */
.btn-tertiary {
    background-color: var(--color-button);
    color: var(--text-primary);
    border: 1px solid var(--color-button);
}

.btn-tertiary:hover {
    background-color: #6B1414;
    border-color: #6B1414;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Botón Ghost */
.btn-ghost {
    background-color: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-subtle);
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: var(--color-accent);
    background-color: rgba(201, 168, 76, 0.05);
}

/* Botón Icono Circular */
.btn-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: scale(1.05);
}

/* ==========================================================================
   7. CARDS Y CONTENEDORES
   ========================================================================== */
.card-bossa {
    background-color: var(--color-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card-bossa:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-warm);
    border-color: var(--border-gold);
}

.card-bossa__img-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4 / 3;
}

.card-bossa__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.card-bossa:hover .card-bossa__img {
    transform: scale(1.05);
}

/* ==========================================================================
   8. FORMULARIOS Y FLOATING LABELS
   ========================================================================== */
.form-group {
    position: relative;
    margin-bottom: 24px;
}

.form-control {
    width: 100%;
    background-color: transparent;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    padding: 12px 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    transition: border-color var(--transition-fast);
    border-radius: 0;
}

.form-control:focus {
    outline: none;
    border-bottom-color: var(--color-accent);
}

.form-control::placeholder {
    color: transparent;
}

.form-label {
    position: absolute;
    top: 12px;
    left: 0;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    pointer-events: none;
    transition: all var(--transition-fast);
}

/* Floating behavior */
.form-control:focus ~ .form-label,
.form-control:not(:placeholder-shown) ~ .form-label {
    top: -12px;
    font-size: 0.75rem;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Select Field Customization */
select.form-control {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23C9A84C'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    background-size: 16px;
    padding-right: 24px;
}

select.form-control option {
    background-color: var(--color-primary);
    color: var(--text-primary);
}

/* ==========================================================================
   9. DECORADORES Y SEPARADORES
   ========================================================================== */
.divider-gold {
    width: 60px;
    height: 2px;
    background-color: var(--color-accent);
    margin: 16px auto;
}

.divider-gold--left {
    margin-left: 0;
}

.divider-gold-diamond {
    position: relative;
    width: 80px;
    height: 1px;
    background-color: var(--color-accent);
    margin: 20px auto;
}

.divider-gold-diamond::before {
    content: '◆';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 8px;
    color: var(--color-accent);
    background-color: var(--color-primary);
    padding: 0 4px;
}

/* Marco decorativo de esquinas */
.corner-frame {
    position: relative;
    padding: 24px;
}

.corner-frame::before,
.corner-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-gold);
}

.corner-frame::before {
    top: 0;
    left: 0;
    border-right: none;
    border-bottom: none;
}

.corner-frame::after {
    bottom: 0;
    right: 0;
    border-left: none;
    border-top: none;
}

/* ==========================================================================
   10. KEYFRAMES Y ANIMACIONES
   ========================================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

@keyframes pulseWarm {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4);
    }
    50% {
        box-shadow: 0 0 0 16px rgba(201, 168, 76, 0);
    }
}

@keyframes floatBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.animate-fadeInUp { animation: fadeInUp 800ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-fadeIn { animation: fadeIn 600ms ease forwards; }
.animate-scaleIn { animation: scaleIn 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slideInLeft { animation: slideInLeft 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-slideInRight { animation: slideInRight 600ms cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.animate-pulse-warm { animation: pulseWarm 2.5s infinite; }
.animate-float { animation: floatBounce 3s ease-in-out infinite; }

/* Scroll reveal utility */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 800ms ease-out, transform 800ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay classes */
.delay-100 { transition-delay: 100ms; animation-delay: 100ms; }
.delay-200 { transition-delay: 200ms; animation-delay: 200ms; }
.delay-300 { transition-delay: 300ms; animation-delay: 300ms; }
.delay-400 { transition-delay: 400ms; animation-delay: 400ms; }
.delay-500 { transition-delay: 500ms; animation-delay: 500ms; }

/* ==========================================================================
   11. ACCESIBILIDAD Y RESPONSIVE EXTRAS
   ========================================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 16px;
    background-color: var(--color-accent);
    color: var(--color-primary);
    padding: 12px 24px;
    z-index: 9999;
    font-weight: 600;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 16px;
}

/* Desactivar animaciones si el usuario lo prefiere */
@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;
    }
    .reveal-on-scroll {
        opacity: 1 !important;
        transform: none !important;
    }
}
