/* ==========================================================================
   Papiro — main.css
   Variables, reset, tipografía, utilidades globales
   ========================================================================== */

/* ---------- Fuentes self-hosted ---------- */
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/CormorantGaramond-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/CormorantGaramond-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/CormorantGaramond-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Cormorant Garamond';
    src: url('../fonts/CormorantGaramond-Italic.woff2') format('woff2');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'DM Sans';
    src: url('../fonts/DMSans-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------- Design tokens ---------- */
:root {
    --color-ink:          #1C1C1C;
    --color-paper:        #F9F6F1;
    --color-accent:       #5C7A5A;
    --color-accent-hover: #4a6348;
    --color-accent-light: #EAF0E9;
    --color-border:       #E2DDD7;
    --color-white:        #FFFFFF;
    --color-muted:        #8A8078;
    --color-error:        #C0392B;
    --color-success:      #27AE60;

    --font-display: 'Cormorant Garamond', Georgia, serif;
    --font-body:    'DM Sans', system-ui, sans-serif;

    --text-xs:   0.75rem;
    --text-sm:   0.875rem;
    --text-base: 1rem;
    --text-md:   1.125rem;
    --text-lg:   1.25rem;
    --text-xl:   1.5rem;
    --text-2xl:  2rem;
    --text-3xl:  2.5rem;
    --text-4xl:  3.5rem;

    --radius-sm:  4px;
    --radius-md:  8px;
    --radius-lg:  16px;
    --radius-full: 999px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,0.06);
    --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);

    --transition: 200ms ease;
    --transition-slow: 350ms ease;

    --container-max: 1280px;
    --container-px:  1.5rem;

    --header-height-full:    120px;
    --header-height-compact: 64px;
    --topbar-height:         36px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-ink);
    background-color: var(--color-paper);
    -webkit-font-smoothing: antialiased;
}

img, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--color-accent); }
ul, ol { list-style: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }

/* ---------- Tipografía ---------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 500;
    line-height: 1.2;
    color: var(--color-ink);
}

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-md); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ---------- Layout ---------- */
.container {
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-px);
}

.container--narrow { max-width: 800px; }
.container--wide   { max-width: 1440px; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
    cursor: pointer;
    white-space: nowrap;
}

.btn--primary {
    background: var(--color-accent);
    color: var(--color-white);
    border: 2px solid var(--color-accent);
}
.btn--primary:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--color-white);
}

.btn--outline {
    background: transparent;
    color: var(--color-ink);
    border: 2px solid var(--color-ink);
}
.btn--outline:hover {
    background: var(--color-ink);
    color: var(--color-white);
}

.btn--ghost {
    background: transparent;
    color: var(--color-muted);
    border: 2px solid var(--color-border);
}
.btn--ghost:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
}

.btn--sm { padding: 0.5rem 1.25rem; font-size: var(--text-xs); }
.btn--lg { padding: 1rem 2.5rem; font-size: var(--text-base); }
.btn--full { width: 100%; }

/* ---------- Badges ---------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    font-family: var(--font-body);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: var(--radius-sm);
}
.badge--new   { background: var(--color-ink);    color: var(--color-white); }
.badge--sale  { background: var(--color-accent); color: var(--color-white); }
.badge--out   { background: var(--color-muted);  color: var(--color-white); }

/* ---------- Títulos de sección ---------- */
.section-title {
    font-family: var(--font-display);
    font-size: var(--text-3xl);
    font-weight: 500;
    text-align: center;
    margin-bottom: 2.5rem;
}
.section-title--left { text-align: left; }

/* ---------- Grid de productos reutilizable ---------- */
.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ---------- Skeleton loader ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--color-border) 25%, var(--color-paper) 50%, var(--color-border) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.4s infinite;
    border-radius: var(--radius-sm);
}
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Utilidades ---------- */
.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;
}

.text-muted   { color: var(--color-muted); }
.text-accent  { color: var(--color-accent); }
.text-center  { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }

/* ---------- Responsive base ---------- */
@media (max-width: 1024px) {
    :root { --container-px: 1.25rem; }
    .products-grid { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

@media (max-width: 640px) {
    :root {
        --text-4xl: 2.25rem;
        --text-3xl: 1.875rem;
        --container-px: 1rem;
    }
    .products-grid { grid-template-columns: 1fr; }
}
