/*
Theme Name: Impremx
Theme URI: https://impremx.com.mx
Author: Impremx
Author URI: https://impremx.com.mx
Description: Tema propio para Impremx — plataforma de cotización y catálogo industrial sobre WordPress y WooCommerce.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: impremx
Tags: custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, woocommerce
*/

/* =========================================================================
   TOKENS DE DISEÑO
   Definidos según SYSTEM_DESIGN.md.
   Todos los tokens viven aquí como custom properties en :root.
   Los archivos CSS complementarios solo consumen tokens, nunca los redefinen.
   ========================================================================= */

:root {
    /* ── Tipografía ──────────────────────────────────────── */
    --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
    --font-body: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    /* Pesos */
    --font-weight-normal: 400;
    --font-weight-semibold: 600;
    --font-weight-black: 900;

    /* Escala tipográfica */
    --text-xs:   0.75rem;   /* 12px */
    --text-sm:   0.875rem;  /* 14px */
    --text-base: 1rem;      /* 16px */
    --text-lg:   1.125rem;  /* 18px */
    --text-xl:   1.25rem;   /* 20px */
    --text-2xl:  1.5rem;    /* 24px */
    --text-3xl:  1.875rem;  /* 30px */
    --text-4xl:  2.25rem;   /* 36px */
    --text-5xl:  3rem;      /* 48px */
    --text-6xl:  3.75rem;   /* 60px */

    /* ── Paleta primaria (naranja/ámbar) ────────────────── */
    --color-primary-50:  #fef3e2;
    --color-primary-100: #fde3b8;
    --color-primary-200: #fbd18a;
    --color-primary-300: #f9bf5c;
    --color-primary-400: #f7b13a;
    --color-primary-500: #f5a623;
    --color-primary-600: #e6951f;
    --color-primary-700: #d3821a;
    --color-primary-800: #c06f15;
    --color-primary-900: #a0500e;

    /* ── Paleta neutra ──────────────────────────────────── */
    --color-neutral-50:  #fafafa;
    --color-neutral-100: #f5f5f5;
    --color-neutral-200: #e5e5e5;
    --color-neutral-300: #d4d4d4;
    --color-neutral-400: #a3a3a3;
    --color-neutral-500: #737373;
    --color-neutral-600: #525252;
    --color-neutral-700: #404040;
    --color-neutral-800: #262626;
    --color-neutral-900: #171717;

    /* ── Colores semánticos ──────────────────────────────── */
    --color-success: #16a34a;
    --color-warning: #d97706;
    --color-danger:  #dc2626;
    --color-info:    #2563eb;

    /* ── Superficies ─────────────────────────────────────── */
    --surface-primary:   #ffffff;
    --surface-secondary: #f5f5f5;
    --surface-tertiary:  #e5e5e5;

    /* ── Espaciado ───────────────────────────────────────── */
    --space-1:  0.25rem;  /*  4px */
    --space-2:  0.5rem;   /*  8px */
    --space-3:  0.75rem;  /* 12px */
    --space-4:  1rem;     /* 16px */
    --space-5:  1.25rem;  /* 20px */
    --space-6:  1.5rem;   /* 24px */
    --space-8:  2rem;     /* 32px */
    --space-10: 2.5rem;   /* 40px */
    --space-12: 3rem;     /* 48px */
    --space-16: 4rem;     /* 64px */
    --space-20: 5rem;     /* 80px */
    --space-24: 6rem;     /* 96px */

    /* ── Border radius ───────────────────────────────────── */
    --radius-sm:   0.25rem;
    --radius-md:   0.5rem;
    --radius-lg:   0.75rem;
    --radius-xl:   1rem;
    --radius-full: 9999px;

    /* ── Sombras ─────────────────────────────────────────── */
    --shadow-sm:   0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md:   0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg:   0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl:   0 20px 25px -5px rgb(0 0 0 / 0.1);

    /* ── Transiciones ────────────────────────────────────── */
    --transition-fast: 150ms ease;
    --transition-base: 250ms ease;
    --transition-slow: 350ms ease;

    /* ── Z-index ─────────────────────────────────────────── */
    --z-dropdown: 100;
    --z-sticky:   200;
    --z-drawer:   300;
    --z-modal:    400;
    --z-toast:    500;

    /* ── Contenedor ──────────────────────────────────────── */
    --container-max: 1280px;
    --container-padding: var(--space-4);
    --container-padding-md: var(--space-6);
    --container-padding-lg: var(--space-8);

    /* ── Grid ────────────────────────────────────────────── */
    --grid-gap: var(--space-6);
    --grid-columns: 1;
    --grid-columns-md: 2;
    --grid-columns-lg: 3;
    --grid-columns-xl: 4;
}

/* =========================================================================
   RESET MÍNIMO
   Solo lo necesario para una base predecible sin romper plugins ni bloques.
   ========================================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Remover márgenes por defecto sin romper bloques ni third-party */
body,
h1, h2, h3, h4, h5, h6,
p,
blockquote,
figure,
dl, dd {
    margin: 0;
}

/* Remover estilos de lista sin romper navegación */
ul[role="list"],
ol[role="list"] {
    list-style: none;
    padding: 0;
}

/* Imágenes responsive por defecto */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Heredar tipografía en inputs y botones */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* Evitar desbordamiento de texto */
p,
h1, h2, h3, h4, h5, h6 {
    overflow-wrap: break-word;
}

/* Anclas de scroll con offset razonable */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

/* =========================================================================
   ESTILOS BASE
   Tipografía, cuerpo, links y focus-visible.
   ========================================================================= */

body {
    font-family: var(--font-body);
    font-weight: var(--font-weight-normal);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-neutral-800);
    background-color: var(--surface-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Links */
a {
    color: var(--color-primary-700);
    text-decoration: underline;
    text-underline-offset: 0.15em;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-900);
}

/* Focus visible accesible */
:focus-visible {
    outline: 2px solid var(--color-primary-500);
    outline-offset: 2px;
}

/* Suprimir focus outline para mouse, mantener solo para teclado */
:focus:not(:focus-visible) {
    outline: none;
}

/* Placeholder */
::placeholder {
    color: var(--color-neutral-400);
    opacity: 1;
}

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

/* Heading defaults */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: var(--font-weight-black);
    line-height: 1.15;
    color: var(--color-neutral-900);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* =========================================================================
   RESPETO A PREFERS-REDUCED-MOTION
   ========================================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
