/* ============================================================
   DESIGN SYSTEM — CAROUSEL SHOP (patike-style)
   ============================================================ */

:root {
  --bg:          #e8e3d8;
  --bg-dark:     #1a1814;
  --text:        #1a1814;
  --text-muted:  #9a9590;
  --text-dim:    #c4bfb8;
  --border:      rgba(0,0,0,0.12);
  --accent:      #1a1814;

  --font-display: 'Barlow Condensed', Impact, sans-serif;
  --font-serif:   'Cormorant Garamond', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;

  /* Suave y sedado — sin rebote para marca de lujo */
  --ease:        cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out:    cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* ============================================================
   BACKGROUND CANVAS — per-product color transition
   ============================================================ */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#bg-layer-a,
#bg-layer-b {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  height: 100svh;
  user-select: none;
}
img  { display: block; max-width: 100%; }
a    { color: inherit; text-decoration: none; }
button { font: inherit; border: none; background: none; cursor: pointer; color: inherit; }

/* ============================================================
   LOADER
   ============================================================ */
.loader {
  position: fixed; inset: 0;
  background: var(--bg-dark);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  transition: transform 0.9s var(--ease-out), opacity 0.3s;
}
.loader.hiding {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}
.loader__word {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 7vw, 5rem);
  font-weight: 800;
  letter-spacing: 0.3em;
  color: #f0ebe2;
  text-transform: uppercase;
  text-align: center;
  padding: 0 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: loaderIn 0.6s var(--ease-out) 0.2s forwards;
}
@keyframes loaderIn { to { opacity: 1; transform: none; } }

/* ============================================================
   SHOP WRAP
   ============================================================ */
.shop-wrap {
  position: relative;
  width: 100vw;
  height: 100svh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ============================================================
   TOP BAR
   ============================================================ */
.top-bar {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 20px clamp(16px, 3vw, 40px) 16px;
  flex-shrink: 0;
}

/* Filter tabs */
.filter-tabs {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.filter-tab {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  transition: all 0.2s;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer;
}
.filter-tab:hover { color: var(--text); border-color: rgba(0,0,0,0.3); }
.filter-tab.active {
  background: var(--bg-dark);
  color: #f0ebe2;
  border-color: var(--bg-dark);
}
.filter-tab .tab-count { font-size: 9px; opacity: 0.7; }

/* Center logo + actions */
.top-center {
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.45);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid rgba(255,255,255,0.6);
  border-radius: 100px;
  padding: 8px 10px 8px 20px;
}
.shop-logo {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
}
.top-actions { display: flex; gap: 4px; }
.top-icon-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.08);
  transition: background 0.2s;
  position: relative;
  color: var(--text);
}
.top-icon-btn:hover { background: rgba(0,0,0,0.15); }
.top-icon-btn svg {
  width: 16px; height: 16px;
  fill: none; stroke: currentColor; stroke-width: 1.6;
}
.cart-badge {
  position: absolute; top: -3px; right: -3px;
  background: var(--bg-dark);
  color: #f0ebe2;
  font-size: 8px; font-weight: 600;
  min-width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  opacity: 0; transform: scale(0);
  transition: opacity 0.2s, transform 0.2s var(--ease-bounce);
}
.cart-badge.visible { opacity: 1; transform: scale(1); }

/* Social links under price */
.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-muted);
  transition: all 0.2s;
  flex-shrink: 0;
}
.social-link:hover {
  background: var(--bg-dark);
  color: #f0ebe2;
  border-color: var(--bg-dark);
  transform: translateY(-1px);
}
.social-link svg { width: 13px; height: 13px; }

/* WhatsApp — tab lateral fijo */
.wa-float {
  position: fixed;
  right: -1px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 11px;
  background: #25D366;
  color: #fff;
  border-radius: 8px 0 0 8px;
  box-shadow: -3px 0 18px rgba(37,211,102,0.35);
  transition: transform 0.25s var(--ease-out), box-shadow 0.25s;
  text-decoration: none;
}
.wa-float:hover {
  transform: translateY(-50%) translateX(-4px);
  box-shadow: -6px 0 28px rgba(37,211,102,0.5);
}
.wa-float svg { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.wa-float__label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  color: rgba(255,255,255,0.9);
}

/* Counter right */
.product-counter {
  font-family: var(--font-body);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-align: right;
}

