/* ==========================================================================
   tienda.css - Tienda de afiliados (html/paginas/tienda.html)
   Requiere tokens.css, base.css, components.css y sesiones.css (page-hero).
   ========================================================================== */

.affiliate-note { margin: 18px 0 0; max-width: 86ch; font-size: 0.86rem; line-height: 1.55; }

/* ---------- Barra de filtros ---------- */
.shop-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 14px; }
.field { display: block; }
.input {
    width: 100%; min-width: 220px;
    background: var(--bg-card); color: var(--text);
    border: 1px solid var(--line); border-radius: 999px;
    padding: 11px 18px; font: 500 0.92rem var(--font);
}
.input:focus-visible { border-color: var(--brand); outline-offset: 2px; }
.shop-bar .field:first-child { flex: 1 1 260px; }
.price-field { display: flex; align-items: center; gap: 12px; color: var(--text-dim); font-size: 0.88rem; white-space: nowrap; }
.price-field input[type="range"] { accent-color: var(--brand); width: 160px; }

/* ---------- Tarjetas ---------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }

.product-card {
    display: flex; flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.2s var(--ease), border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); }

.product-media {
    position: relative; aspect-ratio: 1 / 1;
    background: #fff; /* fondo claro: las fotos de producto suelen venir sobre blanco */
    display: flex; align-items: center; justify-content: center;
}
.product-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-media .ph { color: #8a8a96; font-size: 2.4rem; }
.product-badge {
    position: absolute; top: 10px; left: 10px;
    background: var(--brand); color: #fff;
    font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
    padding: 4px 10px; border-radius: 999px;
}

.product-body { display: flex; flex-direction: column; gap: 8px; padding: 16px; flex: 1; }
.product-cat { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); }
.product-title {
    font-size: 0.95rem; font-weight: 600; line-height: 1.4; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.product-price { font-size: 1.3rem; font-weight: 800; margin-top: auto; }
.product-price small { font-size: 0.72rem; font-weight: 500; color: var(--text-faint); margin-left: 4px; }
.product-cta { margin-top: 4px; width: 100%; padding: 11px 16px; font-size: 0.88rem; }

/* ---------- Destacados (scroller horizontal) ---------- */
.offers {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 250px);
    gap: 18px; overflow-x: auto; scroll-snap-type: x proximity;
    padding: 4px 2px 14px; scrollbar-width: thin;
}
.offers .product-card { scroll-snap-align: start; }
.scroller-nav { display: flex; gap: 8px; }
.round-btn {
    width: 42px; height: 42px; border-radius: 50%;
    background: var(--bg-card); color: var(--text); border: 1px solid var(--line);
    font-size: 1.3rem; line-height: 1; cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.round-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.shop-empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--text-dim); }

@media (max-width: 520px) {
    .price-field { width: 100%; }
    .price-field input[type="range"] { flex: 1; width: auto; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
    .product-body { padding: 12px; }
    .product-title { font-size: 0.86rem; }
}
