/* ===== Variables / temas ===== */
:root {
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #f4f4f5;
  --muted-fg: #6b7280;
  --card: #ffffff;
  --border: #e4e4e7;
  --primary: #1577cc;
  --primary-hover: #1268b4;
  --primary-fg: #ffffff;
  --danger: #e0463c;
  --radius: 12px;
  --max: 1120px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
:root[data-theme="dark"] {
  --bg: #0a0a0a;
  --fg: #fafafa;
  --muted: #1f1f22;
  --muted-fg: #a1a1aa;
  --card: #161618;
  --border: rgba(255, 255, 255, 0.12);
  --primary: #2f97e6;
  --primary-hover: #4aa6ec;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }
main { flex: 1; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted-fg); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===== Botones ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 18px;
  font-weight: 600; font-size: 15px; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-outline { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-outline:hover { background: var(--muted); }
.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--muted); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 12px; font-size: 14px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-light { background: rgba(255,255,255,.12); color:#fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.btn-light:hover { background: rgba(255,255,255,.22); }

/* ===== Promo bar (marquee) ===== */
.promo { background: var(--primary); color: #fff; overflow: hidden; border-bottom: 1px solid var(--border); }
.promo__track { display: flex; width: max-content; white-space: nowrap; padding: 9px 0; animation: marquee 48s linear infinite; }
.promo__item { display: inline-flex; align-items: center; font-size: 13px; font-weight: 500; }
.promo__item::before { content: ""; display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: rgba(255,255,255,.5); margin: 0 28px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .promo__track { animation: none; } }

/* ===== Navbar ===== */
.header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.nav { position: relative; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand img { width: 36px; height: 36px; object-fit: contain; }
.nav__links { display: flex; align-items: center; list-style: none; }
.nav__links a, .nav__trigger { display: inline-flex; align-items: center; gap: 4px; height: 64px; padding: 0 14px; font-size: 14px; font-weight: 500; color: color-mix(in srgb, var(--fg) 80%, transparent); background: none; border: none; }
.nav__links a:hover, .nav__trigger:hover { color: var(--fg); }
.nav__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: none; border: none; color: var(--fg); position: relative; }
.icon-btn:hover { background: var(--muted); }
.cart-count { position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--primary); color: #fff; font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Mega-menú */
.megawrap { position: static; }
.mega { position: absolute; left: 0; right: 0; top: 64px; z-index: 60; padding-top: 0; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .2s; }
.megawrap:hover .mega { opacity: 1; visibility: visible; transform: translateY(0); }
.mega__inner { display: grid; grid-template-columns: 1fr 1fr 1fr 1.3fr; gap: 24px; background: var(--bg); border: 1px solid var(--border); border-top: none; border-radius: 0 0 16px 16px; box-shadow: var(--shadow); padding: 22px; }
.mega h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 8px; }
.mega a { display: block; padding: 6px 0; font-size: 14px; color: var(--muted-fg); }
.mega a:hover { color: var(--fg); }
.mega a.is-hot { color: var(--danger); font-weight: 600; }
.mega__promo { position: relative; border-radius: 12px; overflow: hidden; min-height: 150px; }
.mega__promo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.mega__promo span { position: relative; display: inline-block; margin: 12px; padding: 3px 10px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; }
.mega__promo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,.7), transparent); }

/* Menú mobile */
.nav__toggle { display: none; }
.mobile-menu { display: none; flex-direction: column; gap: 2px; padding: 12px 20px 20px; border-top: 1px solid var(--border); }
.mobile-menu.open { display: flex; }
.mobile-menu a { padding: 10px 8px; border-radius: 8px; font-size: 15px; }
.mobile-menu a:hover { background: var(--muted); }
.mobile-menu .grp { font-size: 12px; text-transform: uppercase; color: var(--muted-fg); margin-top: 10px; padding: 0 8px; font-weight: 700; }

/* ===== Hero ===== */
.hero { position: relative; display: flex; align-items: center; min-height: 480px; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1.05) scaleY(1.05); filter: blur(3px); }
.hero__scrim { position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,.85), rgba(0,0,0,.6) 50%, rgba(0,0,0,.25)); }
.hero__content { position: relative; max-width: 560px; padding: 56px 0; }
.hero .pill { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); color: #fff; border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 500; backdrop-filter: blur(6px); }
.hero h1 { color: #fff; font-size: clamp(34px, 5vw, 52px); line-height: 1.05; margin: 16px 0 12px; letter-spacing: -.02em; }
.hero p { color: rgba(255,255,255,.8); max-width: 420px; margin-bottom: 24px; }
.hero__btns { display: flex; gap: 12px; flex-wrap: wrap; }

/* ===== Secciones ===== */
.section { padding: 64px 0; }
.tag { display: inline-block; background: var(--primary); color: #fff; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; padding: 6px 14px; border-radius: 8px; }
.section__head { text-align: center; max-width: 640px; margin: 0 auto 36px; }
.section__head h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.02em; }
.section__head p { margin-top: 12px; color: var(--muted-fg); }
.pill-danger { display:inline-flex; align-items:center; gap:6px; border:1px solid color-mix(in srgb, var(--danger) 30%, transparent); background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); font-size:12px; font-weight:700; padding:4px 12px; border-radius:999px; }

