/* =========================================================
   STgrr — Estilos del sitio público
   Paleta y tipografía inspiradas en la referencia enviada
   (fondo crema, tipografía limpia, grillas de producto minimalistas)
   ========================================================= */

/* Tipografías auto-alojadas (sin depender de Google Fonts) */
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../fonts/inter-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('../fonts/inter-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('../fonts/inter-600.woff2') format('woff2');
}
@font-face {
    font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap;
    src: url('../fonts/inter-700.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces'; font-style: normal; font-weight: 400; font-display: swap;
    src: url('../fonts/fraunces-400.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces'; font-style: normal; font-weight: 500; font-display: swap;
    src: url('../fonts/fraunces-500.woff2') format('woff2');
}
@font-face {
    font-family: 'Fraunces'; font-style: normal; font-weight: 600; font-display: swap;
    src: url('../fonts/fraunces-600.woff2') format('woff2');
}

:root {
    --color-bg: #F4EEE6;
    --color-bg-alt: #EAD9C9;
    --color-tile-bg: #E7D5C6;
    --color-surface: #FFFFFF;
    --color-text: #211E1B;
    --color-text-muted: #8A7F74;
    --color-border: #E4D6C7;
    --color-accent: #D6432E;
    --color-accent-dark: #B93321;
    --font-display: 'Fraunces', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --radius-sm: 4px;
    --radius-md: 10px;
    --container-max: 1320px;
    --header-h: 76px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
button { font-family: inherit; cursor: pointer; }

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

h1, h2, h3, .font-display {
    font-family: var(--font-display);
    font-weight: 500;
    letter-spacing: -0.01em;
    margin: 0;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 600;
}

/* =========================================================
   Botones
   ========================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 26px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border: 1px solid var(--color-text);
    background: var(--color-text);
    color: var(--color-bg);
    transition: transform .15s ease, background .15s ease, color .15s ease, opacity .15s ease;
}
.btn:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.btn-outline { background: transparent; color: var(--color-text); }
.btn-outline:hover { background: var(--color-text); color: var(--color-bg); }
.btn-sm { padding: 9px 18px; font-size: 11px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* =========================================================
   Header
   ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    height: var(--header-h);
}
.announcement-bar {
    background: var(--color-bg-alt);
    color: var(--color-text);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 16px;
}

.header-inner {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.header-left {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 16px;
}
.site-logo {
    font-family: var(--font-display);
    font-size: 26px;
    letter-spacing: -0.02em;
    font-weight: 600;
    text-transform: lowercase;
}
.main-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 28px;
}
.main-nav a {
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
}
.main-nav a::after {
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -6px;
    height: 1px;
    background: var(--color-text);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform .25s ease;
}
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header-icons { justify-self: end; display: flex; align-items: center; gap: 18px; }
.header-icons a, .nav-toggle {
    background: none; border: none; color: var(--color-text);
    display: flex; align-items: center;
}
.header-icons .icon-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.nav-toggle { display: none; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
    background: var(--color-bg-alt);
    border-top: 1px solid var(--color-border);
    margin-top: 80px;
    padding: 56px 0 28px;
}
.footer-wordmark {
    font-family: var(--font-display);
    font-weight: 600;
    text-transform: lowercase;
    text-align: center;
    line-height: 0.85;
    color: var(--color-accent-dark);
    opacity: 0.55;
    font-size: clamp(64px, 16vw, 200px);
    margin-bottom: 40px;
    letter-spacing: -0.02em;
}
.footer-newsletter {
    text-align: center;
    max-width: 520px;
    margin: 0 auto 56px;
}
.footer-newsletter h3 { font-size: 24px; margin-bottom: 10px; }
.footer-newsletter p { color: var(--color-text-muted); margin: 0 0 22px; font-size: 14px; }
.newsletter-form {
    display: flex;
    border-bottom: 1px solid var(--color-text);
    padding-bottom: 8px;
    gap: 12px;
}
.newsletter-form input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--color-text);
    font-family: inherit;
}
.newsletter-form button {
    border: none;
    background: none;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.newsletter-msg { margin-top: 10px; font-size: 12px; color: var(--color-accent-dark); }

.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 32px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--color-border);
}
.footer-columns h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 16px;
    font-weight: 700;
}
.footer-columns ul li { margin-bottom: 10px; }
.footer-columns a { font-size: 13px; color: var(--color-text-muted); }
.footer-columns a:hover { color: var(--color-text); }

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 24px;
    font-size: 12px;
    color: var(--color-text-muted);
}
.footer-bottom .socials { display: flex; gap: 16px; }

/* =========================================================
   Tienda: hero + barra de filtros horizontal + grilla
   ========================================================= */
.shop-hero {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    overflow: hidden;
    background: var(--color-bg-alt);
}
.shop-hero img { width: 100%; height: 100%; object-fit: cover; }
.shop-hero-copy {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 20px;
    background: rgba(33, 31, 29, 0.18);
    color: #fff;
}
.shop-hero-copy h2 { font-size: 38px; color: #fff; }
.shop-hero-copy p { font-size: 14px; max-width: 480px; }

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 22px 0;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 32px;
}
.filter-tabs {
    display: flex;
    align-items: center;
    gap: 22px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tabs .tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    padding-bottom: 8px;
    border-bottom: 1px solid transparent;
    position: relative;
}
.tab-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tab-icon svg { width: 100%; height: 100%; }
.tab-icon-img { width: 100%; height: 100%; object-fit: contain; }
.tab-label { line-height: 1; }
.filter-tabs .tab:hover { color: var(--color-text); }
.filter-tabs .tab.active { color: var(--color-text); border-bottom-color: var(--color-text); }

.filter-controls { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.filter-dropdown { position: relative; }
.filter-dropdown-toggle {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text);
    display: flex;
    align-items: center;
    gap: 6px;
}
.filter-dropdown-toggle::after {
    content: '';
    width: 6px; height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
}
.filter-dropdown-panel {
    display: none;
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    min-width: 220px;
    box-shadow: 0 12px 28px rgba(33,31,29,.08);
    z-index: 30;
}
.filter-dropdown.open .filter-dropdown-panel { display: block; }
.filter-option {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 13px;
    margin-bottom: 9px;
    cursor: pointer;
}
.filter-option:last-child { margin-bottom: 0; }
.filter-option input { accent-color: var(--color-text); }

.color-swatches { display: flex; flex-wrap: wrap; gap: 10px; max-width: 190px; }
.color-swatch {
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    cursor: pointer;
    position: relative;
    box-shadow: 0 0 0 1px transparent;
    transition: box-shadow .15s ease;
}
.color-swatch.active,
.color-swatch:hover {
    box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 3px var(--color-text);
}

.clear-link {
    font-size: 12px;
    text-decoration: underline;
    color: var(--color-text-muted);
    white-space: nowrap;
}

/* Grilla de productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px 24px;
}
.product-card {
    position: relative;
}
.product-card .thumb {
    position: relative;
    aspect-ratio: 1 / 1.1;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--color-tile-bg);
    margin-bottom: 14px;
}
.product-card .thumb img {
    width: 100%; height: 100%;
    object-fit: cover;
    position: absolute; inset: 0;
    transition: opacity .35s ease, transform .5s ease;
}
.product-card .thumb img.img-secondary { opacity: 0; }
.product-card:hover .thumb img.img-secondary { opacity: 1; }
.product-card:hover .thumb img.img-primary { opacity: 0; }
.product-card:hover .thumb { transform: none; }
.product-card:hover .thumb img { transform: scale(1.02); }

.product-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    border-radius: 999px;
    z-index: 2;
}

.quick-add {
    position: absolute;
    left: 12px; right: 12px; bottom: 12px;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .2s ease, transform .2s ease;
    z-index: 2;
}
.product-card:hover .quick-add { opacity: 1; transform: translateY(0); }
.quick-add button {
    width: 100%;
    border: none;
    background: var(--color-text);
    color: var(--color-bg);
    padding: 11px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.quick-add button:hover { background: var(--color-accent-dark); }

.product-card .rating {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    letter-spacing: 0.03em;
}
.product-card .name {
    font-family: var(--font-display);
    font-size: 17px;
    text-transform: lowercase;
    margin-bottom: 4px;
}
.product-card .desc {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 6px;
}
.product-card .price {
    font-size: 13px;
    font-weight: 600;
}
.product-card .price .compare {
    text-decoration: line-through;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-right: 6px;
}
.product-card .swatch-row { display: flex; gap: 6px; margin-top: 8px; }
.product-card .swatch-row span {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1px solid var(--color-border);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text-muted);
}

/* =========================================================
   Página estática
   ========================================================= */
.static-page { padding: 56px 0 90px; max-width: 780px; margin: 0 auto; }
.static-page h1 { font-size: 36px; margin-bottom: 24px; }
.static-page .content { font-size: 15px; line-height: 1.8; }
.static-page .content p { margin: 0 0 18px; }

/* =========================================================
   Responsive
   ========================================================= */
@media (max-width: 1024px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
    .main-nav { display: none; }
    .nav-toggle { display: flex; }

    .shop-hero { aspect-ratio: 4 / 5; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .filter-controls { justify-content: space-between; }
    .filter-dropdown-panel { left: 0; right: auto; }

    /* Tabs de categoría: solo ícono, con el nombre flotando (tooltip).
       overflow-x:auto en .filter-tabs recortaría el tooltip en el eje Y
       también (una fila de solo íconos es angosta y no necesita scroll). */
    .filter-tabs { gap: 20px; padding-bottom: 2px; overflow: visible; }
    .filter-tabs .tab { padding-bottom: 4px; gap: 0; }
    .tab-label {
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%) translateY(-4px);
        background: var(--color-text);
        color: #fff;
        padding: 5px 10px;
        border-radius: 6px;
        font-size: 10px;
        letter-spacing: 0.04em;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
        white-space: nowrap;
        z-index: 20;
    }
    .tab-label::after {
        content: '';
        position: absolute;
        top: 100%;
        left: 50%;
        transform: translateX(-50%);
        border: 5px solid transparent;
        border-top-color: var(--color-text);
    }
    .filter-tabs .tab:hover .tab-label,
    .filter-tabs .tab.show-tooltip .tab-label {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(-10px);
    }
}

@media (max-width: 640px) {
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }
    .footer-columns { grid-template-columns: repeat(2, 1fr); }
    .container { padding: 0 16px; }
    .product-card .name { font-size: 15px; }
    .shop-hero-copy h2 { font-size: 26px; }
}

@media (max-width: 420px) {
    .product-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Mobile nav drawer
   ========================================================= */
.mobile-nav {
    position: fixed; inset: 0;
    background: var(--color-bg);
    z-index: 200;
    transform: translateY(-100%);
    transition: transform .3s ease;
    padding: 24px;
    overflow-y: auto;
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav .close-btn { background: none; border: none; margin-bottom: 30px; }
.mobile-nav a {
    display: block;
    font-family: var(--font-display);
    font-size: 24px;
    padding: 12px 0;
    border-bottom: 1px solid var(--color-border);
}
