/* ===== Storefront — Tienda pública (estilo e-commerce denso, paleta ML) =====
 *
 * Referencia de diseño: grilla comercial densa estilo Tiendanube "Toluca",
 * con la identidad de color de MercadoLibre (azul #3483FA + amarillo #FFE600).
 *
 *  - Tipografía Kanit (Google Fonts) con fallbacks de sistema.
 *  - Radios chicos (4px), cards planas sin borde, separación por spacing.
 *  - Mobile-first: breakpoints 480 / 768 / 1024.
 *  - Touch targets >= 40px, :focus-visible, prefers-reduced-motion.
 *  - Safe areas para la barra sticky de CTA en mobile.
 */

/* --- Tokens --- */
:root {
    --st-primary: #3483FA;
    --st-primary-dark: #2968C8;
    --st-primary-soft: #eaf2fe;
    --st-accent: #FFE600;
    --st-bg: #f5f6f8;
    --st-surface: #ffffff;
    --st-text: #333333;
    --st-text-light: #666666;
    --st-text-muted: #999999;
    --st-border: #e6e6e6;
    --st-success: #00a650;
    --st-danger: #d9534f;
    --st-warning: #f39c12;
    --st-radius: 4px;
    --st-radius-sm: 3px;
    --st-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --st-shadow-md: 0 6px 18px rgba(0, 0, 0, 0.12);
    --st-gap: 1rem;
    --st-font: "Kanit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* --- Base --- */
body {
    background: var(--st-bg);
    color: var(--st-text);
    font-family: var(--st-font);
    font-size: 14px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
}

h1, h2, h3 { font-weight: 700; }

/* --- Skip link (a11y) --- */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--st-primary);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 0 0 var(--st-radius-sm) 0;
    z-index: 999;
    font-size: 0.9rem;
}
.skip-link:focus {
    left: 0;
    color: #fff;
    text-decoration: none;
}

/* ==================================================================
 * Barra de anuncios (configurable desde /admin/store-config)
 * ================================================================== */
.adbar {
    background: var(--st-primary-dark);
    color: #fff;
    text-align: center;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
}

/* ==================================================================
 * Header: fila principal azul + fila blanca de navegación
 * ================================================================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--st-shadow-sm);
}

.header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--st-primary);
    color: #fff;
    padding: 0.6rem 1rem;
}

.brand {
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}
.brand:hover { color: #fff; text-decoration: none; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    min-width: 40px;
    min-height: 40px;
    border-radius: var(--st-radius);
}
.icon-btn:hover { background: rgba(255, 255, 255, 0.15); }

/* Buscador central (desktop) / oculto en mobile (va en el drawer) */
.header-search {
    position: relative;
    flex: 1;
    max-width: 520px;
    margin: 0 auto;
    display: none;
}
.header-search input {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: var(--st-radius);
    padding: 0 42px 0 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--st-text);
}
.header-search input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}
.header-search button {
    position: absolute;
    right: 4px;
    top: 4px;
    bottom: 4px;
    width: 34px;
    border: none;
    background: transparent;
    color: var(--st-text-muted);
    cursor: pointer;
    border-radius: var(--st-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}
.header-search button:hover { color: var(--st-primary); }

.cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    min-width: 44px;
    min-height: 44px;
    border-radius: var(--st-radius);
}
.cart-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.cart-badge {
    position: absolute;
    top: 2px;
    right: 0;
    background: var(--st-accent);
    color: #333;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Fila blanca de navegación (solo desktop; en mobile hay drawer) */
.header-nav { display: none; background: var(--st-surface); border-bottom: 1px solid var(--st-border); }
.header-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: stretch;
    gap: 1.25rem;
}
.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--st-text);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.65rem 0;
    border-bottom: 2px solid transparent;
}
.nav-link:hover { color: var(--st-primary); text-decoration: none; border-bottom-color: var(--st-primary); }

