@import url("https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css") layer(bootstrap);

/* =============================================
   GLOBAL.CSS
   Variables, reset y estilos base del documento.
   Se carga en todas las páginas a través de layout.html.
   ============================================= */

/* ── Variables de diseño ── */
:root {
    /* Layout */
    --max-width: 1200px;

    /* Paleta de color principal */
    --near-dark-green: #2D5931;     /* verde oscuro: botones, acentos, textos activos */
    --buy-light-green: #7FBB7F;     /* verde claro: hover de botones y bordes de foco */
    --bg-light: #F1F8E9;            /* fondo general de la aplicación */
    --white: #FFFFFF;
    --red: #D32F2F;                 /* errores, eliminar, peligro */

    /* Escala de grises para texto */
    --text-primary: #2C2C2A;        /* texto principal (títulos, contenido) */
    --text-secondary: #888780;      /* texto secundario (subtítulos, metadatos) */
    --text-muted: #B4B2A9;          /* texto desactivado o de relleno */
    --border-soft: #E0E0E0;         /* bordes suaves de tarjetas y divisores */

    /* Colores semánticos para badges de producto */
    --fresh-bg: #EAF3DE;            /* fondo del badge "Novedad" */
    --fresh-text: #3B6D11;          /* texto del badge "Novedad" */
    --offer-bg: #FAEEDA;            /* fondo del badge "Oferta" */
    --offer-text: #854F0B;          /* texto del badge "Oferta" */
    --out-bg: #F1EFE8;              /* fondo del badge "Agotado" */
    --out-text: #5F5E5A;            /* texto del badge "Agotado" */
    --header-bg: #c8ecd0;           /* fondo del header y footer */

    /* Tipografía */
    --font-sans: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-serif: Georgia, 'Times New Roman', serif;
}

/* ── Reset ──
   Elimina márgenes, paddings y asegura box-sizing
   consistente en todos los elementos. */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ── Base del documento ── */
html {
    scroll-behavior: smooth;
}

/* Flex column para que el footer siempre quede al fondo
   gracias a main { flex: 1 } definido más abajo. */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-light);
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--text-primary);
    line-height: 1.6;
}

/* El main crece para ocupar todo el espacio disponible
   entre header y footer (ver layout.css). */
main {
    flex: 1;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 0.75rem;
}

/* ── Tipografía ── */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
    color: var(--near-dark-green);
}
h1 { font-size: 1.8rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.4rem; }

/* Todos los enlaces sin subrayado por defecto;
   heredan el color del elemento padre. */
a {
    text-decoration: none;
    color: inherit;
}

/* Imágenes como bloque para evitar espacio extra inferior
   y limitadas al ancho de su contenedor. */
img {
    display: block;
    max-width: 100%;
    height: auto;
}