/* Filter tabs wrap + sort button */
.filter-tabs-wrap {
  display: flex; align-items: center; gap: 6px;
}
.sort-btn {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.4);
  border: 1px solid var(--border);
  backdrop-filter: blur(8px);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.sort-btn:hover, .sort-btn.active { background: var(--bg-dark); color: #f0ebe2; border-color: var(--bg-dark); }
.sort-btn svg { width: 15px; height: 15px; }
.sort-btn--mobile { display: none; } /* visible solo en mobile via media query */
.filter-section--category { display: none; } /* visible solo en mobile */

/* Search bar — full-width strip below top-bar */
.search-bar-wrap {
  position: relative; z-index: 19;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s var(--ease-out);
}
.search-bar-wrap.open { max-height: 60px; }
.search-bar-inner {
  display: flex; align-items: center; gap: 10px;
  margin: 0 clamp(16px,3vw,40px) 10px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 100px;
  padding: 10px 16px;
}
.search-bar-inner svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.search-input {
  flex: 1; border: none; background: transparent; outline: none;
  font-family: var(--font-body);
  font-size: 12px; letter-spacing: 0.06em;
  color: var(--text);
}
.search-input::placeholder { color: var(--text-muted); }
.search-clear {
  flex-shrink: 0; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); cursor: pointer; background: none;
}
.search-clear svg { width: 13px; height: 13px; }

/* Filter sheet */
.sort-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.3);
  z-index: 149; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.sort-backdrop.open { opacity: 1; pointer-events: all; }
.sort-sheet {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 150;
  background: #faf9f7;
  border-radius: 24px 24px 0 0;
  padding: 12px 0 0;
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out);
  box-shadow: 0 -8px 40px rgba(0,0,0,0.14);
  display: flex; flex-direction: column;
  max-height: 85vh;
}
.sort-sheet.open { transform: translateY(0); }
.sort-sheet__handle {
  width: 40px; height: 4px; border-radius: 2px;
  background: rgba(0,0,0,0.12); margin: 0 auto 14px; flex-shrink: 0;
}
.filter-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px 12px; flex-shrink: 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.sort-sheet__title {
  font-family: var(--font-body); font-size: 10px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--text-muted);
}
.filter-clear-all {
  font-family: var(--font-body); font-size: 11px; letter-spacing: 0.06em;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px;
}
.filter-sheet-scroll {
  overflow-y: auto; flex: 1; padding: 4px 0 8px;
}
.filter-section { padding: 14px 20px 10px; }
.filter-section__label {
  font-family: var(--font-body); font-size: 10px; font-weight: 600;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 7px; }
.filter-pill {
  font-family: var(--font-body); font-size: 12px; letter-spacing: 0.05em;
  padding: 7px 14px; border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.14);
  background: #fff; color: var(--text);
  cursor: pointer; transition: all 0.18s;
}
.filter-pill:hover { border-color: rgba(0,0,0,0.3); }
.filter-pill.active {
  background: var(--bg-dark); color: #f0ebe2;
  border-color: var(--bg-dark);
}
.filter-sheet-footer {
  flex-shrink: 0; padding: 12px 20px 28px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.filter-apply-btn {
  width: 100%; padding: 15px;
  background: var(--bg-dark); color: #f0ebe2;
  font-family: var(--font-body); font-size: 11px;
  letter-spacing: 0.18em; text-transform: uppercase; font-weight: 500;
  border-radius: 100px; border: none; cursor: pointer;
  transition: background 0.2s;
}
.filter-apply-btn:hover { background: #333; }

/* Sort btn badge */
.sort-btn { position: relative; }
.sort-btn__badge {
  position: absolute; top: -4px; right: -4px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--bg-dark); color: #f0ebe2;
  font-size: 9px; font-weight: 700;
  display: none; align-items: center; justify-content: center;
}
.sort-btn__badge.visible { display: flex; }

/* Note tags on bottom info */
.product-info__notes {
  display: flex; flex-wrap: wrap; gap: 5px;
  justify-content: flex-start;
  min-height: 0; margin: 2px 0;
}
.product-info__notes:empty { display: none; }
.note-tag {
  font-family: var(--font-body); font-size: 9px;
  letter-spacing: 0.1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.18);
  color: var(--text-muted); background: rgba(255,255,255,0.4);
  backdrop-filter: blur(4px);
}

/* ============================================================
   BACKGROUND GIANT NAME
   ============================================================ */