.nav-dropdown { position: relative; display: flex; }
.nav-drop-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: none;
    color: var(--st-text);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.65rem 0;
}
.nav-drop-btn:hover { color: var(--st-primary); }
.nav-drop-btn .chev { transition: transform 0.2s; }
.nav-dropdown.open .chev { transform: rotate(180deg); }
.nav-drop-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 230px;
    background: var(--st-surface);
    border-radius: 0 0 var(--st-radius) var(--st-radius);
    box-shadow: var(--st-shadow-md);
    padding: 0.4rem 0;
    z-index: 60;
}
.nav-dropdown.open .nav-drop-panel { display: block; }
.nav-drop-panel a {
    display: block;
    padding: 0.55rem 1rem;
    color: var(--st-text);
    font-size: 0.88rem;
    text-decoration: none;
}
.nav-drop-panel a:hover { background: var(--st-primary-soft); color: var(--st-primary-dark); text-decoration: none; }

@media (min-width: 768px) {
    .header-burger { display: none; }
    .header-search { display: block; }
    .header-nav { display: block; }
}

/* ==================================================================
 * Drawer mobile
 * ================================================================== */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.22s;
}
.drawer-overlay.open { opacity: 1; }

.drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(320px, 85vw);
    background: var(--st-surface);
    z-index: 100;
    transform: translateX(-105%);
    transition: transform 0.22s ease-out;
    overflow-y: auto;
    overscroll-behavior: contain;
}
.drawer.open { transform: translateX(0); box-shadow: var(--st-shadow-md); }

.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--st-primary);
    color: #fff;
    padding: 0.75rem 1rem;
}
.drawer-title { font-weight: 700; font-size: 1rem; }

.drawer-search {
    position: relative;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--st-border);
}
.drawer-search input {
    width: 100%;
    height: 40px;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 0 42px 0 12px;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--st-text);
}
.drawer-search input:focus {
    outline: none;
    border-color: var(--st-primary);
    box-shadow: 0 0 0 3px var(--st-primary-soft);
}
.drawer-search button {
    position: absolute;
    right: calc(1rem + 4px);
    top: calc(0.75rem + 4px);
    bottom: calc(0.75rem + 4px);
    width: 34px;
    border: none;
    background: transparent;
    color: var(--st-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drawer-nav { padding-bottom: 1rem; }
.drawer-nav a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--st-text);
    font-size: 0.95rem;
    text-decoration: none;
    border-bottom: 1px solid #f2f2f2;
}
.drawer-nav a:hover { background: var(--st-primary-soft); color: var(--st-primary-dark); text-decoration: none; }
.drawer-section {
    margin: 0;
    padding: 0.9rem 1rem 0.3rem;
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--st-text-muted);
}

/* ==================================================================
 * Container / secciones
 * ================================================================== */
.store-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
    flex: 1;
}

.store-section { margin-top: 1.75rem; }
.section-title { font-size: 1.125rem; margin: 0 0 0.75rem; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.section-head .section-title { margin: 0; }
.section-arrows { display: none; gap: 0.4rem; }
.arrow-btn {
    border: 1px solid var(--st-border);
    background: var(--st-surface);
    color: var(--st-text);
    min-width: 36px;
    min-height: 36px;
}
.arrow-btn:hover { border-color: var(--st-primary); color: var(--st-primary); background: var(--st-surface); }
@media (min-width: 768px) {
    .section-arrows { display: flex; }
}

.results-heading { font-size: 1.25rem; margin: 0.25rem 0 0.75rem; }

.page-head { text-align: center; padding: 1.25rem 0 0.75rem; }
.page-head h1 { font-size: clamp(1.4rem, 4vw, 1.75rem); margin-bottom: 0.25rem; }
.page-head p { color: var(--st-text-light); font-size: 0.95rem; }

/* --- Hero landing --- */
.hero {
    background: linear-gradient(135deg, var(--st-primary) 0%, var(--st-primary-dark) 100%);
    color: #fff;
    text-align: center;
    padding: 3rem 1rem;
    border-radius: var(--st-radius);
}
.hero-inner h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); margin-bottom: 0.35rem; }
.hero-inner p { font-size: 0.95rem; opacity: 0.92; margin-bottom: 1.25rem; }
.btn-hero {
    background: #fff;
    color: var(--st-primary-dark);
    font-weight: 700;
}
.btn-hero:hover { background: #f0f4ff; color: var(--st-primary-dark); }

/* ==================================================================
 * Botones
 * ================================================================== */
.btn-primary,
.btn-store {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--st-primary);
    color: #fff;
    padding: 0.6rem 1.1rem;
    border: none;
    border-radius: var(--st-radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover,
.btn-store:hover { background: var(--st-primary-dark); color: #fff; text-decoration: none; }
.btn-primary:active,
.btn-store:active { transform: scale(0.98); }
.btn-primary:disabled,
.btn-store:disabled { opacity: 0.6; cursor: wait; }

.btn-outline,
.btn-store-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--st-primary);
    padding: 0.6rem 1.1rem;
    border: 1px solid var(--st-primary);
    border-radius: var(--st-radius);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    min-height: 44px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.btn-outline:hover,
.btn-store-outline:hover { background: var(--st-primary); color: #fff; text-decoration: none; }

.btn-block { display: flex; width: 100%; }
.btn-sm { padding: 0.35rem 0.7rem; min-height: 36px; font-size: 0.82rem; }
.btn-danger-ghost { color: var(--st-danger); border-color: var(--st-danger); }
.btn-danger-ghost:hover { background: var(--st-danger); color: #fff; }

/* ==================================================================
 * Toolbar de filtros horizontal
 * ================================================================== */
.filter-toolbar {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 0.75rem;
    margin-bottom: 1rem;
}
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}
.filter-form .filter-input { flex: 1 1 200px; }
.filter-form .filter-select { flex: 0 1 175px; width: auto; }
.filter-form .btn { flex-shrink: 0; }

.filter-input,
.filter-select {
    padding: 0.55rem 0.65rem;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--st-text);
    background: var(--st-surface);
    min-height: 40px;
}
.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--st-primary);
    box-shadow: 0 0 0 3px var(--st-primary-soft);
}
.filter-input-sm { min-height: auto; }

