/* =============================================================
   Nube Shopp — Design System
   Inspirado en shop.app: cards limpias, foto dominante, whitespace,
   tipografía sans-serif moderna, modo claro y oscuro.
   ============================================================= */

/* ---- TOKENS ---- */
:root {
    /* Brand (siempre igual en ambos modos) */
    --brand: #E84A1B;
    --brand-hover: #FF6B3D;
    --brand-soft: rgba(232, 74, 27, 0.10);
    --brand-soft-strong: rgba(232, 74, 27, 0.20);

    --gold: #FFB800;
    --wa: #25D366;
    --wa-hover: #1DAF54;

    /* Estados */
    --ok: #10B981;
    --warn: #F59E0B;
    --err: #EF4444;

    /* Tipografía */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Inter', sans-serif;

    /* Spacing scale (4 base) */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;
    --space-20: 80px;

    /* Radius */
    --r-sm: 8px;
    --r: 12px;
    --r-md: 16px;
    --r-lg: 20px;
    --r-xl: 28px;
    --r-pill: 9999px;

    /* Layout */
    --container: 1280px;
    --container-sm: 720px;
    --header-h: 64px;

    /* Motion */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --t-fast: 120ms;
    --t: 220ms;
    --t-slow: 380ms;
}

/* ---- LIGHT MODE (default) ---- */
:root,
:root[data-theme='light'] {
    --bg: #FAFAF7;
    --bg-elevated: #FFFFFF;
    --surface: #FFFFFF;
    --surface-2: #F4F4F0;
    --surface-3: #EAEAE5;

    --text: #0A0A14;
    --text-2: #3A3A45;
    --text-dim: #6B6B78;
    --text-faint: #9999A4;

    --border: rgba(10, 10, 20, 0.08);
    --border-strong: rgba(10, 10, 20, 0.14);

    --shadow-sm: 0 1px 2px rgba(10, 10, 20, 0.04);
    --shadow: 0 4px 14px rgba(10, 10, 20, 0.06);
    --shadow-lg: 0 16px 48px rgba(10, 10, 20, 0.10);

    --header-bg: rgba(250, 250, 247, 0.85);

    color-scheme: light;
}

/* ---- DARK MODE ---- */
:root[data-theme='dark'] {
    --bg: #0A0A0F;
    --bg-elevated: #14141C;
    --surface: #14141C;
    --surface-2: #1C1C26;
    --surface-3: #25252F;

    --text: #F5F5F7;
    --text-2: #C7C7CC;
    --text-dim: #8B8B95;
    --text-faint: #5F5F66;

    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.14);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
    --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

    --header-bg: rgba(10, 10, 15, 0.80);

    color-scheme: dark;
}

/* ---- AUTO (sistema) ---- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) {
        --bg: #0A0A0F;
        --bg-elevated: #14141C;
        --surface: #14141C;
        --surface-2: #1C1C26;
        --surface-3: #25252F;
        --text: #F5F5F7;
        --text-2: #C7C7CC;
        --text-dim: #8B8B95;
        --text-faint: #5F5F66;
        --border: rgba(255, 255, 255, 0.08);
        --border-strong: rgba(255, 255, 255, 0.14);
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.40);
        --shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
        --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
        --header-bg: rgba(10, 10, 15, 0.80);
        color-scheme: dark;
    }
}

/* =============================================================
   RESET + BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

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

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
    transition: background-color var(--t) var(--ease), color var(--t) var(--ease);
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; background: transparent; border: 0; color: inherit; }

::selection { background: var(--brand-soft-strong); color: var(--text); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0ms !important; animation-duration: 0ms !important; }
}

/* =============================================================
   LAYOUT PRIMITIVES
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--space-5); }
.container-sm { max-width: var(--container-sm); margin-inline: auto; padding-inline: var(--space-5); }

.stack > * + * { margin-top: var(--space-6); }
.row { display: flex; gap: var(--space-3); align-items: center; }

/* =============================================================
   TYPOGRAPHY
   ============================================================= */