.bg-name-wrap {
  position: absolute;
  top: 50%; left: 0; right: 0;
  transform: translateY(-55%);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.bg-name {
  font-family: var(--font-display);
  font-size: clamp(5rem, 16vw, 20rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(26, 24, 20, 0.07);
  white-space: nowrap;
  transition: opacity 0.4s, transform 0.6s var(--ease-out);
  display: block;
  text-align: center;
  width: 100%;
  padding: 0 20px;
}
.bg-name.changing {
  opacity: 0;
  transform: translateY(10px);
}

/* ============================================================
   CAROUSEL STAGE
   ============================================================ */
.carousel-stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  overflow: visible;
  min-height: 0;
}

/* Carousel Item */
.carousel-item {
  position: absolute;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transform-origin: bottom center;
  transition:
    transform  0.75s var(--ease-out),
    opacity    0.6s  cubic-bezier(0.4, 0, 0.2, 1),
    z-index    0s    linear;
  cursor: pointer;
  will-change: transform, opacity;
  /* Height of the item area */
  height: clamp(180px, 42vh, 420px);
  width: clamp(120px, 20vw, 320px);
}

/* Product image inside item — no background, pure float */
.carousel-item__img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  transition: filter 0.5s cubic-bezier(0.4, 0, 0.2, 1), transform 0.5s var(--ease-out);
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.18));
  pointer-events: none;
}
.carousel-item:hover .carousel-item__img {
  filter: drop-shadow(0 28px 56px rgba(0,0,0,0.26));
  transform: translateY(-6px);
}

/* Center item — bigger shadow */
.carousel-item.is-center .carousel-item__img {
  filter: drop-shadow(0 30px 60px rgba(0,0,0,0.25));
}
.carousel-item.is-center:hover .carousel-item__img {
  filter: drop-shadow(0 40px 80px rgba(0,0,0,0.3));
  transform: translateY(-10px);
}

/* Placeholder (no image) */
.carousel-item__placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%; height: 80%;
  border-radius: 8px;
  background: linear-gradient(160deg, var(--grad-from,#ccc), var(--grad-to,#eee));
  box-shadow: 0 20px 50px rgba(0,0,0,0.12);
  transition: box-shadow 0.4s;
}
.carousel-item:hover .carousel-item__placeholder {
  box-shadow: 0 30px 70px rgba(0,0,0,0.18);
}
.carousel-item__placeholder-name {
  font-family: var(--font-display);
  font-size: clamp(0.9rem, 2vw, 1.6rem);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 0 12px;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Sold-out */
.carousel-item.is-sold-out .carousel-item__img,
.carousel-item.is-sold-out .carousel-item__placeholder {
  filter: grayscale(0.6) drop-shadow(0 20px 40px rgba(0,0,0,0.12));
  opacity: 0.75;
}

/* ============================================================
   BOTTOM BAR
   ============================================================ */
.bottom-bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px clamp(16px, 3vw, 40px) clamp(20px, 3vh, 36px);
  flex-shrink: 0;
}

/* Product info */
.product-info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.product-info__category {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: opacity 0.3s;
}
.product-info__name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3.5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.product-info__edition {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(0.95rem, 1.8vw, 1.2rem);
  font-weight: 300;
  color: var(--text-muted);
  transition: opacity 0.3s;
}
.product-info__price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.product-info__price {
  font-size: clamp(1.15rem, 2.4vw, 1.75rem);
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--accent);
}
.product-info__compare {
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  font-weight: 400;
  color: var(--text-muted);
  text-decoration: line-through;
  display: none;
}
.product-info__discount {
  background: #c0392b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 100px;
  display: none;
  flex-shrink: 0;
}

/* Info transition */
.product-info__category,
.product-info__edition,
.product-info__price,
.product-info__compare,
.product-info__discount {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s var(--ease-out);
}
.product-info__name {
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.4s var(--ease-out);
}
.product-info.changing .product-info__category,
.product-info.changing .product-info__name,
.product-info.changing .product-info__edition,
.product-info.changing .product-info__price,
.product-info.changing .product-info__compare,
.product-info.changing .product-info__discount {
  opacity: 0;
  transform: translateY(8px);
}