.filter-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--st-primary-soft);
    color: var(--st-primary-dark);
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    text-decoration: none;
    min-height: 30px;
}
.filter-chip:hover { background: var(--st-primary); color: #fff; text-decoration: none; }

.catalog-results { margin-bottom: 0.6rem; color: var(--st-text-light); font-size: 0.85rem; }

/* ==================================================================
 * Grilla de productos + carrusel horizontal con "peek"
 * ================================================================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}
@media (min-width: 480px) {
    .product-grid { gap: 1rem; }
}
@media (min-width: 768px) {
    .product-grid { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
}
@media (min-width: 1024px) {
    .product-grid { grid-template-columns: repeat(4, 1fr); }
}

.h-scroll {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 44%;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}
.h-scroll > * { scroll-snap-align: start; }
@media (min-width: 480px) {
    .h-scroll { grid-auto-columns: 31%; }
}
@media (min-width: 768px) {
    .h-scroll { grid-auto-columns: 23.5%; }
}
@media (min-width: 1024px) {
    .h-scroll { grid-auto-columns: 18.4%; }
}

/* --- Card plana estilo catálogo comercial --- */
.product-card {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    overflow: hidden;
    color: var(--st-text);
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}
.product-card:hover { box-shadow: var(--st-shadow-md); }

.product-card-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--st-bg);
}
.product-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.flag-off {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--st-accent);
    color: #333;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.45rem;
    border-radius: var(--st-radius-sm);
    z-index: 2;
}

.product-card-body {
    padding: 0.6rem 0.7rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.product-card-name {
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--st-text);
    text-decoration: none;
    margin-bottom: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
}
.product-card-name:hover { color: var(--st-primary); text-decoration: none; }

.product-card-price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.55rem;
    margin-top: auto;
}
.price-final { font-size: 1.05rem; font-weight: 700; color: var(--st-text); }
.price-compare {
    font-size: 0.75rem;
    color: var(--st-text-muted);
    text-decoration: line-through;
}
.chip-off {
    display: inline-block;
    background: var(--st-accent);
    color: #333;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: var(--st-radius-sm);
}

.btn-buy { min-height: 40px; font-size: 0.82rem; font-weight: 700; }

/* --- Link de origen (Publicación en Mercado Libre) --- */
.origin-link {
    display: inline-block;
    font-size: 0.72rem;
    color: var(--st-text-light);
    text-decoration: none;
    margin: 0.25rem 0 0.45rem;
}
.origin-link:hover { color: var(--st-primary); text-decoration: underline; }