.t-display {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--text);
}
.t-h1 {
    font-size: clamp(28px, 3vw, 40px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.t-h2 {
    font-size: clamp(22px, 2.4vw, 28px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.t-h3 { font-size: 18px; font-weight: 700; line-height: 1.3; }
.t-body { font-size: 15px; line-height: 1.55; color: var(--text-2); }
.t-small { font-size: 13px; line-height: 1.5; color: var(--text-dim); }
.t-eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-dim);
}

/* =============================================================
   HEADER (sticky, blurred)
   ============================================================= */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--header-bg);
    backdrop-filter: saturate(180%) blur(16px);
    -webkit-backdrop-filter: saturate(180%) blur(16px);
    border-bottom: 1px solid var(--border);
    height: var(--header-h);
    display: flex;
    align-items: center;
}
.app-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    width: 100%;
}
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
    /* Un flex item nace con `min-width: auto`: se niega a achicarse por debajo de
       su contenido. Con un nombre de tienda largo en un celular, ese nombre empuja
       los botones de la derecha FUERA de la pantalla y el documento entero queda
       más ancho que el viewport (toda la tienda scrollea al costado). Que el
       nombre se corte con puntos suspensivos es lo correcto: el logo se reconoce
       igual, y el carrito tiene que estar donde el pulgar lo espera. */
    min-width: 0;
    overflow: hidden;
}
.brand-mark__dot {
    width: 28px;
    height: 28px;
    border-radius: var(--r-sm);
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
}
/* Variantes de logo: una para escritorio, otra para celular (evita el encimado
   con un logo ancho en el header angosto del móvil). */
.brand-mark__variant { display: inline-flex; align-items: center; gap: var(--space-2); min-width: 0; }
.brand-mark__variant--desktop { display: none; }
/* `max-width: 66vw` reservaba 259px de 393 aunque los botones de la derecha
   necesitaran 152: no entraban los dos. Con 100% el ancho lo decide el espacio
   que sobra de verdad, y el nombre se corta ahí. */
.brand-mark__variant--mobile { max-width: 100%; overflow: hidden; }
.brand-mark__variant--mobile > span:not(.brand-mark__dot) {
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.brand-mark__variant--mobile .brand-mark__logo { max-height: 38px; max-width: 60vw; }
@media (min-width: 768px) {
    .brand-mark__variant--desktop { display: inline-flex; }
    .brand-mark__variant--mobile { display: none; }
}
.app-header__nav { display: none; gap: var(--space-5); margin-left: var(--space-6); }
.app-header__nav a {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-2);
    transition: color var(--t-fast);
}
.app-header__nav a:hover { color: var(--text); }
.app-header__spacer { flex: 1; }
/* `flex: none`: los botones (tema, carrito, cuenta) conservan su tamaño y quien
   cede es el nombre de la tienda. Al revés, un nombre largo los deja fuera de
   pantalla. */
.app-header__actions { display: flex; gap: var(--space-2); align-items: center; flex: none; }

@media (min-width: 768px) {
    .app-header__nav { display: flex; }
}

/* Search input compacto */
.search {
    display: none;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 12px;
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--r-pill);
    width: 280px;
    transition: border-color var(--t-fast), background-color var(--t-fast);
}
.search:focus-within { border-color: var(--brand); background: var(--bg-elevated); }
.search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 14px;
    color: var(--text);
}
.search input::placeholder { color: var(--text-faint); }
@media (min-width: 1024px) { .search { display: flex; } }

