@import url('loader.css');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --purple: #440099;
  --purple-dark: #36007a;
  --purple-light: #c933a6;
  --pink: #e91e8c;
  --green: #00a650;
  --red: #e53935;
  --gray-100: #f5f5f5;
  --gray-200: #e0e0e0;
  --gray-500: #757575;
  --gray-800: #333;
  --white: #fff;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --radius: 8px;
  --max-width: 1280px;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Work Sans", "Segoe UI", system-ui, sans-serif;
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  width: 100%;
  max-width: 100%;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.top-bar {
  background: var(--gray-100);
  font-size: 12px;
  border-bottom: 1px solid var(--gray-200);
}

.top-bar .container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding-top: 6px;
  padding-bottom: 6px;
}

.top-bar a:hover { color: var(--purple); }

/* Header */
.header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  max-width: 100%;
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 12px 0;
  min-width: 0;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img,
.logo svg {
  height: 32px;
  width: auto;
  display: block;
}

@media (max-width: 768px) {
  .logo img,
  .logo svg {
    height: 28px;
  }
}

.search-form {
  display: flex;
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  min-width: 0;
}

.search-form input {
  flex: 1 1 auto;
  min-width: 0;
  border: 2px solid var(--purple);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 16px;
  font-size: 14px;
  outline: none;
}

.search-form input:focus { box-shadow: 0 0 0 3px rgba(68,0,153,.15); }

.search-form button {
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 0 16px;
  flex-shrink: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
}

.search-form button svg {
  width: 18px;
  height: 18px;
  display: block;
}

.search-form button:hover { background: var(--purple-dark); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header-actions a {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11px;
  gap: 2px;
  color: var(--gray-800);
  position: relative;
}

.header-actions a:hover { color: var(--purple); }

.header-actions svg { width: 24px; height: 24px; }

.cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--pink);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.cart-badge[hidden] { display: none; }

/* Location bar */
.location-bar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  font-size: 13px;
}

.location-bar-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  color: var(--purple);
  min-width: 0;
}

.location-bar-inner span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.location-bar svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Nav */
.nav {
  background: var(--white);
  border-bottom: 2px solid var(--gray-200);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
  max-width: 100%;
}

.nav::-webkit-scrollbar { display: none; }

.nav .container {
  display: flex;
  flex-wrap: nowrap;
  gap: 4px;
  padding-top: 0;
  padding-bottom: 0;
  width: max-content;
  min-width: 100%;
  max-width: none;
}

.nav a {
  white-space: nowrap;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-800);
  border-bottom: 3px solid transparent;
  transition: color .2s, border-color .2s;
}

.nav a:hover,
.nav a.active {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

.nav a.highlight {
  color: var(--pink);
  font-weight: 600;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: var(--white) !important;
  border-radius: 4px;
  padding: 8px 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  border-bottom: none !important;
}

.nav-badge:hover { opacity: .9; }

.nav-badge small {
  background: var(--white);
  color: var(--purple);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
}

/* Info strip */
.info-strip {
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.info-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s;
}

.info-card:hover {
  border-color: var(--purple);
  box-shadow: var(--shadow);
}

.info-card img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.info-card p {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-800);
}

.info-card span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--purple);
  margin-top: 2px;
}

/* Categories */
.categories {
  padding: 20px 0;
  border-bottom: 1px solid var(--gray-200);
}

.categories-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.categories-scroll::-webkit-scrollbar { display: none; }

.category-item {
  flex: 0 0 90px;
  scroll-snap-align: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 8px 4px;
  border-radius: var(--radius);
  transition: background .2s;
}

.category-item:hover { background: var(--gray-100); }

.category-item img {
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.category-item span {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--gray-800);
  max-width: 86px;
}
.hero {
  position: relative;
  overflow: hidden;
  background: var(--gray-100);
}

.hero-track {
  display: flex;
  transition: transform .5s ease;
}

.hero-slide {
  min-width: 100%;
  flex-shrink: 0;
}

.hero-slide img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
}

.hero-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background .2s;
}

.hero-dot.active { background: var(--white); }

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.9);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  color: var(--purple);
  box-shadow: var(--shadow);
  transition: background .2s;
  z-index: 2;
}

.hero-arrow:hover { background: var(--white); }
.hero-arrow.prev { left: 12px; }
.hero-arrow.next { right: 12px; }

/* Categories - removed old grid */

/* Products section */
.products-section {
  padding: 28px 0;
}

.products-section + .products-section {
  border-top: 1px solid var(--gray-100);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.carousel-nav {
  display: flex;
  gap: 8px;
}

.carousel-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--gray-200);
  background: var(--white);
  color: var(--purple);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, border-color .2s;
}

.carousel-btn svg {
  width: 18px;
  height: 18px;
  display: block;
}

