:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f7fb;
  --bg-elevated: #ffffff;
  --text-primary: #0b0d12;
  --text-secondary: #3f4754;
  --text-muted: #747d8b;
  --accent-primary: #0b6cff;
  --accent-glow: #004fc4;
  --accent-red: #e50914;
  --accent-soft: #0b6cff1a;
  --border-color: #0b0d1220;
  --border-strong: #0b6cff8f;
  --shadow-soft: 0 16px 38px #1118271a;
  --radius: 16px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html { overflow-x: hidden; }
body { max-width: 100%; }

body {
  margin: 0;
  min-height: 100svh;
  background: #000 url('../page/FondoWeb.jpg') center top / cover no-repeat fixed;
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px clamp(16px, 4vw, 54px);
  border-bottom: 1px solid #ffffff1a;
  background: #000000cc;
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 28px #00000040;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  white-space: nowrap;
}

.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}

.header-controls { flex: 1; max-width: 420px; }

.search-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid #ffffff2a;
  background: #ffffff14;
  color: #fff;
}

.search-control::placeholder { color: #9aa1ad; }

.cart-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--accent-primary);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cart-toggle:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }

.cart-count {
  min-width: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff;
  color: var(--accent-primary);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

/* Layout */

.catalog-page {
  min-height: 60svh;
  padding: 0 clamp(16px, 4vw, 54px) 60px;
}

.hero-banner {
  position: relative;
  z-index: 15;
  height: 44px;
  overflow: hidden;
  background: #000000cc;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid #ffffff1a;
}

.hero-track {
  display: flex;
  align-items: center;
  height: 100%;
  width: max-content;
  gap: 64px;
  padding-right: 64px;
  animation: hero-scroll 26s linear infinite;
}

.hero-track img {
  height: 60%;
  width: auto;
  flex-shrink: 0;
}

@keyframes hero-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-track { animation-play-state: paused; }
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0 24px;
  background: linear-gradient(#000000ea 70%, #00000000);
}

.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }

.filter-group button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid #ffffff26;
  background: #2a2e37;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.4px;
  cursor: pointer;
}

.filter-group button.is-active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-primary);
}

.sort-control {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #ffffff26;
  background: #2a2e37;
  color: #fff;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 20px;
}

.empty-state { color: #aab0bd; padding: 40px 0; text-align: center; }

/* Product card */

.product-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  overflow: hidden;
  box-shadow: 0 10px 24px #11182710;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

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

.product-image-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-secondary);
}

.product-image { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }

.product-status-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: #fff;
  box-shadow: 0 4px 10px #11182740;
}

.product-discount-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #fff;
  background: var(--accent-red);
  box-shadow: 0 4px 10px #11182740;
}

.gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #ffffffcc;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px #11182726;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.product-image-wrap:hover .gallery-arrow { opacity: 1; }

.gallery-prev { left: 8px; }
.gallery-next { right: 8px; }

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 5px;
}

.gallery-dots button {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #ffffffa8;
  box-shadow: 0 0 0 1px #11182726;
  cursor: pointer;
}

.gallery-dots button.is-active {
  background: var(--accent-primary);
  box-shadow: none;
}

.product-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }

.product-brand {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent-primary);
}

.product-name { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; }

.product-description { margin: 0; font-size: 12.5px; color: var(--text-muted); flex: 1; }

.product-delivery {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
}

.product-delivery.is-immediate {
  color: #128c4a;
  background: #128c4a1a;
}

.product-delivery.is-preorder {
  color: #b3690a;
  background: #b3690a1a;
}

.product-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.product-sizes button {
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.product-sizes button.is-selected {
  background: var(--text-primary);
  color: #fff;
  border-color: var(--text-primary);
}

.product-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }

.product-price-wrap { display: flex; flex-direction: column; }

.product-price { font-weight: 900; font-size: 15px; }

.product-price.has-discount { color: var(--accent-red); }

.product-price-original {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: line-through;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 10px;
}