/* Mosaicos de categoría */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 24px; }
.tile { position: relative; aspect-ratio: 4/3; border-radius: 14px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.tile:hover img { transform: scale(1.1); }
.tile::after { content: ""; position: absolute; inset: 0; background: rgba(0,0,0,.4); transition: background .3s; }
.tile:hover::after { background: rgba(0,0,0,.55); }
.tile span { position: relative; z-index: 1; color: #fff; font-size: 28px; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.5); }

/* Ofertas / grilla de productos */
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s; }
.card:hover { box-shadow: var(--shadow); }
.card__media { position: relative; aspect-ratio: 4/3; overflow: hidden; background: var(--muted); display: block; }
.card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__media img { transform: scale(1.05); }
.badge { position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--fg); color: var(--bg); font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.badge-off { background: var(--danger); color: #fff; display: inline-flex; align-items: center; gap: 4px; }
.card__body { padding: 14px; display: flex; flex-direction: column; flex: 1; gap: 4px; }
.card__cat { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted-fg); font-weight: 600; }
.card__name { font-weight: 600; line-height: 1.25; }
.card__name a:hover { text-decoration: underline; }
.price { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.price b { font-size: 19px; }
.price s { color: var(--muted-fg); font-size: 14px; }
.save { color: var(--danger); font-size: 12px; font-weight: 600; }
.card .btn { margin-top: auto; }

/* ===== Tienda (layout filtros) ===== */
.shop { display: grid; grid-template-columns: 250px 1fr; gap: 32px; margin-top: 28px; }
.filters { align-self: start; position: sticky; top: 84px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.filters__title { background: var(--fg); color: var(--bg); padding: 12px 16px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.facet { border-top: 1px solid var(--border); padding: 14px 16px; }
.facet:first-child { border-top: none; }
.facet h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .03em; margin-bottom: 8px; }
.facet label { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 14px; cursor: pointer; }
.facet label:hover { color: var(--primary); }
.facet input { accent-color: var(--primary); width: 15px; height: 15px; }
.facet .cnt { margin-left: auto; font-size: 12px; color: var(--muted-fg); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.toolbar .count b { color: var(--fg); }
.toolbar select { background: var(--card); color: var(--fg); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 14px; }
.shop .grid { margin-top: 22px; }
.empty { text-align: center; padding: 60px 0; color: var(--muted-fg); }
.filters-toggle { display: none; }

/* ===== Ficha de producto ===== */
.detail { padding: 40px 0; }
.crumb { font-size: 14px; color: var(--muted-fg); margin-bottom: 20px; display: inline-flex; gap: 6px; align-items: center; }
.crumb a:hover { color: var(--fg); }
.detail__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; }
.gallery__main { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--muted); }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery__thumbs button { aspect-ratio: 1; border-radius: 8px; overflow: hidden; border: 2px solid transparent; background: none; padding: 0; }
.gallery__thumbs button.active { border-color: var(--fg); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }
.detail h1 { font-size: clamp(26px, 4vw, 38px); margin: 4px 0; letter-spacing: -.02em; }
.detail .price b { font-size: 28px; }
.detail .desc { color: var(--muted-fg); margin: 20px 0; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 24px; }
.size { min-width: 44px; border: 1px solid var(--border); background: var(--card); border-radius: 8px; padding: 8px 12px; font-size: 14px; font-weight: 500; }
.size.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.detail__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.benefits { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); font-size: 14px; color: var(--muted-fg); }

/* ===== Carrito (drawer) ===== */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); opacity: 0; visibility: hidden; transition: .2s; z-index: 90; }
.overlay.open { opacity: 1; visibility: visible; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: 100%; max-width: 420px; background: var(--bg); z-index: 100; display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s; box-shadow: var(--shadow); }
.drawer.open { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); font-weight: 600; }
.drawer__items { flex: 1; overflow-y: auto; }
.citem { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.citem img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--muted); }
.citem__info { flex: 1; display: flex; flex-direction: column; }
.citem__name { font-size: 14px; font-weight: 500; }
.citem__size { font-size: 12px; color: var(--muted-fg); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 8px; margin-top: auto; }
.qty button { width: 28px; height: 28px; background: none; border: none; color: var(--muted-fg); }
.qty span { width: 28px; text-align: center; font-size: 14px; }
.citem__price { font-weight: 600; font-size: 14px; }
.citem__rm { background: none; border: none; color: var(--muted-fg); align-self: flex-start; }
.citem__rm:hover { color: var(--danger); }
.drawer__foot { padding: 16px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; }
.drawer__total { display: flex; justify-content: space-between; font-weight: 600; font-size: 17px; }
.drawer__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted-fg); text-align: center; padding: 20px; }

/* ===== Footer ===== */
.footer { border-top: 1px solid var(--border); background: var(--muted); margin-top: auto; }
.footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 48px 0 24px; }
.footer h5 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 12px; }
.footer a, .footer p { color: var(--muted-fg); font-size: 14px; padding: 3px 0; display: block; }
.footer a:hover { color: var(--fg); }
.footer__bottom { border-top: 1px solid var(--border); padding: 16px 0; font-size: 13px; color: var(--muted-fg); text-align: center; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .nav__links, .mega { display: none; }
  .nav__toggle { display: inline-flex; }
  .shop { grid-template-columns: 1fr; }
  .filters { position: static; display: none; }
  .filters.open { display: block; }
  .filters-toggle { display: inline-flex; }
  .detail__grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer__grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .tile span { font-size: 22px; }
}
