/* ==========================================================================
 * RefaMaster — EstiloPremium.css · Capa premium de la tienda pública
 * --------------------------------------------------------------------------
 * Refina la experiencia de compra sin tocar lógica: header de cristal,
 * héroe con profundidad, tarjetas con hover físico, píldoras, botones con
 * gradiente de marca y micro-interacciones contenidas. Identidad intacta:
 * rojo #E30613 / negro / blanco, Sora + Manrope.
 * Se carga AL ÚLTIMO para prevalecer. Respeta dark theme y reduce motion.
 * ========================================================================== */

:root {
  --rm-red: #E30613;
  --rm-red-deep: #B0050F;
  --rm-ink: #101014;
  --rm-card-shadow: 0 18px 44px rgba(12, 12, 16, 0.10);
  --rm-card-shadow-hover: 0 26px 60px rgba(12, 12, 16, 0.16);
  --rm-ring: 0 0 0 3px rgba(227, 6, 19, 0.14);
}

/* ---------- Header de cristal ---------- */
.header-main,
.header-top {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-search input {
  border-radius: 999px;
  background: transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input:focus {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.header-nav a {
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.header-cart {
  box-shadow: 0 10px 24px rgba(227, 6, 19, 0.35);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.header-cart:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 30px rgba(227, 6, 19, 0.45);
}

.header-cart:active {
  transform: scale(0.96);
}

/* ---------- Botones: tacto físico ---------- */
.btn-primario {
  background: linear-gradient(180deg, #F31624 0%, var(--rm-red) 55%, var(--rm-red-deep) 100%);
  border-radius: 12px;
  box-shadow: 0 10px 22px rgba(227, 6, 19, 0.28);
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.btn-primario:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
  box-shadow: 0 16px 30px rgba(227, 6, 19, 0.36);
}

.btn-primario:active {
  transform: scale(0.97);
  box-shadow: 0 6px 14px rgba(227, 6, 19, 0.28);
}

.btn-secundario {
  border-radius: 12px;
  transition: transform 0.16s ease, border-color 0.18s ease, background 0.18s ease;
}

.btn-secundario:hover {
  border-color: rgba(227, 6, 19, 0.5);
}

.btn-secundario:active {
  transform: scale(0.97);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: none;
  box-shadow: var(--rm-ring);
}

/* ---------- Héroe con profundidad ---------- */
.hero-inicio {
  border-radius: 0 0 28px 28px;
  overflow: hidden;
}

.hero-inicio-content .kicker {
  letter-spacing: 0.22em;
}

.hero-inicio-content h1 {
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.hero-badge {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(227, 6, 19, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

/* ---------- Titulares de sección ---------- */
.section-head .kicker,
.seccion-titulo .kicker {
  letter-spacing: 0.2em;
}

/* ---------- Tarjetas de producto ---------- */
.producto-card,
.product-card {
  border-radius: 22px;
  border-color: #E8E9ED;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.producto-card:hover,
.product-card:hover {
  transform: translateY(-6px);
  border-color: rgba(227, 6, 19, 0.35);
  box-shadow: var(--rm-card-shadow-hover);
}

.producto-image-wrap,
.product-card-image {
  background: linear-gradient(180deg, #F7F8FA 0%, #EFF0F4 100%);
  overflow: hidden;
}

.producto-main-image,
.product-card-image img {
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.producto-card:hover .producto-main-image,
.product-card:hover .product-card-image img {
  transform: scale(1.06);
}

.product-badge,
.tag-oferta {
  border-radius: 999px;
  letter-spacing: 0.06em;
  box-shadow: 0 6px 14px rgba(227, 6, 19, 0.3);
}

.producto-card h3,
.product-card h3 {
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.producto-brand {
  letter-spacing: 0.04em;
}

.producto-seller,
.product-meta {
  color: #6B7280;
}

.producto-precio {
  letter-spacing: -0.02em;
}

.producto-foot .btn,
.product-card-footer .btn {
  border-radius: 12px;
}

/* Píldoras de categoría/marca */
.categoria-btn {
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.categoria-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 6, 19, 0.5);
}

.categoria-btn.activo {
  background: linear-gradient(180deg, #F31624 0%, var(--rm-red-deep) 100%);
  box-shadow: 0 8px 18px rgba(227, 6, 19, 0.32);
}

.categoria-btn:active {
  transform: scale(0.97);
}

/* Barra de herramientas del catálogo */
.catalog-toolbar {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 16px;
  padding: 10px 12px;
  border: 1px solid #ECEDEF;
}

/* Barra protagonista: buscador ancho y controles grandes. */
.catalog-toolbar .search-wrap {
  flex: 1 1 340px;
  max-width: 560px;
}

.catalog-toolbar .search-wrap input {
  width: 100%;
  min-height: 50px;
  font-size: 1.02rem;
  border-radius: 14px;
}

.catalog-toolbar .btn {
  min-height: 50px;
  font-size: 0.95rem;
}

.catalog-toolbar .catalog-filter-toggle {
  padding-inline: 20px;
  border-radius: 14px;
}

.catalog-toolbar .catalog-sort-wrap select {
  border-radius: 12px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 0.95rem;
  min-height: 50px;
}

.catalog-toolbar .catalog-sort-wrap label {
  font-size: 0.9rem;
  font-weight: 700;
}

.catalog-view-toggle .btn {
  border-radius: 12px;
}

/* Confianza / beneficios */
.benefit,
.diferencia-card {
  border-radius: 18px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.benefit:hover,
.diferencia-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--rm-card-shadow);
}

.benefit i,
.diferencia-card i {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(227, 6, 19, 0.09);
}

/* ---------- Modal y carrito ---------- */
.pm-dialog {
  border-radius: 22px;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.4);
}

.pm-overlay {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.cart-drawer {
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.25);
}

.qty-btn {
  border-radius: 10px;
  transition: background 0.15s ease, transform 0.12s ease;
}

.qty-btn:active {
  transform: scale(0.92);
}

/* ---------- Inicio: héroe grande + buscador protagonista ---------- */
.hero-inicio {
  min-height: 600px;
  align-items: center;
}

.hero-stats {
  display: flex;
  gap: 28px;
  margin: 26px 0 0;
  padding: 0;
}

.hero-stats > div {
  display: grid;
  gap: 2px;
}

.hero-stats dt {
  font-family: "Sora", sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  letter-spacing: -0.02em;
  color: #FFFFFF;
}

.hero-stats dd {
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.72);
}

.search-hero {
  position: relative;
  z-index: 5;
  margin-top: -64px;
  padding-bottom: 8px;
}

.search-hero-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FFFFFF;
  border: 1px solid #ECEDEF;
  border-radius: 20px;
  padding: 12px 12px 12px 20px;
  box-shadow: 0 24px 60px rgba(12, 12, 16, 0.14);
}

.search-hero-card > i {
  font-size: 1.3rem;
  color: var(--rm-red);
  flex: 0 0 auto;
}

.search-hero-card input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  font-size: 1.05rem;
  font-family: "Manrope", sans-serif;
  background: transparent;
  min-height: 48px;
}

.search-hero-card .btn {
  flex: 0 0 auto;
  padding: 14px 30px;
  font-size: 1rem;
}

.search-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.86rem;
  color: #6B7280;
}

.search-chips a {
  border: 1px solid #E3E5EA;
  background: #FFFFFF;
  color: #111114;
  border-radius: 999px;
  padding: 7px 16px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.15s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.search-chips a:hover {
  transform: translateY(-1px);
  border-color: rgba(227, 6, 19, 0.5);
  box-shadow: 0 8px 18px rgba(12, 12, 16, 0.10);
}

.category-tile-icon {
  display: grid;
  place-items: center;
  min-height: 135px;
  background: linear-gradient(135deg, #17171c 0%, #3a0d12 100%);
  color: #FFFFFF;
  font-size: 2.2rem;
}

a.brand-card {
  text-decoration: none;
  color: inherit;
}

a.tip-card {
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.tip-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--rm-card-shadow);
}

html[data-theme="dark"] .search-hero-card {
  background: #141419;
  border-color: #26262c;
}

html[data-theme="dark"] .search-hero-card input {
  color: #F3F4F6;
}

html[data-theme="dark"] .search-chips {
  color: #9AA0AE;
}

html[data-theme="dark"] .search-chips a {
  background: #141419;
  border-color: #2c2c33;
  color: #F3F4F6;
}

@media (max-width: 768px) {
  .hero-inicio {
    min-height: 0;
  }

  .search-hero {
    margin-top: -40px;
  }

  .search-hero-card {
    flex-wrap: wrap;
  }

  .search-hero-card .btn {
    width: 100%;
  }

  .hero-stats {
    gap: 18px;
    flex-wrap: wrap;
  }
}

/* ---------- Tema oscuro ---------- */
html[data-theme="dark"] .header-search input {
  background: rgba(255, 255, 255, 0.06);
  border-color: #333842;
  color: #F3F4F6;
}

html[data-theme="dark"] .catalog-toolbar {
  background: rgba(14, 14, 18, 0.86);
  border-color: #26262c;
}

html[data-theme="dark"] .producto-card,
html[data-theme="dark"] .product-card {
  background: #141419;
  border-color: #26262c;
}

html[data-theme="dark"] .producto-image-wrap,
html[data-theme="dark"] .product-card-image {
  background: linear-gradient(180deg, #1b1b21 0%, #131318 100%);
}

html[data-theme="dark"] .producto-seller,
html[data-theme="dark"] .product-meta {
  color: #9AA0AE;
}

html[data-theme="dark"] .benefit i,
html[data-theme="dark"] .diferencia-card i {
  background: rgba(227, 6, 19, 0.16);
}

/* ---------- Header amplio site-wide (como el inicio) ---------- */
.header-top {
  padding: 16px 28px;
  gap: 22px;
}

.header-logo img {
  width: 168px;
  height: auto;
}

.header-nav-inline {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 0 auto;
}

.header-nav-inline a {
  text-decoration: none;
  color: #111114;
  font-weight: 700;
  font-size: 1.02rem;
  padding: 12px 24px;
  border-radius: 999px;
  transition: background 0.18s ease, color 0.18s ease;
}

.header-nav-inline a:hover {
  background: rgba(0, 0, 0, 0.05);
}

.header-nav-inline a.activo {
  background: var(--rm-red, #E30613);
  color: #FFFFFF;
  box-shadow: 0 8px 18px rgba(227, 6, 19, 0.32);
}

.header-actions {
  gap: 14px;
}

.header-cart {
  width: 54px;
  height: 54px;
  font-size: 1.25rem;
}

.header-cart-count {
  font-size: 0.8rem;
  min-width: 22px;
  height: 22px;
}

@media (min-width: 1024px) {
  .header-main > .header-nav {
    display: none;
  }

  .header-nav-inline {
    display: inline-flex;
  }
}

/* ---------- Inicio: héroe full-bleed ---------- */
.page-inicio .hero-inicio {
  position: relative;
  display: block;
  min-height: 660px;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  overflow: hidden;
}

.page-inicio .hero-inicio-image {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
}

.page-inicio .hero-inicio-image img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center 65%;
}

.page-inicio .hero-inicio-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(8,8,10,0.94) 0%, rgba(8,8,10,0.78) 34%, rgba(8,8,10,0.25) 62%, rgba(8,8,10,0.05) 100%);
}

.page-inicio .hero-inicio-content {
  position: relative;
  z-index: 2;
  max-width: 640px;
  padding: 84px 0 120px 6vw;
}

.page-inicio .hero-inicio-content h1 {
  font-size: clamp(3rem, 6.5vw, 5.2rem);
}

.page-inicio .hero-badge-top {
  top: 36px;
}

.page-inicio .hero-badge-bottom {
  bottom: 36px;
}

@media (max-width: 768px) {
  .header-top {
    padding: 12px 16px;
    gap: 14px;
  }

  .header-logo img {
    width: 138px;
  }

  .header-cart {
    width: 48px;
    height: 48px;
  }

  .page-inicio .hero-inicio {
    min-height: 560px;
  }

  .page-inicio .hero-inicio-image img {
    object-position: 70% center;
  }

  .page-inicio .hero-inicio-image::after {
    background: linear-gradient(180deg, rgba(8,8,10,0.55) 0%, rgba(8,8,10,0.88) 70%, rgba(8,8,10,0.96) 100%);
  }

  .page-inicio .hero-inicio-content {
    padding: 200px 5vw 130px;
  }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  header.header-main {
    transition: none;
  }

  .producto-card,
  .product-card,
  .btn-primario,
  .btn-secundario,
  .categoria-btn,
  .header-cart,
  .benefit,
  .diferencia-card {
    transition: none;
  }

  .producto-card:hover,
  .product-card:hover,
  .btn-primario:hover,
  .header-cart:hover {
    transform: none;
  }

  .producto-main-image,
  .product-card-image img {
    transition: none;
  }
}