/* =============================================================
   THEME TOGGLE
   ============================================================= */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: var(--r-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    background: transparent;
    border: 1px solid var(--border);
    transition: background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.theme-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle .icon-light { display: none; }
.theme-toggle .icon-dark { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-light { display: block; }
:root[data-theme='dark'] .theme-toggle .icon-dark { display: none; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .theme-toggle .icon-light { display: block; }
    :root:not([data-theme='light']) .theme-toggle .icon-dark { display: none; }
}

/* =============================================================
   BUTTONS
   ============================================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 10px 18px;
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    border: 1px solid transparent;
    transition: transform var(--t-fast), background-color var(--t-fast), border-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
    white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--primary { background: var(--text); color: var(--bg); }
.btn--primary:hover { background: var(--brand); color: #fff; }
.btn--brand { background: var(--brand); color: #fff; }
.btn--brand:hover { background: var(--brand-hover); }
.btn--ghost { background: transparent; border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: var(--wa-hover); }
.btn--lg { padding: 14px 26px; font-size: 15px; }
.btn--sm { padding: 7px 14px; font-size: 13px; }
.btn--icon { width: 38px; height: 38px; padding: 0; }

/* =============================================================
   CHIPS (categorías horizontales)
   ============================================================= */
.chips {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    padding: var(--space-2) 0;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 8px 16px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    border: 1px solid transparent;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    white-space: nowrap;
    cursor: pointer;
    scroll-snap-align: start;
    transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip:hover { background: var(--surface-3); color: var(--text); }
.chip--active { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip__count { color: var(--text-faint); font-weight: 500; font-size: 12px; }
.chip--active .chip__count { color: rgba(255, 255, 255, 0.7); }

/* =============================================================
   PRODUCT CARD (estilo shop.app)
   ============================================================= */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
}
@media (min-width: 640px) { .product-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-4); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); gap: var(--space-5); } }

.product-card {
    display: block;
    border-radius: var(--r-md);
    background: transparent;
    transition: transform var(--t) var(--ease);
    overflow: hidden;
}
.product-card:hover { transform: translateY(-2px); }

.product-card__media {
    aspect-ratio: 1 / 1;
    border-radius: var(--r-md);
    background: var(--surface-2);
    overflow: hidden;
    position: relative;
}
.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow) var(--ease);
}
.product-card:hover .product-card__media img { transform: scale(1.04); }

.product-card__badges {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    right: var(--space-2);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
    z-index: 1;
}
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.4;
    backdrop-filter: blur(8px);
}
.badge--discount { background: var(--brand); color: #fff; }
.badge--featured { background: rgba(255, 255, 255, 0.92); color: #0A0A14; }
.badge--soldout { background: rgba(0, 0, 0, 0.7); color: #fff; }

.product-card__body {
    padding-top: var(--space-3);
    padding-inline: var(--space-1);
}
.product-card__brand {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.product-card__name {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}
.product-card__price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.product-card__price strong {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}
.product-card__price s {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-faint);
    text-decoration: line-through;
}

/* =============================================================
   STORE CARD
   ============================================================= */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-4);
}
.store-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: var(--space-5);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    transition: transform var(--t) var(--ease), border-color var(--t-fast), box-shadow var(--t);
}
.store-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-strong);
    box-shadow: var(--shadow-lg);
}
.store-card__head { display: flex; gap: var(--space-3); align-items: center; }
.store-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.store-card__title { font-weight: 700; font-size: 16px; line-height: 1.2; color: var(--text); }
.store-card__meta { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.store-card__desc {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.5;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.store-card__foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-3);
    border-top: 1px solid var(--border);
}
.store-card__count { font-size: 12px; font-weight: 700; color: var(--text-2); }
.store-card__cta { font-size: 14px; font-weight: 600; color: var(--brand); }

/* =============================================================
   HERO
   ============================================================= */