/* --- Tienda Mayorista: listado imagen · producto · precio --- */
.wholesale-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.wholesale-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 0.6rem 0.9rem;
    text-decoration: none;
    color: var(--st-text);
    box-shadow: var(--st-shadow-sm);
    transition: box-shadow 0.15s;
}
.wholesale-row:hover { box-shadow: var(--st-shadow-md); color: var(--st-text); text-decoration: none; }
.wholesale-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--st-radius-sm);
    object-fit: cover;
    background: var(--st-bg);
    flex-shrink: 0;
}
.wholesale-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.wholesale-title {
    font-size: 0.92rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wholesale-id { color: var(--st-text-muted); font-size: 0.75rem; }
.wholesale-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--st-primary-dark);
    white-space: nowrap;
}
.wholesale-cta-hint {
    font-size: 0.85rem;
    color: var(--st-text-light);
    background: var(--st-primary-soft);
    border-radius: var(--st-radius);
    padding: 0.6rem 0.8rem;
    margin: 0.5rem 0;
}

/* --- Paginación --- */
.store-pagination { display: flex; align-items: center; justify-content: center; gap: 0.75rem; margin-top: 1.5rem; flex-wrap: wrap; }
.page-info { font-size: 0.9rem; color: var(--st-text-light); }

/* --- Empty / 404 --- */
.store-empty { text-align: center; padding: 3rem 1rem; color: var(--st-text-light); }
.store-empty svg { color: #bbb; margin-bottom: 0.5rem; }
.store-empty h1 { font-size: 2rem; color: var(--st-text); margin-bottom: 0.5rem; }
.store-empty h2 { font-size: 1.2rem; color: var(--st-text); margin-bottom: 0.5rem; }

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #bbb;
    font-size: 0.7rem;
    background: var(--st-bg);
}
.no-image-lg { height: 260px; font-size: 1rem; }

/* ==================================================================
 * Detalle de producto
 * ================================================================== */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--st-text-muted);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.breadcrumb a { color: var(--st-text-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--st-primary); text-decoration: none; }
.breadcrumb [aria-current] { color: var(--st-text-muted); }

.product-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1rem;
}
@media (min-width: 768px) {
    .product-detail { grid-template-columns: 1fr 1fr; gap: 2rem; padding: 1.5rem; }
}

.product-detail-gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fafafa;
    border-radius: var(--st-radius);
    padding: 0.5rem;
}
.gallery-img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
    border-radius: var(--st-radius-sm);
}

.product-detail-info { display: flex; flex-direction: column; gap: 0.75rem; }
.product-detail-title { font-size: clamp(1.25rem, 3vw, 1.5rem); line-height: 1.25; }
.product-detail-condition { color: var(--st-success); font-size: 0.8rem; font-weight: 500; margin: 0; }

.product-detail-price { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.price-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.price-final-lg { font-size: clamp(1.8rem, 6vw, 2.4rem); font-weight: 700; color: var(--st-text); line-height: 1; }
.price-compare { font-size: 1rem; color: var(--st-text-muted); text-decoration: line-through; }

.qty-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }
.qty-row label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--st-text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.qty-input {
    width: 72px;
    padding: 0.5rem;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    font-family: inherit;
    font-size: 0.95rem;
    text-align: center;
    min-height: 44px;
}
.qty-input:focus { outline: none; border-color: var(--st-primary); box-shadow: 0 0 0 3px var(--st-primary-soft); }

.product-detail-cta-form { margin-top: 0.5rem; }
.product-detail-actions { margin-top: 0.25rem; }
.store-link { font-size: 0.85rem; color: var(--st-primary); }

.product-description {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.25rem;
    margin-top: 1.25rem;
}
.product-description h2 { font-size: 1.05rem; margin-bottom: 0.75rem; }
.description-content { white-space: pre-wrap; font-size: 0.9rem; line-height: 1.6; color: var(--st-text-light); }

/* --- Sticky CTA mobile (detalle) --- */
.store-sticky-cta { display: none; }
@media (max-width: 767px) {
    .store-sticky-cta {
        display: flex;
        position: sticky;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 40;
        background: var(--st-surface);
        border-top: 1px solid var(--st-border);
        padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.06);
    }
    .product-detail-cta-form .product-detail-cta { margin-bottom: 0; }
}

/* ==================================================================
 * Carrito
 * ================================================================== */
