/* ==========================================================
   La Tienda de Alex — Sistema de diseño
   Estilo: moderno y limpio. Superficies blancas, sombras
   suaves, esquinas redondeadas y acentos índigo/ámbar.
   ========================================================== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@600;700;800&display=swap');

:root {
  --ink: #0f172a;
  --ink-soft: #334155;
  --paper: #ffffff;
  --bg: #f4f6fa;
  --muted: #64748b;
  --line: #e4e8f0;
  --line-soft: #eef1f6;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --cyan: #0891b2;
  --accent: #f59e0b;
  --accent-soft: #fef3c7;
  --ok: #16a34a;
  --success: #16a34a;
  --danger: #dc2626;
  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.14);
  --max: 1240px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --display: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  line-height: 1.12;
  margin: 0 0 0.5em;
  letter-spacing: -0.03em;
}

.wrap {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.center {
  text-align: center;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 0.32rem 0.8rem;
  margin-bottom: 0.9rem;
}

/* ---------- botones ---------- */
.btn {
  --btn-bg: var(--brand);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.78rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: 0.94rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out),
    background 0.15s ease, border-color 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.25);
  background: var(--brand-dark);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.1);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-dark);
}

.btn-accent {
  background: var(--accent);
  color: #3b2f04;
}

.btn-accent:hover {
  background: #e08e00;
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.3);
}

.btn-dark {
  background: var(--ink);
  color: #fff;
}

.btn-dark:hover {
  background: #1e293b;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.3);
}

.btn-ghost,
.btn-outline {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--line);
}

.btn-ghost:hover,
.btn-outline:hover {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
}

.btn-whatsapp {
  background: #22c55e;
  color: #fff;
}

.btn-whatsapp:hover {
  background: #16a34a;
  box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
}

.btn-sm {
  padding: 0.5rem 0.95rem;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 0.95rem 1.7rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ---------- barra superior ---------- */
.topbar {
  background: var(--ink);
  color: #cbd5e1;
  font-size: 0.8rem;
  padding: 0.45rem 0;
}

.topbar .wrap,
.topbar-inner {
  display: flex;
  gap: 1.5rem;
  justify-content: center;
  flex-wrap: wrap;
}

.topbar b {
  color: #fff;
}

/* ---------- header ---------- */
.header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}

.header.scrolled {
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.08);
}

.header-inner,
.header > .wrap:first-child {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.7rem 0;
}