.hero {
    padding: clamp(40px, 6vw, 80px) 0 clamp(32px, 5vw, 56px);
    text-align: center;
}
.hero h1 { margin-bottom: var(--space-3); }
.hero p { max-width: 620px; margin-inline: auto; margin-bottom: var(--space-6); font-size: 17px; color: var(--text-2); line-height: 1.5; }
.hero__stats {
    display: flex;
    justify-content: center;
    gap: var(--space-10);
    flex-wrap: wrap;
    margin-top: var(--space-8);
}
.hero__stat-num {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1;
}
.hero__stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    color: var(--text-dim);
    font-weight: 600;
    margin-top: var(--space-1);
}

/* =============================================================
   SECTION HEADER
   ============================================================= */
.section { padding-block: var(--space-12); }
.section--tight { padding-block: var(--space-8); }
.section-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: var(--space-6); flex-wrap: wrap; gap: var(--space-3); }
.section-header h2 { color: var(--text); }
.section-header__sub { color: var(--text-dim); font-size: 14px; margin-top: 4px; }
.section-header a { font-size: 14px; font-weight: 600; color: var(--brand); }

/* =============================================================
   CTA BANNER
   ============================================================= */
.cta-banner {
    margin-block: var(--space-8);
    padding: var(--space-12);
    border-radius: var(--r-xl);
    background:
        radial-gradient(circle at 80% 20%, var(--brand-soft) 0%, transparent 60%),
        radial-gradient(circle at 20% 80%, rgba(255, 184, 0, 0.10) 0%, transparent 60%),
        var(--bg-elevated);
    border: 1px solid var(--border);
    text-align: center;
}
.cta-banner h3 { font-size: clamp(24px, 3vw, 36px); font-weight: 800; margin-bottom: var(--space-3); letter-spacing: -0.02em; }
.cta-banner p { color: var(--text-2); margin-bottom: var(--space-5); max-width: 520px; margin-inline: auto; }

/* =============================================================
   FOOTER
   ============================================================= */
.app-footer {
    border-top: 1px solid var(--border);
    padding: var(--space-12) 0;
    color: var(--text-dim);
    font-size: 13px;
}
.app-footer__inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--space-4); }
.app-footer a { color: var(--text-dim); transition: color var(--t-fast); }
.app-footer a:hover { color: var(--text); }

/* =============================================================
   PRODUCT DETAIL
   ============================================================= */
.detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-8);
    padding-block: var(--space-8);
}
@media (min-width: 900px) {
    .detail { grid-template-columns: 1.05fr 1fr; gap: var(--space-12); }
}
.detail__gallery { display: flex; flex-direction: column; gap: var(--space-3); }
.detail__main {
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    border-radius: var(--r-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}
.detail__main img { width: 100%; height: 100%; object-fit: cover; }
.detail__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-2); }
.detail__thumbs img {
    aspect-ratio: 1/1;
    border-radius: var(--r);
    object-fit: cover;
    border: 2px solid var(--border);
    cursor: pointer;
    transition: border-color var(--t-fast);
}
.detail__thumbs img:hover { border-color: var(--brand); }
.detail__info { display: flex; flex-direction: column; gap: var(--space-5); }
.detail__title { font-size: clamp(24px, 3vw, 32px); font-weight: 700; line-height: 1.15; letter-spacing: -0.02em; }
.detail__subtitle { color: var(--text-2); font-size: 16px; }
.detail__price-row { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.detail__price { font-size: 36px; font-weight: 800; color: var(--text); line-height: 1; letter-spacing: -0.02em; }
.detail__compare { font-size: 16px; color: var(--text-faint); text-decoration: line-through; }
.detail__save {
    padding: 4px 12px;
    background: var(--brand-soft);
    color: var(--brand);
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 700;
}
.detail__variants { display: flex; flex-direction: column; gap: var(--space-3); }
.detail__variants h4 {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.10em;
    font-weight: 700;
    color: var(--text-dim);
}
.variant-list { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.variant {
    padding: 8px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--r);
    background: var(--bg-elevated);
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    transition: border-color var(--t-fast), background-color var(--t-fast);
}
.variant:hover { border-color: var(--text); }
.variant--selected { background: var(--text); color: var(--bg); border-color: var(--text); }
.detail__desc { color: var(--text-2); line-height: 1.7; font-size: 15px; padding: var(--space-5) 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.detail__cta-row { display: flex; gap: var(--space-3); flex-wrap: wrap; }
/* Cada botón pide el ancho de SU texto: con el min-width fijo de antes, tres o
   cuatro CTAs en la misma fila se aplastaban y el contenido desbordaba el borde
   (el emoji del de alquiler quedaba pisando el contorno). El que no entra baja
   de línea entero, y en pantallas angostas nunca supera el ancho disponible. */
.detail__cta-row .btn {
    /* Base 0 = el espacio se reparte PAREJO; el min-width impide que ninguno baje
       del ancho de su propio texto (con base auto crecían desparejos: 178px al
       lado de 574px). */
    flex: 1 1 0;
    min-width: min(max-content, 100%);
    max-width: 100%;
    white-space: nowrap;
}

/* Vendors row */
.vendors-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.vendor-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-4);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    transition: border-color var(--t-fast), transform var(--t-fast);
}
.vendor-card:hover { transform: translateY(-2px); border-color: var(--wa); }
.vendor-card__avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand), var(--gold));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    margin-bottom: var(--space-2);
}
.vendor-card__name { font-weight: 600; font-size: 13px; color: var(--text); }
.vendor-card__role { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: var(--space-3); }