.cart-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) {
    .cart-layout { grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
}
.cart-items { display: flex; flex-direction: column; gap: 0.75rem; }
.cart-item {
    display: flex;
    gap: 0.9rem;
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 0.9rem;
    align-items: center;
}
.cart-item-img {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: var(--st-radius-sm);
    overflow: hidden;
    background: var(--st-bg);
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h3 { font-size: 0.9rem; margin-bottom: 0.25rem; font-weight: 500; }
.cart-item-info h3 a { color: var(--st-text); }
.cart-item-price { color: var(--st-primary); font-weight: 700; }
.cart-item-qty { color: var(--st-text-light); font-size: 0.8rem; }
.cart-item-actions { flex-shrink: 0; }

.cart-summary {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.25rem;
}
@media (min-width: 768px) {
    .cart-summary { position: sticky; top: 130px; }
}
.cart-summary h3 { margin-bottom: 0.75rem; }
.cart-summary-row { display: flex; justify-content: space-between; padding: 0.4rem 0; font-size: 0.9rem; }
.cart-total { font-weight: 700; font-size: 1.1rem; border-top: 1px solid var(--st-border); padding-top: 0.75rem; margin-top: 0.5rem; }
.cart-summary-actions { display: flex; flex-direction: column; gap: 0.5rem; margin-top: 1rem; }

/* ==================================================================
 * Checkout
 * ================================================================== */
.checkout-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }
@media (min-width: 768px) {
    .checkout-layout { grid-template-columns: 1fr 360px; gap: 1.5rem; align-items: start; }
}
.checkout-form {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.25rem;
}
.checkout-form h3 { margin-bottom: 1rem; }
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--st-text-light);
    margin-bottom: 0.3rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.checkout-summary {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.25rem;
}
@media (min-width: 768px) {
    .checkout-summary { position: sticky; top: 130px; }
}
.checkout-summary h3 { margin-bottom: 0.75rem; }
.checkout-item {
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--st-border);
    font-size: 0.85rem;
}
.checkout-item-title { font-weight: 500; }
.checkout-item-qty { color: var(--st-text-light); font-size: 0.8rem; }

/* --- Success / order card --- */
.order-card {
    max-width: 600px;
    margin: 0 auto;
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    box-shadow: var(--st-shadow-sm);
}
.order-success-icon { display: inline-block; line-height: 0; }

/* ==================================================================
 * Footer institucional
 * ================================================================== */
.site-footer {
    background: var(--st-primary);
    color: #fff;
    margin-top: 2.5rem;
}
.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .footer-grid { grid-template-columns: repeat(3, 1fr); }
}
.footer-brand { font-weight: 700; font-size: 1.1rem; margin: 0 0 0.35rem; }
.footer-title {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    opacity: 0.85;
    margin: 0 0 0.5rem;
}
.footer-col a {
    display: block;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.88rem;
    padding: 0.2rem 0;
    text-decoration: none;
}
.footer-col a:hover { color: #fff; text-decoration: underline; }
.footer-muted { font-size: 0.82rem; opacity: 0.8; margin: 0; }
.footer-legal {
    background: var(--st-primary-dark);
    text-align: center;
    font-size: 0.75rem;
    padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
}

/* ==================================================================
 * Cupón de descuento (checkout) — CUPO-9m2q
 * ================================================================== */
.coupon-box { padding: 0.6rem 0; border-bottom: 1px solid var(--st-border); }
.coupon-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--st-text-light);
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.coupon-applied {
    background: var(--st-primary-soft);
    border-radius: var(--st-radius);
    padding: 0.6rem 0.75rem;
}
.coupon-badge {
    display: inline-block;
    background: var(--st-accent);
    color: #333;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--st-radius-sm);
    margin-bottom: 0.25rem;
}
.coupon-saving { color: var(--st-success); font-size: 0.85rem; margin: 0.1rem 0 0.25rem; }

/* ==================================================================
 * Toast (feedback de carrito)
 * ================================================================== */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 16px);
    background: #333;
    color: #fff;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 0.7rem 1.25rem;
    border-radius: var(--st-radius);
    box-shadow: var(--st-shadow-md);
    z-index: 110;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ==================================================================
 * WhatsApp FAB (configurable desde /admin/store-config)
 * ================================================================== */