.header .wrap.nav {
  padding: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: -0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.logo-mark {
  width: 52px;
  height: 52px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  font-size: 1.15rem;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.logo-img {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  object-fit: contain;
}

.logo-text {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.logo small {
  display: block;
  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: -4px;
}

.search {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.55rem 1rem;
  max-width: 520px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.search:focus-within {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.search input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 0.92rem;
  padding: 0;
  box-shadow: none;
}

.search svg {
  flex: none;
  opacity: 0.5;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.icon-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s, color 0.15s, box-shadow 0.15s;
}

.icon-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
}

.nav {
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.5rem 0 !important;
  border-top: 1px solid var(--line-soft);
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.nav a {
  padding: 0.42rem 0.85rem;
  border-radius: 6px;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--ink-soft);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}

.nav a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav a.active {
  background: var(--ink);
  color: #fff;
}

/* ---------- secciones ---------- */
.section {
  padding: 3.75rem 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.section-head h2 {
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  font-weight: 800;
  margin: 0;
}

.section-head p {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

.link-more {
  font-weight: 600;
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: gap 0.2s ease;
}

.link-more:hover {
  gap: 0.6rem;
}

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

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.22s var(--ease-out), box-shadow 0.22s var(--ease-out),
    border-color 0.22s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}

.card-media {
  position: relative;
  display: block;
  aspect-ratio: 1;
  background: linear-gradient(160deg, #fbfcfe 0%, #f2f4f9 100%);
  overflow: hidden;
}

.card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.85rem;
  transition: transform 0.4s var(--ease-out);
}

.card:hover .card-media img {
  transform: scale(1.07);
}

.tag {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  z-index: 2;
  background: var(--ink);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.32rem 0.65rem;
  border-radius: 6px;
}

.tag-out {
  background: var(--danger);
}

.tag-new {
  background: var(--ok);
}

.badge {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.26rem 0.6rem;
  border-radius: 6px;
  margin: 0.5rem 0 0 0.5rem;
  box-shadow: var(--shadow-sm);
}

.badge-best {
  background: var(--accent-soft);
  color: #92610a;
}

.badge-offer {
  background: #fee2e2;
  color: var(--danger);
}

.badge-shipping {
  background: #dcfce7;
  color: var(--ok);
}

.badge-new {
  background: var(--brand-soft);
  color: var(--brand);
}

.badge-stock {
  background: #ffedd5;
  color: #c2410c;
}

.card-body {
  padding: 1rem 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.card-brand {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
}

.card-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.8em;
  transition: color 0.15s ease;
}

.card:hover .card-name {
  color: var(--brand);
}

.card-foot {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
}

.card .btn {
  padding: 0.5rem 0.9rem;
}

.card-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-price,
.price {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.card-price {
  font-size: 1.08rem;
}

.price-old,
.compare {
  font-size: 0.8rem;
  color: var(--muted);
  text-decoration: line-through;
  font-weight: 500;
}

.price-big {
  font-size: 2.1rem;
  margin: 0.5rem 0;
}

.card-installments {
  font-size: 0.8rem;
  color: var(--brand);
  font-weight: 600;
}

.card-installments .free {
  color: var(--ok);
}

.card-shipping {
  font-size: 0.76rem;
  color: var(--ok);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-delivery {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.card-stock-warning {
  font-size: 0.75rem;
  color: #c2410c;
  font-weight: 600;
}

.stock-off {
  opacity: 0.55;
}

.skeleton {
  background: linear-gradient(90deg, #eef1f6 25%, #e2e7ef 37%, #eef1f6 63%);
  background-size: 400% 100%;
  animation: sk 1.3s ease infinite;
  border-radius: var(--radius);
  height: 330px;
}

@keyframes sk {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------- animaciones de entrada ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- chips ---------- */
.chips {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.1rem;
}

.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.4rem 0.95rem;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

/* ---------- features ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.feature {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.feature b {
  display: block;
  font-family: var(--display);
  margin-bottom: 0.3rem;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.feature .ico,
.ico {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  font-size: 1.25rem;
  margin-bottom: 0.8rem;
}

/* ---------- secciones destacadas del catálogo ---------- */
.ml-section {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.ml-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ml-section-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.ml-section-title .icon {
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.ml-countdown {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.ml-countdown .time {
  background: var(--ink);
  color: #fff;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-weight: 700;
  font-family: 'SFMono-Regular', Consolas, monospace;
  font-size: 0.85rem;
}

/* ---------- sugerencias de búsqueda ---------- */
.search-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-height: 400px;
  overflow-y: auto;
  padding: 0.35rem;
}

.search-suggestions a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.65rem;
  border-radius: 5px;
  transition: background 0.1s ease;
}

.search-suggestions a:hover {
  background: var(--brand-soft);
}

.search-suggestions a img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--bg);
}

.search-suggestions a .sug-info {
  flex: 1;
  min-width: 0;
}

.search-suggestions a .sug-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-suggestions a .sug-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
}

.search-suggestions a .sug-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-weight: 700;
  margin: 0;
}

.search-suggestions .sug-empty {
  padding: 0.75rem 0.9rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-history {
  padding: 0.25rem 0;
}

.search-history-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 5px;
  font-size: 0.88rem;
  color: var(--muted);
  cursor: pointer;
}

.search-history-item:hover {
  background: var(--bg);
}

.search-history-item svg {
  opacity: 0.5;
}

/* ---------- catálogo ---------- */
.catalog {
  display: grid;
  grid-template-columns: 270px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.filters {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  position: sticky;
  top: 96px;
  display: grid;
  gap: 1.25rem;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line-soft);
}

.filters-head h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  margin: 0;
}

.filter-group {
  display: grid;
  gap: 0.5rem;
}

.filter-group h4 {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.filter-list {
  display: grid;
  gap: 0.15rem;
  max-height: 210px;
  overflow-y: auto;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

button.filter-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.filter-item:hover {
  background: var(--bg);
}

.filter-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.filter-item input[type='checkbox'] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.filter-item .count,
.count {
  margin-left: auto;
  font-size: 0.74rem;
  color: var(--muted);
  background: var(--bg);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
}

.price-range {
  display: grid;
  gap: 0.6rem;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.price-inputs input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  text-align: center;
}

.price-inputs span {
  color: var(--muted);
}

.check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  padding: 0.35rem 0;
  cursor: pointer;
}

.check input[type='checkbox'] {
  accent-color: var(--brand);
  width: 16px;
  height: 16px;
}

.filters input[type='range'] {
  width: 100%;
  accent-color: var(--brand);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
  background: #fff;
}

.view-btn {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--muted);
  transition: all 0.15s ease;
}

.view-btn.active {
  background: var(--ink);
  color: #fff;
}

/* grid vista lista */
.grid.list-view {
  grid-template-columns: 1fr;
}

.grid.list-view .card {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: stretch;
}

.grid.list-view .card-media {
  aspect-ratio: auto;
  min-height: 180px;
}

.grid.list-view .card-body {
  padding: 1.25rem 1.5rem;
}

.grid.list-view .card-name {
  -webkit-line-clamp: 3;
  font-size: 1.05rem;
}

.grid.list-view .card-foot {
  margin-top: 0.5rem;
}

/* ---------- formularios ---------- */
select,
input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
textarea {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  outline: none;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.field {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
}

.field small {
  color: var(--muted);
  font-size: 0.78rem;
}

.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

/* ---------- ficha de producto ---------- */
.product {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.gallery img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
}

.thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.thumb {
  width: 68px;
  height: 68px;
  border: 2px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s ease;
}

.thumb.active {
  border-color: var(--brand);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.variants {
  display: grid;
  gap: 0.5rem;
  margin: 1rem 0;
}

.variant {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.9rem;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
}

.variant:hover {
  border-color: var(--brand);
}

.variant.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.variant b {
  font-size: 0.9rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.qty button {
  width: 40px;
  height: 42px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.15s ease;
}

.qty button:hover {
  background: var(--bg);
}

.qty span {
  min-width: 40px;
  text-align: center;
  font-weight: 600;
}

.buy-row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  flex-wrap: wrap;
  margin: 1.25rem 0;
}

.accordion {
  border-top: 1px solid var(--line);
  margin-top: 1.5rem;
}

.accordion details {
  border-bottom: 1px solid var(--line);
  padding: 0.9rem 0;
}

.accordion summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
}

.accordion p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0.6rem 0 0;
}

/* ---------- carrito ---------- */
.cart-layout {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

.panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow-sm);
}

.line {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.line img {
  width: 84px;
  height: 84px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.35rem;
}

.line b {
  display: block;
  font-size: 0.95rem;
  line-height: 1.35;
}

.line .meta {
  font-size: 0.8rem;
  color: var(--muted);
}

.line-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.link-danger {
  background: none;
  border: 0;
  color: var(--danger);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 0;
}

.totals {
  display: grid;
  gap: 0.55rem;
  margin: 1rem 0;
}

.totals div {
  display: flex;
  justify-content: space-between;
  font-size: 0.95rem;
}

.totals .grand {
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 800;
}

.cart-line {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--line-soft);
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line-img img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  background: var(--bg);
  border-radius: 6px;
  padding: 0.4rem;
}

.cart-line-info {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.cart-line-name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  transition: color 0.15s ease;
}

.cart-line-name:hover {
  color: var(--brand);
}

.link {
  background: none;
  border: 0;
  padding: 0.2rem 0;
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

.link:hover {
  color: var(--danger);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.92rem;
  padding: 0.35rem 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid var(--line);
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
}

.progress {
  height: 8px;
  border-radius: 6px;
  background: var(--line-soft);
  overflow: hidden;
  margin: 0.5rem 0 0;
}

.progress-bar {
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--brand), #7c3aed);
}

/* ---------- footer ---------- */
.footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
}

.footer h4 {
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.8rem;
}

.footer a {
  transition: color 0.15s ease;
}

.footer a:hover {
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 2rem;
}

.footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.45rem;
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 2rem;
  padding-top: 1.2rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.83rem;
}

.pay-methods {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pay-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 0.3rem 0.6rem;
  font-size: 0.75rem;
  color: #e2e8f0;
}

/* ---------- whatsapp flotante ---------- */
.wa {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 70;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.4);
  transition: transform 0.2s var(--ease-spring);
}

.wa:hover {
  transform: scale(1.1);
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 150%);
  background: var(--ink);
  color: #fff;
  padding: 0.8rem 1.25rem;
  border-radius: 6px;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  transition: transform 0.3s var(--ease-spring);
  max-width: 90vw;
}