/* =============================================================
   STOREFRONT HEADER (cuando es modo bio)
   ============================================================= */
.tenant-hero {
    text-align: center;
    padding: var(--space-12) 0 var(--space-8);
}
.tenant-logo {
    width: 96px;
    height: 96px;
    border-radius: var(--r-xl);
    margin: 0 auto var(--space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 40px;
    font-weight: 800;
    box-shadow: var(--shadow-lg);
}
.tenant-name { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: var(--space-2); }
.tenant-meta { font-size: 14px; color: var(--text-dim); }
.tenant-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: 6px 14px;
    background: var(--surface-2);
    border-radius: var(--r-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-top: var(--space-3);
}
.tenant-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--wa);
    animation: pulse 2s ease infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* WhatsApp float */
.fab-wa {
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wa);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 12px 28px rgba(37, 211, 102, 0.40);
    z-index: 40;
    transition: transform var(--t) var(--ease);
}
.fab-wa:hover { transform: scale(1.08); }

/* Empty / utility */
.empty {
    text-align: center;
    padding: var(--space-12);
    color: var(--text-dim);
    background: var(--surface-2);
    border-radius: var(--r-lg);
    border: 1px dashed var(--border-strong);
}

/* Breadcrumb */
.breadcrumb { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--text-dim); padding-block: var(--space-4); flex-wrap: wrap; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb__sep { color: var(--text-faint); }

/* =============================================================
   SHELL CON SIDEBAR (marketplace v2 estilo shop.app)
   ============================================================= */
.shell {
    display: grid;
    grid-template-columns: 76px 1fr;
    min-height: 100vh;
    background: var(--bg);
}
@media (max-width: 768px) {
    .shell { grid-template-columns: 1fr; padding-bottom: 76px; }
}

.sidebar {
    background: var(--bg);
    border-right: 1px solid var(--border);
    padding: var(--space-5) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    position: sticky;
    top: 0;
    height: 100vh;
    z-index: 30;
}
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        height: auto;
        flex-direction: row;
        justify-content: space-around;
        padding: var(--space-3) var(--space-4);
        border-right: 0;
        border-top: 1px solid var(--border);
        background: var(--header-bg);
        backdrop-filter: blur(16px);
    }
}

.sidebar__brand {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    margin-bottom: var(--space-4);
}
@media (max-width: 768px) { .sidebar__brand { display: none; } }

.sidebar__nav {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    flex: 1;
    align-items: center;
}
@media (max-width: 768px) {
    .sidebar__nav { flex-direction: row; gap: 0; flex: 1; justify-content: space-around; }
}