.wa-fab {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--st-shadow-md);
    z-index: 80;
    text-decoration: none;
    transition: background 0.2s, transform 0.15s;
}
.wa-fab:hover { background: #128C7E; color: #fff; text-decoration: none; transform: scale(1.05); }
.wa-fab:active { transform: scale(0.97); }
.wa-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px #25D366; }
@media (max-width: 767px) {
    .wa-fab { right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}

/* --- Focus visible (a11y) --- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
    outline: 3px solid var(--st-primary);
    outline-offset: 2px;
    border-radius: var(--st-radius-sm);
}

/* ==================================================================
 * Políticas — Cambios y devoluciones (AR)
 * ================================================================== */
.policy-page {
    background: var(--st-surface);
    border-radius: var(--st-radius);
    padding: 1.5rem;
    max-width: 860px;
    margin: 0 auto;
    box-shadow: var(--st-shadow-sm);
    line-height: 1.7;
    font-size: 0.92rem;
}
.policy-page h2 { font-size: 1.15rem; margin: 0 0 0.6rem; line-height: 1.3; }
.policy-page h3 { font-size: 1rem; margin: 0 0 0.5rem; }
.policy-page p { margin: 0 0 0.75rem; color: var(--st-text); }
.policy-page ul, .policy-page ol { margin: 0 0 0.9rem 1.2rem; }
.policy-page li { margin-bottom: 0.3rem; }
.policy-page a { color: var(--st-primary); }
.policy-page a:hover { color: var(--st-primary-dark); }

.policy-callout {
    background: var(--st-primary-soft);
    border-left: 4px solid var(--st-primary);
    border-radius: var(--st-radius);
    padding: 1rem 1.1rem;
    margin-bottom: 1.25rem;
}
.policy-callout ul { margin-bottom: 0.45rem; }
.policy-muted { color: var(--st-text-light); font-size: 0.85rem; }
.policy-link { font-weight: 600; }

.policy-toc {
    background: #fafcff;
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 0.9rem 1rem;
    margin-bottom: 1.5rem;
}
.policy-toc-title { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--st-text-muted); margin: 0 0 0.4rem; }
.policy-toc ol { margin: 0 0 0 1.1rem; padding: 0; }
.policy-toc li { margin: 0.2rem 0; font-size: 0.88rem; }
.policy-toc a { text-decoration: none; color: var(--st-text); }
.policy-toc a:hover { color: var(--st-primary); text-decoration: underline; }

.policy-section { margin-bottom: 1.6rem; }
.policy-section + .policy-section { border-top: 1px solid var(--st-border); padding-top: 1.4rem; }

.policy-alert {
    background: #fff8e1;
    border: 1px solid #ffecb3;
    border-radius: var(--st-radius);
    padding: 0.7rem 0.9rem;
    font-size: 0.88rem;
    margin: 0.6rem 0 0;
}
.policy-alert a { font-weight: 600; }

.policy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.7rem 0;
    font-size: 0.88rem;
}
.policy-table th, .policy-table td {
    border: 1px solid var(--st-border);
    padding: 0.55rem 0.6rem;
    text-align: left;
}
.policy-table th { background: var(--st-bg); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
.policy-table td { background: var(--st-surface); }

.policy-steps { counter-reset: step; list-style: none; margin-left: 0; padding: 0; }
.policy-steps li { counter-increment: step; padding-left: 2rem; position: relative; margin-bottom: 0.6rem; }
.policy-steps li::before {
    content: counter(step);
    position: absolute; left: 0; top: 0;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--st-primary); color: #fff;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.78rem; font-weight: 700;
}

.policy-form-box {
    background: var(--st-bg);
    border: 1px solid var(--st-border);
    border-radius: var(--st-radius);
    padding: 1rem;
    margin-top: 0.9rem;
}
.policy-form-box h3 { display: flex; align-items: center; gap: 0.5rem; }
.policy-badge {
    display: inline-block;
    background: var(--st-accent);
    color: #333;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: var(--st-radius-sm);
    letter-spacing: 0.04em;
}
.policy-form label { font-size: 0.78rem; font-weight: 600; color: var(--st-text-light); text-transform: uppercase; letter-spacing: 0.03em; }
@media (max-width: 600px) {
    .policy-page { padding: 1.1rem; }
    .policy-form .form-row { grid-template-columns: 1fr !important; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