.qty-stepper button {
  border: none;
  background: none;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: var(--text-primary);
  width: 18px;
}

.qty-value { min-width: 16px; text-align: center; font-weight: 700; }

.add-to-cart-button {
  margin-top: 8px;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: var(--accent-primary);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.add-to-cart-button:hover { background: var(--accent-glow); }

.add-to-cart-button:disabled {
  cursor: not-allowed;
}

/* Footer banner */

.footer-banner-wrap {
  width: 100%;
  overflow-x: auto;
  background: transparent;
}

.footer-banner {
  display: block;
  height: clamp(70px, 9vw, 110px);
  width: auto;
  max-width: none;
  margin: 0 auto;
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 16px 0 20px;
}

.footer-social a {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid #ffffff33;
  border-radius: 50%;
  color: #fff;
  transition: background .2s, color .2s, border-color .2s;
}

.footer-social a:hover {
  background: #fff;
  color: #000;
  border-color: #fff;
}

.footer-social svg { width: 20px; height: 20px; fill: currentColor; }

/* Footer */

.site-footer {
  padding: 30px clamp(16px, 4vw, 54px) 50px;
  text-align: center;
  color: #9aa1ad;
  border-top: 1px solid #ffffff1a;
}

.footer-whatsapp {
  display: inline-block;
  margin-top: 10px;
  color: #24d366;
  font-weight: 800;
  text-decoration: none;
}

/* Cart drawer */

.backdrop {
  position: fixed;
  inset: 0;
  background: #05060acc;
  z-index: 29;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  height: 100dvh;
  width: min(400px, 100vw);
  background: var(--bg-elevated);
  z-index: 30;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  box-shadow: -20px 0 40px #05060a2e;
}

.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-color);
}

.cart-drawer-header h2 { margin: 0; font-size: 18px; }

.icon-button {
  border: none;
  background: none;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
}

.cart-items { flex: 1; overflow-y: auto; padding: 12px 20px; display: flex; flex-direction: column; gap: 14px; }

.cart-empty { text-align: center; color: var(--text-muted); padding: 30px 0; }

.cart-line {
  display: flex;
  gap: 12px;
  align-items: center;
}

.cart-line img {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg-secondary);
  flex-shrink: 0;
}

.cart-line-info { flex: 1; min-width: 0; }
.cart-line-name { font-size: 13.5px; font-weight: 700; margin: 0 0 2px; }
.cart-line-meta { font-size: 12px; color: var(--text-muted); margin: 0; }

.cart-line-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cart-line-controls .qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 2px 8px;
}

.cart-line-controls .qty-stepper button {
  border: none;
  background: none;
  width: 18px;
  height: 24px;
  cursor: pointer;
  font-weight: 800;
  color: var(--text-primary);
}

.cart-line-controls .qty-stepper span {
  min-width: 14px;
  text-align: center;
  font-weight: 700;
  font-size: 13px;
}

.cart-line-remove {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--bg-secondary);
  color: var(--accent-red);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-line-remove:hover { background: var(--accent-red); color: #fff; }

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding: 16px 20px 22px;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  margin-bottom: 14px;
}

.checkout-form { display: flex; flex-direction: column; gap: 10px; }

.checkout-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: normal;
  resize: vertical;
}

.whatsapp-button {
  margin-top: 6px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: #128c4a;
  color: #fff;
  font-weight: 800;
  font-size: 14.5px;
  cursor: pointer;
}