.carousel-btn:hover {
  background: var(--purple);
  color: var(--white);
  border-color: var(--purple);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.products-carousel {
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  margin: 0 -16px;
  padding: 0 16px 8px;
}

.products-carousel::-webkit-scrollbar { display: none; }

.products-track {
  display: flex;
  gap: 16px;
}

.products-track .product-card {
  flex: 0 0 calc(25% - 12px);
  min-width: 220px;
  scroll-snap-align: start;
}

/* Aniversario home banner */
.aniv-home-banner {
  display: block;
  text-decoration: none;
  background: linear-gradient(90deg, #2a0066 0%, #440099 55%, #5b1bb5 100%);
  color: var(--white);
  padding: 18px 0;
  transition: filter 0.15s;
}

.aniv-home-banner:hover {
  filter: brightness(1.06);
}

.aniv-home-banner-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}

.aniv-home-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.aniv-home-copy {
  flex: 1;
  min-width: 200px;
}

.aniv-home-copy strong {
  display: block;
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  margin-bottom: 2px;
}

.aniv-home-copy span {
  font-size: 14px;
  opacity: 0.9;
}

/* Promo banners */
.promo-section {
  padding: 24px 0;
}

.promo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.promo-grid a {
  border-radius: var(--radius);
  overflow: hidden;
  display: block;
  transition: transform .2s, box-shadow .2s;
}

.promo-grid a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0,0,0,.12);
}

.promo-grid img {
  width: 100%;
  height: 120px;
  object-fit: cover;
}

/* Product card */
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, transform .2s;
  position: relative;
  color: inherit;
}

.product-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.12);
  transform: translateY(-2px);
}

.product-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  display: flex;
  justify-content: space-between;
  z-index: 1;
  pointer-events: none;
}

.badge {
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  line-height: 1.2;
}

.badge-coupon {
  background: var(--purple);
  color: var(--white);
}

.badge-sale {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: var(--white);
}

.badge-stock {
  background: #e65100;
  color: var(--white);
}

.product-image {
  padding: 16px;
  background: var(--white);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-image img {
  max-height: 160px;
  object-fit: contain;
}

.product-body {
  padding: 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.product-title {
  font-size: 13px;
  font-weight: 400;
  color: var(--gray-800);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 38px;
}

.product-prices {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.price-original {
  font-size: 12px;
  color: var(--gray-500);
  text-decoration: line-through;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-current {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
}

.price-discount {
  background: var(--pink);
  color: var(--white);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.price-cuotas {
  font-size: 12px;
  color: var(--gray-500);
}

.price-national {
  font-size: 11px;
  color: var(--gray-500);
}

.product-shipping {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  margin-top: auto;
}

.price-free {
  color: var(--green);
}

.cuota-badge {
  position: absolute;
  bottom: 108px;
  left: 12px;
  background: var(--purple);
  color: var(--white);
  font-size: 13px;
  font-weight: 800;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  z-index: 1;
}

/* Site footer — estilo Frávega */
.site-footer {
  background: var(--white);
  color: var(--gray-800);
  border-top: 1px solid var(--gray-200);
  margin-top: 40px;
  padding: 32px 0 24px;
}

.site-footer-top {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--gray-200);
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--gray-800);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, color .2s;
}

.footer-social-link:hover {
  background: var(--purple);
  color: var(--white);
}

.footer-social-link svg {
  width: 18px;
  height: 18px;
}

.footer-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.footer-info-block h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.footer-info-block p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-800);
  margin-bottom: 4px;
}

.footer-info-block strong {
  font-weight: 700;
}

.footer-hours {
  font-size: 12px !important;
  color: var(--gray-500) !important;
  margin-top: 6px !important;
}

.footer-whatsapp {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.footer-whatsapp svg {
  width: 28px;
  height: 28px;
  color: #25d366;
  flex-shrink: 0;
}

.footer-whatsapp span {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
}

.site-footer-mid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  padding: 28px 0;
  border-bottom: 1px solid var(--gray-200);
}

.footer-newsletter-label {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}

.footer-newsletter-form {
  display: flex;
  gap: 0;
}

.footer-newsletter-form input {
  flex: 1;
  border: 1px solid var(--gray-200);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}

.footer-newsletter-form input:focus {
  border-color: var(--purple);
}

.footer-newsletter-form button {
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  cursor: pointer;
  white-space: nowrap;
}

.footer-newsletter-form button:hover {
  background: var(--purple-dark);
}

.footer-links-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.footer-links-grid h4 {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
}

.footer-links-grid ul {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-links-grid a {
  font-size: 12px;
  color: var(--gray-500);
}

.footer-links-grid a:hover {
  color: var(--purple);
}

.site-footer-bottom {
  padding-top: 20px;
  text-align: center;
  font-size: 11px;
  color: var(--gray-500);
  line-height: 1.7;
}

.site-footer-bottom p + p {
  margin-top: 6px;
}

.footer-legal {
  max-width: 900px;
  margin: 10px auto 0;
  font-size: 10px !important;
}

.logo-brand {
  gap: 10px;
}

.logo-brand img {
  height: 36px;
  width: auto;
}

.logo-wordmark {
  font-size: 22px;
  font-weight: 800;
  color: var(--gray-800);
  letter-spacing: -0.03em;
  line-height: 1;
}

.footer-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-link img {
  height: 32px;
  width: auto;
}

.footer-brand-link .logo-wordmark {
  font-size: 20px;
}

@media (max-width: 768px) {
  .logo-brand img {
    height: 30px;
  }

  .logo-wordmark {
    font-size: 18px;
  }
}

/* Legacy footer (fallback) */
.footer {
  background: #2d2d2d;
  color: #ccc;
  padding: 40px 0 24px;
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.footer h4 {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--white);
}

.footer ul { display: flex; flex-direction: column; gap: 8px; }

.footer a {
  font-size: 13px;
  color: #aaa;
}

.footer a:hover { color: var(--white); }

.footer-contact p {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 6px;
  line-height: 1.5;
}

.footer-contact strong {
  color: var(--white);
  font-size: 18px;
  display: block;
}

.footer-newsletter {
  grid-column: span 2;
}

.footer-newsletter p {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 10px;
}

.newsletter-form {
  display: flex;
  gap: 8px;
}

.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid #555;
  border-radius: var(--radius);
  background: #3a3a3a;
  color: var(--white);
  font-size: 13px;
  outline: none;
}

.newsletter-form input:focus { border-color: var(--purple-light); }

.newsletter-form button {
  padding: 10px 20px;
  background: var(--purple);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.newsletter-form button:hover { background: var(--purple-dark); }

.footer-bottom {
  text-align: center;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid #444;
  font-size: 11px;
  color: #888;
  line-height: 1.6;
}

.footer-logo {
  display: inline-block;
  margin-bottom: 16px;
}

.footer-logo img {
  height: 36px;
  width: auto;
  display: block;
}

.footer-minimal {
  padding: 24px 0;
  margin-top: 40px;
  text-align: center;
}

.footer-minimal p {
  font-size: 12px;
  color: #888;
  margin-top: 12px;
}

.footer-bottom p + p { margin-top: 8px; }

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gray-800);
}