.sidebar__btn {
    width: 44px;
    height: 44px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    background: transparent;
    transition: background-color var(--t-fast), color var(--t-fast);
}
.sidebar__btn:hover { background: var(--surface-2); color: var(--text); }
.sidebar__btn.is-active {
    background: var(--text);
    color: var(--bg);
}

.sidebar__foot {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: center;
    margin-top: auto;
}
@media (max-width: 768px) { .sidebar__foot { display: none; } }

.sidebar__login {
    font-size: 11px;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.2;
    width: 60px;
    margin-top: 4px;
}
.sidebar__login:hover { color: var(--text); }

/* Menú "Iniciar sesión": cliente / comercio (popover sin JS, vía <details>) */
.login-menu { position: relative; }
.login-menu > summary {
    list-style: none;
    cursor: pointer;
    outline: none;
}
.login-menu > summary::-webkit-details-marker { display: none; }
.login-menu > summary::marker { content: ""; }
.login-menu__pop {
    position: absolute;
    left: calc(100% + 10px);
    bottom: 0;
    width: 210px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--r);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .16);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 50;
}
.login-menu__item {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 9px 11px;
    border-radius: 9px;
    color: var(--text);
    text-align: left;
}
.login-menu__item:hover { background: var(--surface-2); }
.login-menu__item strong { font-size: 13px; font-weight: 700; }
.login-menu__item span { font-size: 11px; color: var(--text-dim); }

.shell__main { min-width: 0; }

/* =============================================================
   PROMO BAR (top banner negro tipo shop.app)
   ============================================================= */
.promo-bar {
    background: #0A0A14;
    color: #fff;
    padding: 10px var(--space-6);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-3);
    font-size: 13px;
    font-weight: 500;
}
.promo-bar__icon {
    width: 22px;
    height: 22px;
    border-radius: 5px;
    background: linear-gradient(135deg, var(--brand), var(--gold));
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    flex-shrink: 0;
}
.promo-bar__cta {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.promo-bar__cta:hover { opacity: 0.85; }

/* =============================================================
   HERO SHOP — artístico con productos flotantes
   ============================================================= */
.hero-shop {
    position: relative;
    padding: clamp(40px, 6vw, 80px) var(--space-6) clamp(40px, 5vw, 60px);
    min-height: clamp(440px, 60vh, 640px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

.hero-shop__center {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 720px;
}
.hero-shop__logo {
    font-family: var(--font-sans);
    font-size: clamp(56px, 9vw, 110px);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--brand);
    margin-bottom: var(--space-6);
    user-select: none;
}
.hero-shop__logo .accent {
    background: linear-gradient(135deg, var(--brand), var(--gold));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-search {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 12px 12px 12px 28px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    box-shadow: 0 8px 30px rgba(10, 10, 20, 0.10);
    max-width: 560px;
    margin: 0 auto;
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.hero-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft), 0 8px 30px rgba(10, 10, 20, 0.10);
}
.hero-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 16px;
    color: var(--text);
    min-width: 0;
}
.hero-search input::placeholder { color: var(--text-faint); }
.hero-search button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background-color var(--t-fast), transform var(--t-fast);
}
.hero-search button:hover { background: var(--brand-hover); transform: scale(1.04); }

/* Productos flotantes en el hero */
.hero-shop__floats {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}
@media (max-width: 900px) {
    .hero-shop__floats { display: none; }
    .hero-shop { min-height: auto; }
}
.float-product {
    position: absolute;
    pointer-events: auto;
    background: var(--bg-elevated);
    border-radius: var(--r-md);
    padding: var(--space-3);
    box-shadow:
        0 12px 30px rgba(10, 10, 20, 0.10),
        0 4px 8px rgba(10, 10, 20, 0.04);
    width: 200px;
    transition: transform var(--t) var(--ease), box-shadow var(--t);
    text-decoration: none;
    color: var(--text);
}
.float-product:hover {
    transform: translateY(-4px) rotate(0deg) !important;
    box-shadow: 0 24px 50px rgba(10, 10, 20, 0.18);
    z-index: 5;
}
.float-product__media {
    aspect-ratio: 1 / 1;
    border-radius: var(--r);
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: var(--space-2);
}
.float-product__media img { width: 100%; height: 100%; object-fit: cover; }
.float-product__title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.float-product__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-dim);
}
.float-product__rating .stars { color: var(--gold); letter-spacing: 1px; }