.toast.show {
  transform: translate(-50%, 0);
}

.toast.ok {
  background: var(--ok);
}

.toast.err {
  background: var(--danger);
}

.banner-demo {
  background: var(--accent-soft);
  color: #92610a;
  text-align: center;
  font-size: 0.85rem;
  padding: 0.55rem 1rem;
  font-weight: 500;
  margin: 0;
}

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

.empty .ico {
  font-size: 3rem;
  margin: 0 auto 0.5rem;
  background: none;
  width: auto;
  height: auto;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  padding: 1rem 0;
}

.breadcrumb a {
  transition: color 0.15s ease;
}

.breadcrumb a:hover {
  color: var(--brand);
}

/* ---------- scrollbar ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .product,
  .cart-layout,
  .catalog {
    grid-template-columns: 1fr;
  }

  .filters {
    position: static;
    max-height: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .grid.list-view .card {
    grid-template-columns: 140px 1fr;
  }
}

@media (max-width: 640px) {
  .search {
    display: none;
  }

  .topbar {
    font-size: 0.74rem;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .row-2 {
    grid-template-columns: 1fr;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.85rem;
  }

  .line {
    grid-template-columns: 64px 1fr;
  }

  .line img {
    width: 64px;
    height: 64px;
  }

  .cart-line {
    grid-template-columns: 64px 1fr;
    gap: 0.75rem;
  }

  .cart-line-img img {
    width: 64px;
    height: 64px;
  }

  .toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-right {
    width: 100%;
    justify-content: space-between;
  }

  .grid.list-view .card {
    grid-template-columns: 1fr;
  }

  .grid.list-view .card-media {
    aspect-ratio: 1;
  }

  .ml-section {
    padding: 1rem;
  }

  .ml-countdown {
    display: none;
  }
}
/* Ajustes de tienda: una base clara, sobria y centrada en el producto. */
:root {
  --ink: #17211d;
  --ink-soft: #48564f;
  --bg: #f6f7f5;
  --line: #e4e8e3;
  --line-soft: #eff1ee;
  --brand: #176b52;
  --brand-dark: #105740;
  --brand-soft: #eaf4ef;
  --accent: #f2c94c;
  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --shadow-sm: 0 2px 8px rgba(23, 33, 29, .05);
  --shadow: 0 8px 24px rgba(23, 33, 29, .08);
}