.whatsapp-button:hover { background: #0f7a40; }
.whatsapp-button.is-disabled { opacity: 0.5; cursor: not-allowed; }

/* Lightbox de imagenes */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 31;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.is-open { opacity: 1; pointer-events: auto; }

.lightbox-image {
  max-width: min(900px, 90vw);
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: var(--bg-secondary);
  box-shadow: 0 30px 70px #05060a70;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

.lightbox.is-open .lightbox-image { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: clamp(12px, 3vw, 28px);
  right: clamp(12px, 3vw, 28px);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: #ffffffe6;
  color: var(--text-primary);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px #05060a40;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #ffffffe6;
  color: var(--text-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px #05060a40;
}

.lightbox-prev { left: clamp(8px, 3vw, 32px); }
.lightbox-next { right: clamp(8px, 3vw, 32px); }

.lightbox-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: clamp(14px, 4vw, 30px);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.lightbox-dots button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: #ffffff70;
  cursor: pointer;
}

.lightbox-dots button.is-active { background: #fff; }

@media (max-width: 640px) {
  .lightbox-arrow { width: 38px; height: 38px; font-size: 20px; }
}

/* Vista rapida (quickview): imagen a un lado, info del otro */

.quickview {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(820px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-elevated);
  border-radius: var(--radius);
  box-shadow: 0 30px 70px #05060a70;
  z-index: 31;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.quickview.is-open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

.quickview-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #ffffffe6;
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px #05060a40;
}

.quickview-body .product-card {
  flex-direction: row;
  border: none;
  border-radius: 0;
  box-shadow: none;
  transition: none;
}

.quickview-body .product-card:hover { transform: none; box-shadow: none; }

.quickview-body .product-image-wrap { width: 44%; flex-shrink: 0; order: 1; }

.quickview-body .product-body {
  flex: 1;
  order: 2;
  padding: 28px 32px;
  justify-content: center;
  gap: 10px;
}

.quickview-body .product-brand { font-size: 11px; }
.quickview-body .product-name { font-size: 21px; }

.quickview-body .product-description {
  font-size: 14px;
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

.quickview-body .product-delivery { font-size: 11px; padding: 3px 9px; }

.quickview-body .product-price { font-size: 20px; }
.quickview-body .product-price-original { font-size: 13px; }

.quickview-body .qty-stepper { display: inline-flex; }

.quickview-body .add-to-cart-button { padding: 12px; font-size: 14px; margin-top: 12px; }

.quickview-body .product-status-tag,
.quickview-body .product-discount-tag { font-size: 11px; padding: 4px 10px; top: 12px; }
.quickview-body .product-status-tag { left: 12px; }
.quickview-body .product-discount-tag { right: 12px; }

@media (max-width: 700px) {
  .quickview { width: 94vw; max-height: 92vh; }
  .quickview-body .product-card { flex-direction: column; }
  .quickview-body .product-image-wrap { width: 100%; }
  .quickview-body .product-body { padding: 18px 18px 22px; }
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  z-index: 40;
  box-shadow: var(--shadow-soft);
}

@media (max-width: 640px) {
  .site-header { gap: 10px; padding: 10px 16px; }
  .brand-logo { height: 32px; }
  .header-controls { flex: 1 1 auto; min-width: 0; max-width: none; }
  .search-control { padding: 8px 12px; font-size: 16px; }
  .cart-toggle { padding: 8px 12px; gap: 6px; font-size: 14px; }
  .hero-banner { height: 36px; }
  .filters { gap: 10px; }
  .cart-line-remove { width: 30px; height: 30px; font-size: 19px; }

  body { background-attachment: scroll; }

  .catalog-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

  .product-status-tag,
  .product-discount-tag {
    top: 6px;
    font-size: 9px;
    padding: 3px 7px;
  }
  .product-status-tag { left: 6px; }
  .product-discount-tag { right: 6px; }

  .product-body { padding: 10px 10px 12px; gap: 4px; }

  .product-brand { font-size: 9.5px; letter-spacing: 0.6px; }
  .product-name { font-size: 12.5px; }

  .product-description {
    font-size: 11.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .product-delivery { font-size: 9.5px; padding: 2px 7px; }

  .product-price { font-size: 13px; }
  .product-price-original { font-size: 10.5px; }

  .product-footer { margin-top: 2px; }
  .qty-stepper { display: none; }

  .add-to-cart-button { padding: 8px; font-size: 12.5px; margin-top: 6px; }

  .footer-banner-wrap { overflow-x: hidden; }
  .footer-banner {
    height: auto;
    width: 100%;
    max-width: 100%;
  }
}