/* Posiciones específicas */
.float-product--tl { top: 6%; left: 4%; transform: rotate(-4deg); }
.float-product--tr { top: 4%; right: 4%; transform: rotate(3deg); }
.float-product--bl { bottom: 8%; left: 7%; transform: rotate(3deg); width: 220px; }
.float-product--br { bottom: 10%; right: 5%; transform: rotate(-3deg); width: 200px; }

/* Producto decorativo (sin card, contorno) */
.deco-product {
    position: absolute;
    z-index: 1;
    pointer-events: none;
    filter: drop-shadow(0 16px 30px rgba(10, 10, 20, 0.18));
    transition: transform var(--t) var(--ease);
}
.deco-product img { width: 100%; height: 100%; object-fit: contain; }
.deco-product--top-mid { top: 8%; left: 50%; transform: translateX(-50%) rotate(-4deg); width: 160px; height: 160px; }
.deco-product--mid-left { top: 38%; left: 18%; width: 140px; height: 140px; transform: rotate(8deg); }
.deco-product--mid-right { top: 36%; right: 18%; width: 120px; height: 120px; transform: rotate(-6deg); }
@media (max-width: 1100px) { .deco-product--mid-left, .deco-product--mid-right { display: none; } }

/* =============================================================
   CATEGORY PILLS GRANDES (con iconos coloridos circulares)
   ============================================================= */
.cat-pills-big {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--space-4) var(--space-6);
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
.cat-pills-big::-webkit-scrollbar { display: none; }

.cat-pill-big {
    display: inline-flex;
    align-items: center;
    gap: var(--space-3);
    padding: 8px 24px 8px 8px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(10, 10, 20, 0.04);
}
.cat-pill-big:hover {
    transform: translateY(-2px);
    border-color: var(--border-strong);
    box-shadow: 0 8px 20px rgba(10, 10, 20, 0.08);
}
.cat-pill-big__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.cat-pill-big__icon svg { width: 22px; height: 22px; }
.cat-pill-big__icon img { width: 100%; height: 100%; object-fit: cover; }

/* Header del marketplace v2 */
.market-header {
    padding: var(--space-6) var(--space-6);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.market-header__title {
    font-size: clamp(24px, 2.4vw, 32px);
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
}
.market-search {
    flex: 1;
    min-width: 240px;
    max-width: 480px;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 14px 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    box-shadow: var(--shadow-sm);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.market-search:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-soft);
}
.market-search input {
    flex: 1;
    background: transparent;
    border: 0;
    outline: 0;
    font-size: 15px;
    color: var(--text);
    min-width: 0;
}
.market-search input::placeholder { color: var(--text-faint); }

/* Category pills grandes con avatar */
.cat-pills {
    display: flex;
    gap: var(--space-3);
    overflow-x: auto;
    scrollbar-width: none;
    padding: var(--space-3) var(--space-6) var(--space-5);
    align-items: center;
}
.cat-pills::-webkit-scrollbar { display: none; }

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: 6px 22px 6px 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    transition: transform var(--t-fast), border-color var(--t-fast), background-color var(--t-fast);
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
}
.cat-pill:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.cat-pill.is-active { background: var(--text); color: var(--bg); border-color: var(--text); }
.cat-pill__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    flex-shrink: 0;
}
.cat-pill__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Featured masonry/strip */
.featured-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
    padding: var(--space-2) var(--space-6) var(--space-8);
    align-items: start;
}
@media (min-width: 1024px) {
    .featured-strip {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-5);
    }
}