.topbar { background: #173b30; color: #fff; }
.header { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); box-shadow: none; }
.logo-mark { background: var(--brand); }
.card { border: 1px solid var(--line); box-shadow: none; transition: box-shadow .2s ease, transform .2s ease; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.card-media { background: #fff; }
.card-media img { mix-blend-mode: multiply; }
.card-buy-actions { display: flex; align-items: center; gap: .55rem; margin-top: .8rem; }
.card-buy-actions .btn { flex: 1; }
.card-description { margin: 0; color: var(--muted); font-size: .82rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-stock { color: var(--brand); font-size: .9rem; font-weight: 600; margin: .25rem 0; }
.filters-head { position: sticky; top: 0; z-index: 1; background: #fff; }
.filter-item[data-cat] { user-select: none; }
.filter-item[data-cat]:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.card-quantity { display: flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .75rem; }
.card-quantity input { width: 3.35rem; padding: .45rem .3rem; border: 1px solid var(--line); border-radius: 7px; text-align: center; background: #fff; }
.card-foot { display: block; }
.cart-line { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.panel { border: 1px solid var(--line); box-shadow: var(--shadow-sm); }
.btn { border-radius: 8px; }
.btn-accent { background: #f2c94c; color: #263126; }
.btn-accent:hover { background: #e7bb36; }
.product .gallery { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.product .gallery > img { mix-blend-mode: multiply; }
.breadcrumb { color: var(--muted); }

@media (max-width: 520px) {
  .card-buy-actions { align-items: stretch; flex-wrap: wrap; }
  .card-buy-actions .btn { min-width: 100%; }
}

@media (max-width: 640px) {
  .cart-line { grid-template-columns: 64px minmax(0, 1fr); align-items: start; }
  .cart-line-img { grid-row: span 2; }
  .cart-line-info { grid-column: 2; }
  .cart-line > div:last-child { grid-column: 2; text-align: left !important; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
  .cart-line > div:last-child .price { margin-right: auto; }
  .cart-layout > aside { position: static; }
}