.section-title span { color: var(--purple); }

/* Responsive */
@media (max-width: 1024px) {
  .info-grid { grid-template-columns: repeat(2, 1fr); }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .products-track .product-card { flex: 0 0 calc(33.333% - 11px); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-newsletter { grid-column: span 2; }
  .promo-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer-top { grid-template-columns: 1fr; }
  .footer-info-grid { grid-template-columns: repeat(2, 1fr); }
  .site-footer-mid { grid-template-columns: 1fr; }
  .footer-links-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-inner {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 10px;
    padding: 10px 0;
  }

  .logo {
    grid-row: 1;
    grid-column: 1;
    min-width: 0;
    overflow: hidden;
  }

  .header-actions {
    grid-row: 1;
    grid-column: 2;
    justify-self: end;
    gap: 10px;
    flex-shrink: 0;
    padding-right: 2px;
  }

  .header-actions a {
    font-size: 0;
    gap: 0;
  }

  .header-actions .cart-badge {
    top: -4px;
    right: 0;
  }

  .search-form {
    grid-column: 1 / -1;
    grid-row: 2;
    max-width: 100%;
    width: 100%;
    margin: 0;
  }

  .search-form input {
    padding: 10px 12px;
    font-size: 13px;
  }

  .search-form button {
    padding: 0 14px;
  }

  .logo-wordmark {
    font-size: 17px;
  }

  .page-pdp .logo-wordmark {
    display: none;
  }

  .top-bar .container { justify-content: center; flex-wrap: wrap; gap: 10px; }
  .info-grid { grid-template-columns: 1fr 1fr; }

  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .products-track .product-card { flex: 0 0 calc(50% - 8px); min-width: 180px; }
  .hero-slide img { max-height: 220px; }
  .hero-arrow { display: none; }
  .promo-grid { grid-template-columns: 1fr; }
  .promo-grid img { height: 100px; }
}

@media (max-width: 480px) {
  .container { padding: 0 12px; }

  .nav .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .logo-wordmark { display: none; }

  .category-item { flex: 0 0 76px; }
  .category-item img { width: 56px; height: 56px; }
  .category-item span { font-size: 10px; }
  .products-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .price-current { font-size: 18px; }
  .section-title { font-size: 18px; }
  .info-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-newsletter { grid-column: span 1; }
  .footer-info-grid { grid-template-columns: 1fr; }
  .footer-links-grid { grid-template-columns: repeat(2, 1fr); }
}