.float-card {
    border-radius: var(--r-lg);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    padding: var(--space-3);
    transition: transform var(--t) var(--ease), box-shadow var(--t);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}
.float-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}
.float-card--accent {
    background:
        linear-gradient(135deg, var(--brand-soft), transparent 70%),
        var(--bg-elevated);
}
.float-card__media {
    aspect-ratio: 1 / 1;
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--surface-2);
}
.float-card__media img { width: 100%; height: 100%; object-fit: cover; }
.float-card__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-inline: 4px;
}
.float-card__rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-dim);
    padding-inline: 4px;
}
.float-card__rating .stars { color: var(--gold); letter-spacing: 1px; }
.float-card__price { font-size: 14px; font-weight: 700; color: var(--text); padding-inline: 4px; }
.float-card__price s { font-size: 11px; color: var(--text-faint); margin-left: 6px; font-weight: 500; }
.float-card__brand { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; padding-inline: 4px; font-weight: 600; }

/* Section row carrusel */
.section-row {
    padding: var(--space-8) var(--space-6) var(--space-4);
}
.section-row__head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-5);
}
.section-row__title {
    font-size: clamp(22px, 2vw, 28px);
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}
.section-row__title svg { color: var(--text-faint); }
.section-row__nav {
    margin-left: auto;
    display: flex;
    gap: var(--space-2);
}
.section-row__nav button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
.section-row__nav button:hover { background: var(--surface-2); color: var(--text); }
.section-row__nav button:disabled { opacity: 0.4; cursor: default; }

/* Track horizontal scroll snap */
.subcat-track {
    display: flex;
    gap: var(--space-4);
    overflow-x: auto;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--space-2);
    scroll-behavior: smooth;
}
.subcat-track::-webkit-scrollbar { display: none; }

.subcat-tile {
    flex: 0 0 220px;
    scroll-snap-align: start;
    border-radius: var(--r-lg);
    overflow: hidden;
    position: relative;
    aspect-ratio: 3 / 4;
    background: var(--surface-2);
    transition: transform var(--t) var(--ease);
}
.subcat-tile:hover { transform: translateY(-3px); }
.subcat-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow) var(--ease);
}
.subcat-tile:hover img { transform: scale(1.04); }
.subcat-tile__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.75) 100%);
}
.subcat-tile__name {
    position: absolute;
    left: var(--space-4);
    bottom: var(--space-4);
    right: var(--space-4);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.subcat-tile__count {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: rgba(255,255,255,0.95);
    color: #0A0A14;
    padding: 3px 10px;
    border-radius: var(--r-pill);
    font-size: 11px;
    font-weight: 700;
}
@media (min-width: 640px) { .subcat-tile { flex: 0 0 240px; } }
@media (min-width: 1200px) { .subcat-tile { flex: 0 0 260px; } }

/* ─── Galería de producto: flechas, zoom, thumb activo ─── */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.92);
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    color: #1A1A1A;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity .2s;
    z-index: 3;
}
.detail__main:hover .gallery-nav { opacity: 1; }
.gallery-nav--prev { left: 10px; }
.gallery-nav--next { right: 10px; }
@media (hover: none) { .gallery-nav { opacity: 1; } }
.gallery-zoom-hint {
    position: absolute;
    bottom: 10px; right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    display: inline-flex; align-items: center; gap: 5px;
    z-index: 3;
    pointer-events: none;
}
.detail__thumbs img.thumb--active {
    outline: 2px solid var(--brand, #E84A1B);
    outline-offset: 1px;
    border-radius: 8px;
}
.detail__thumbs img { cursor: pointer; transition: opacity .15s; }
.detail__thumbs img:hover { opacity: .8; }