/* Controls */
.carousel-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.ctrl-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.2s;
}
.ctrl-btn:hover {
  background: var(--bg-dark);
  color: #f0ebe2;
  border-color: var(--bg-dark);
}
.ctrl-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.discover-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  background: var(--bg-dark);
  color: #f0ebe2;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.2s, transform 0.15s;
}
.discover-btn:hover { background: #333; transform: translateY(-1px); }
.discover-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ============================================================
   SOLD-OUT BADGE
   ============================================================ */
.sold-out-pill {
  position: absolute;
  bottom: 10%; left: 50%; transform: translateX(-50%);
  background: rgba(26,24,20,0.7);
  backdrop-filter: blur(8px);
  color: rgba(240,235,226,0.9);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 100px;
  pointer-events: none;
}

/* ============================================================
   GRID OVERLAY
   ============================================================ */
.grid-overlay {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 80;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: opacity 0.3s, transform 0.4s var(--ease-out);
}
.grid-overlay.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
}
.grid-overlay__header {
  position: sticky; top: 0;
  padding: 20px 32px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.grid-close-btn {
  display: flex; align-items: center; gap: 8px;
  font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
  transition: color 0.2s;
}
.grid-close-btn:hover { color: var(--text); }
.grid-close-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }

.grid-overlay__content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  padding: 24px 32px 60px;
}
.grid-card {
  aspect-ratio: 3/4;
  border-radius: 8px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  background: linear-gradient(160deg, var(--grad-from,#ccc), var(--grad-to,#eee));
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s;
}
.grid-card:hover { transform: translateY(-4px); box-shadow: 0 16px 40px rgba(0,0,0,0.12); }
.grid-card__img {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.grid-card__img img { max-height: 100%; object-fit: contain; }
.grid-card__name-ph {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 1.1rem; font-weight: 700;
  color: rgba(255,255,255,0.9);
  text-align: center;
  padding: 16px;
  letter-spacing: 0.03em;
}
.grid-card__info {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent);
  color: white;
}
.grid-card__info .gc-name { font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.grid-card__info .gc-price { font-size: 11px; opacity: 0.8; margin-top: 2px; }
.grid-card__sold {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.4);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: rgba(26,24,20,0.6);
  backdrop-filter: blur(2px);
}

/* ============================================================
   PRODUCT MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(10px);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity 0.35s;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }

.modal {
  background: var(--bg);
  border-radius: 20px;
  max-width: 860px; width: 100%;
  max-height: 92svh; overflow: hidden;
  transform: translateY(32px) scale(0.97);
  transition: transform 0.4s var(--ease-out);
  display: grid; grid-template-columns: 1.1fr 1fr;
  position: relative;
}
.modal-backdrop.open .modal { transform: none; }

/* Visual side */
.modal__visual {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  border-radius: 20px 0 0 20px;
  padding: 48px 36px;
  background: linear-gradient(160deg, var(--modal-grad-from, #d0ccc4), var(--modal-grad-to, #e8e3d8));
  min-height: 420px;
}
.modal__visual img {
  width: 100%; max-height: 420px;
  object-fit: contain;
  filter: drop-shadow(0 20px 40px rgba(0,0,0,0.18));
}
.modal__visual-placeholder {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700; text-align: center;
  letter-spacing: 0.03em; color: var(--text-muted);
}

/* Info side */
.modal__info {
  padding: 32px 32px 24px;
  display: flex; flex-direction: column; gap: 10px;
  overflow-y: auto;
}
.modal__header {
  display: flex; align-items: center; justify-content: space-between;
}
.modal__category {
  font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--text-muted);
}
.modal__share-btn {
  display: flex; align-items: center; gap: 5px;
  font-family: var(--font-body); font-size: 10px;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); background: none; border: none; cursor: pointer;
  padding: 4px 10px; border-radius: 100px;
  border: 1px solid var(--border); transition: all 0.2s;
}
.modal__share-btn svg { width: 13px; height: 13px; }
.modal__share-btn:hover { background: var(--bg-dark); color: #f0ebe2; border-color: transparent; }
.modal__name {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 800; letter-spacing: 0.02em;
  text-transform: uppercase; line-height: 1.05;
}
.modal__edition {
  font-family: var(--font-serif); font-style: italic;
  font-size: 1rem; color: var(--text-muted);
}
.modal__notes {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 0;
}
.modal__notes:empty { display: none; }
.modal__note-tag {
  font-family: var(--font-body); font-size: 10px;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 11px; border-radius: 100px;
  border: 1px solid rgba(0,0,0,0.14);
  color: var(--text-muted); background: rgba(0,0,0,0.03);
}
.modal__price-row {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.modal__price { font-size: 1.5rem; font-weight: 700; color: var(--text); }
.modal__compare {
  font-size: 0.95rem; color: var(--text-muted);
  text-decoration: line-through; display: none;
}
.modal__discount {
  background: #c0392b; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 100px; display: none;
}
.modal__desc {
  font-size: 13px; color: var(--text-muted); line-height: 1.75;
  border-top: 1px solid var(--border); padding-top: 12px;
  flex-shrink: 0;
}
.modal__actions { padding-top: 4px; display: flex; flex-direction: column; gap: 8px; }
.modal__actions .btn-primary { width: 100%; }
.btn-whatsapp {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 13px 20px; border-radius: 50px;
  background: #25D366; color: #fff;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  letter-spacing: 0.04em; text-decoration: none;
  transition: background 0.2s, transform 0.15s;
  border: none; cursor: pointer;
}
.btn-whatsapp:hover { background: #1db954; transform: translateY(-1px); }
.btn-whatsapp.disabled { background: #aaa; pointer-events: none; }

/* Similar products */
.modal__similar { margin-top: 4px; padding-top: 14px; border-top: 1px solid var(--border); }
.modal__similar-label {
  font-family: var(--font-body); font-size: 9px;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 10px;
}
.modal__similar-row {
  display: flex; gap: 10px; overflow-x: auto;
  padding-bottom: 4px; scrollbar-width: none;
}
.modal__similar-row::-webkit-scrollbar { display: none; }
.similar-card {
  flex-shrink: 0; width: 90px; cursor: pointer;
  transition: transform 0.2s;
}
.similar-card:hover { transform: translateY(-3px); }
.similar-card__img {
  width: 90px; height: 90px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; margin-bottom: 6px;
}
.similar-card__img img {
  width: 100%; height: 100%; object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.12));
}
.similar-card__name {
  font-family: var(--font-body); font-size: 10px;
  letter-spacing: 0.03em; line-height: 1.3;
  color: var(--text); text-align: center;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.similar-card__price {
  font-family: var(--font-body); font-size: 10px;
  color: var(--text-muted); text-align: center; margin-top: 2px;
}

/* Close button */
.modal__close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); transition: all 0.2s;
  background: rgba(255,255,255,0.7); backdrop-filter: blur(8px);
}
.modal__close svg { width: 16px; height: 16px; }
.modal__close:hover { background: var(--bg-dark); color: #f0ebe2; border-color: transparent; }

.btn-primary {
  flex: 1; padding: 13px 20px;
  background: var(--bg-dark); color: #f0ebe2;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; font-weight: 500;
  border-radius: 100px;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: #333; transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }
.btn-secondary {
  padding: 13px 18px;
  border: 1px solid var(--border); border-radius: 100px;
  font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted);
  background: transparent; transition: all 0.2s;
}
.btn-secondary:hover { background: var(--border); color: var(--text); }

/* ============================================================
   CART SIDEBAR
   ============================================================ */
.cart-sidebar {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  z-index: 150;
  transform: translateX(100%);
  transition: transform 0.45s var(--ease-out);
  display: flex; flex-direction: column;
}
.cart-sidebar.open { transform: translateX(0); }

.cart-sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.cart-sidebar__title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.cart-sidebar__close { font-size: 20px; color: var(--text-muted); transition: color 0.2s; }
.cart-sidebar__close:hover { color: var(--text); }

.cart-sidebar__items { flex: 1; overflow-y: auto; padding: 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.cart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; gap: 12px; color: var(--text-muted); font-family: var(--font-serif); font-style: italic; }

.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.cart-item__thumb { width: 60px; height: 60px; border-radius: 6px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.cart-item__thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-item__name { font-size: 13px; font-weight: 500; }
.cart-item__edition { font-size: 10px; color: var(--text-muted); }
.cart-item__price { font-size: 13px; font-weight: 500; }
.cart-item__remove { font-size: 18px; color: var(--text-dim); transition: color 0.2s; display: block; margin-top: 4px; cursor: pointer; }
.cart-item__remove:hover { color: var(--text); }

.cart-sidebar__footer { padding: 20px 24px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 16px; }
.cart-total-row { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total-label { font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--text-muted); }
.cart-total-value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }

.btn-checkout {
  width: 100%; padding: 15px;
  background: var(--bg-dark); color: #f0ebe2;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; font-weight: 500;
  border-radius: 100px; border: none; cursor: pointer;
  transition: background 0.2s;
}
.btn-checkout:hover { background: #333; }

.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 140;
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.sidebar-backdrop.open { opacity: 1; pointer-events: all; }

/* ============================================================
   TOAST
   ============================================================ */
.toast-container {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%);
  z-index: 999; display: flex; flex-direction: column; align-items: center; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--bg-dark); color: #f0ebe2;
  padding: 10px 20px; border-radius: 100px;
  font-size: 12px; letter-spacing: 0.08em;
  white-space: nowrap;
  animation: toastIn 0.3s var(--ease-out) forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.toast.hiding { animation: toastOut 0.3s var(--ease) forwards; }
@keyframes toastIn  { from { opacity:0; transform:translateY(16px); } to { opacity:1; transform:none; } }
@keyframes toastOut { from { opacity:1; transform:none; } to { opacity:0; transform:translateY(10px); } }

/* ============================================================
   SWIPE HINT
   ============================================================ */
.swipe-hint {
  display: none; /* only shown on mobile via JS */
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 15;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px 20px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s;
}
.swipe-hint.visible { opacity: 1; }
.swipe-hint__label {
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.swipe-hint__arrow {
  display: flex; align-items: center;
  color: var(--text-muted);
}
.swipe-hint__arrow svg { width: 14px; height: 14px; }
.swipe-hint__arrow--left  { animation: hintLeft  1.4s ease-in-out infinite; }
.swipe-hint__arrow--right { animation: hintRight 1.4s ease-in-out infinite; }
@keyframes hintLeft  { 0%,100%{transform:translateX(0)} 50%{transform:translateX(-5px)} }
@keyframes hintRight { 0%,100%{transform:translateX(0)} 50%{transform:translateX(5px)} }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {

  /* ---- Top bar: compacto, dos filas ajustadas ---- */
  .top-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px 16px 4px;
  }
  .top-center { order: -1; }
  .product-counter { display: none; }

  /* Tabs ocultos en mobile — categorías viven en el filter sheet */
  .filter-tabs-wrap { display: none; }
  .sort-btn--mobile { display: flex; }
  /* Categorías en filter sheet: visible solo en mobile */
  .filter-section--category { display: block; }

  /* ---- Carousel más grande ---- */
  .carousel-stage { max-height: 55vh; }
  .carousel-item {
    height: clamp(260px, 54vh, 460px);
    width: clamp(145px, 40vw, 290px);
    align-items: center;
    transform-origin: center center;
  }

  /* ---- Swipe hint visible ---- */
  .swipe-hint { display: flex; }

  /* ---- Bottom bar: columna compacta ---- */
  .bottom-bar {
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 6px 20px 20px;
    gap: 8px;
  }
  .product-info {
    align-items: center;
    text-align: center;
    width: 100%;
    gap: 2px;
  }
  .product-info__price-row { justify-content: center; }
  .product-info__notes { justify-content: center; }
  .product-info__name { font-size: clamp(1.1rem, 5.5vw, 2.6rem); }

  /* Ocultar socials — liberan una fila entera */
  .social-links { display: none; }

  /* Controles: prev/next pequeños, discover full width */
  .carousel-controls {
    width: 100%;
    gap: 8px;
  }
  .ctrl-btn { width: 36px; height: 36px; flex-shrink: 0; }
  .discover-btn {
    flex: 1;
    justify-content: center;
    padding: 14px 20px;
    font-size: 11px;
  }

  /* ---- Modal — bottom sheet ---- */
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal {
    grid-template-columns: 1fr;
    border-radius: 20px 20px 0 0;
    max-height: 92svh;
    overflow: hidden;
  }
  .modal__visual {
    border-radius: 20px 20px 0 0;
    min-height: 0;
    height: 260px;
    padding: 28px 24px;
  }
  .modal__visual img { max-height: 210px; }
  .modal__close { top: 12px; right: 12px; }
  .modal__info {
    padding: 20px 20px 32px;
    gap: 8px;
    overflow-y: auto;
    max-height: calc(92svh - 260px);
  }
  .modal__name { font-size: clamp(1.2rem, 5.5vw, 1.6rem); }
  .modal__desc {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .modal__similar { display: none; }
  .grid-overlay__content { grid-template-columns: repeat(2, 1fr); padding: 16px; }
}

@media (max-width: 480px) {
  .top-center { padding: 6px 8px 6px 14px; }
  .shop-logo { font-size: 0.8rem; }
  .carousel-item { height: clamp(250px, 52vh, 440px); width: clamp(140px, 42vw, 280px); }
  .carousel-stage { max-height: 52vh; }
  .product-info__price { font-size: clamp(1.1rem, 4.5vw, 1.5rem); }
  .product-info__name { font-size: clamp(1rem, 5vw, 2rem); }
  .discover-btn { padding: 13px 16px; font-size: 10.5px; }
}
