/* =========================================================================
   Bellota V2 — Base
   Reset moderno + tipografía Inter + iconografía Bellota + container responsive
   ========================================================================= */

/* -----------------------------------------------------------
   FONTS — Inter (self-hosted, variable font, subset latino)
   Descargar en assets/public/fonts/ e importar:
      inter-var.woff2 (todos los weights en un solo fichero)
   Fallback: system font stack (SF Pro / Segoe UI / Roboto)
   ----------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    src: url('/assets/public/fonts/inter-var.woff2') format('woff2-variations'),
         url('/assets/public/fonts/inter-var.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Iconografía Bellota (fuente propia legacy) */
@font-face {
    font-family: 'bellota-icons';
    src: url('/assets/public/fonts/bellota-icons.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* -----------------------------------------------------------
   MODERN RESET (minimal)
   ----------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    text-rendering: optimizeLegibility;
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: var(--fs-base);
    line-height: var(--lh-normal);
    font-weight: var(--fw-regular);
    color: var(--c-text-body);
    background-color: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 var(--sp-4);
    font-weight: var(--fw-semibold);
    line-height: var(--lh-tight);
    color: var(--c-text-strong);
    letter-spacing: -0.01em;
}

h1 { font-size: var(--fs-3xl); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
h5 { font-size: var(--fs-md); }
h6 { font-size: var(--fs-base); }

p {
    margin: 0 0 var(--sp-4);
}

a {
    color: var(--c-brand);
    text-decoration: none;
    transition: color var(--t-fast);
}
a:hover { color: var(--c-brand-hover); }
a:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
    border-radius: 2px;
}

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

ul, ol {
    margin: 0 0 var(--sp-4);
    padding-left: var(--sp-5);
}

button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
button:focus-visible {
    outline: 2px solid var(--c-brand);
    outline-offset: 2px;
    border-radius: 2px;
}

input, textarea, select {
    font: inherit;
    color: inherit;
}

hr {
    border: 0;
    border-top: 1px solid var(--c-border);
    margin: var(--sp-6) 0;
}

/* -----------------------------------------------------------
   ACCESIBILIDAD
   ----------------------------------------------------------- */
.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0);
    white-space: nowrap; border: 0;
}

.skip-nav {
    position: absolute;
    top: -100px;
    left: var(--sp-4);
    background: var(--c-brand);
    color: var(--c-text-inverse);
    padding: var(--sp-3) var(--sp-4);
    border-radius: var(--r-md);
    font-weight: var(--fw-semibold);
    z-index: var(--z-modal);
    transition: top var(--t-fast);
}
.skip-nav:focus {
    top: var(--sp-4);
    color: var(--c-text-inverse);
}

/* -----------------------------------------------------------
   CONTAINER (heredado del legacy: 90% / 80% / 68%)
   ----------------------------------------------------------- */
.container-app {
    width: var(--container-w-mobile);
    max-width: 1600px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 992px) {
    .container-app {
        width: var(--container-w-desktop);
    }
}

@media (min-width: 1400px) {
    .container-app {
        width: var(--container-w-xl);
    }
}

/* -----------------------------------------------------------
   ICONS BELLOTA (fuente custom del legacy)
   ----------------------------------------------------------- */
[class^="bi-"], [class*=" bi-"] {
    font-family: var(--font-icons);
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

/* -----------------------------------------------------------
   UTILS mínimas (evitar depender de framework)
   ----------------------------------------------------------- */
.text-center     { text-align: center; }
.text-right      { text-align: right; }
.text-uppercase  { text-transform: uppercase; letter-spacing: 0.03em; }
.text-muted      { color: var(--c-text-muted); }
.text-brand      { color: var(--c-brand); }

.d-none          { display: none; }
.d-block         { display: block; }
.d-inline-block  { display: inline-block; }
.d-flex          { display: flex; }
.d-grid          { display: grid; }

.items-center    { align-items: center; }
.items-start     { align-items: flex-start; }
.justify-center  { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }

.flex-1          { flex: 1; }
.flex-wrap       { flex-wrap: wrap; }
.flex-col        { flex-direction: column; }

/* -----------------------------------------------------------
   BUTTONS (base — variantes en components/button.css)
   ----------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-2);
    padding: var(--sp-3) var(--sp-5);
    border: 1px solid transparent;
    border-radius: var(--r-md);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-base);
    line-height: 1.2;
    cursor: pointer;
    transition: all var(--t-fast);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
    background: var(--c-brand);
    color: var(--c-text-inverse);
    border-color: var(--c-brand);
}
.btn-primary:hover:not(:disabled) {
    background: var(--c-brand-hover);
    border-color: var(--c-brand-hover);
    color: var(--c-text-inverse);
}

.btn-outline {
    background: transparent;
    color: var(--c-brand);
    border-color: var(--c-brand);
}
.btn-outline:hover:not(:disabled) {
    background: var(--c-brand);
    color: var(--c-text-inverse);
}

/* Variante del outline para fondos oscuros (hero, stats-hero, etc.).
   Hover coherente sobre oscuro: velo blanco translúcido + borde blanco sólido. */
.btn-outline-light {
    background: transparent;
    color: var(--c-text-inverse);
    border-color: rgba(255, 255, 255, 0.55);
}
.btn-outline-light:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: #fff;
    color: var(--c-text-inverse);
}

.btn-ghost {
    background: transparent;
    color: var(--c-text-body);
}
.btn-ghost:hover:not(:disabled) {
    background: var(--c-surface-alt);
    color: var(--c-text-strong);
}

.btn-sm { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-sm); }
.btn-lg { padding: var(--sp-4) var(--sp-6); font-size: var(--fs-md); }

/* ----------------------------------------------------------------
   .cta-link — CTA canónico dentro de cards y listados
   ("Ver más", "Leer más", "Ver todas", "Ver familia", ...)
   Uso: <a class="cta-link"><?= t('common.cta.view_more') ?></a>
   La flecha › la pone el ::after — NUNCA escribirla en el texto.
   ---------------------------------------------------------------- */
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--c-brand);
    text-decoration: none;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    transition: color var(--t-fast);
}
.cta-link::after {
    content: '›';
    display: inline-block;
    font-size: 1.15em;
    line-height: 1;
    transition: transform 0.18s ease;
}
.cta-link:hover { color: var(--c-brand-dark); text-decoration: none; }
.cta-link:hover::after,
a:hover > .cta-link::after,
a:hover .cta-link::after { transform: translateX(3px); }

/* Variante en gris — para CTAs secundarios en cards */
.cta-link.is-muted { color: var(--c-text-muted); }
.cta-link.is-muted:hover { color: var(--c-brand); }

/* Dentro de una card con body flex-column, el CTA siempre se pega al fondo
   → todas las cards de una fila alinean el "Leer más" a la misma altura,
   independientemente de que el título/descripción sean más largos o cortos.
   padding-top garantiza un espacio mínimo cuando el contenido llena el body
   (donde margin-top:auto se colapsaría a 0 y dejaría el CTA pegado al excerpt). */
.product-card-body > .cta-link,
.news-card-body   > .cta-link,
.nov-card-body    > .cta-link,
.nov-other-body   > .cta-link { margin-top: auto; padding-top: var(--sp-3); }
