/* Stylesheet de Tienda (home/catalogo)

   Este archivo solo lo carga tienda.ejs (ademas de /css/app.css).
   Contiene layout especifico del storefront y micro-interacciones puntuales.

   Importante:
   - NO define tokens. Consume los tokens globales de /css/app/base/tokens.css.
   - Evita duplicar estilos globales ya presentes en /css/app.css.
 */

/* Use gentle transitions only when JS is present */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(10px);
}

html.js [data-reveal].is-in {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 520ms ease, transform 520ms ease;
  transition-delay: calc(min(var(--i, 0), 10) * 42ms);
}

/* HERO */
.hero {
  position: relative;
  overflow: hidden;
  padding: 42px 0 28px;
  border-bottom: 1px solid var(--line);
}

.hero::after {
  content: "";
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 520px;
  background:
    radial-gradient(600px 380px at 20% 35%, rgba(198, 167, 94, 0.15), transparent 60%),
    radial-gradient(520px 360px at 70% 10%, rgba(95, 182, 255, 0.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 70%);
  filter: blur(0px);
  pointer-events: none;
  z-index: 0;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 22px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(198, 167, 94, 0.18);
  background: rgba(198, 167, 94, 0.06);
  color: var(--gold2);
  font-size: 0.78rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero-h1 {
  margin: 14px 0 10px;
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 0.6px;
  font-size: clamp(2.1rem, 3.2vw, 3.25rem);
  line-height: 0.98;
}

.hero-h1 .gold {
  color: var(--gold2);
  text-shadow: 0 0 28px rgba(198, 167, 94, 0.20);
}

.hero-sub {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.0rem, 1.25vw, 1.08rem);
  line-height: 1.6;
  max-width: 54ch;
}

.hero-cta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn-ghost {
  color: var(--text);
  background: var(--wash2);
  border-color: var(--line2);
  box-shadow: var(--shadow2);
}

.btn-ghost:hover {
  background: var(--wash);
  border-color: rgba(198, 167, 94, 0.26);
  box-shadow: var(--glow);
}

/* Signature block */
.signature {
  border-radius: var(--r-lg);
  border: 1px solid rgba(198, 167, 94, 0.18);
  background: radial-gradient(80% 140% at 20% 20%, rgba(226, 205, 141, 0.12), transparent 55%),
    radial-gradient(60% 80% at 70% 0%, rgba(95, 182, 255, 0.10), transparent 60%),
    linear-gradient(145deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  box-shadow: var(--shadow0);
  overflow: hidden;
  position: relative;
  min-height: 240px;
}

.signature::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0 40%, rgba(198,167,94,0.11) 50%, transparent 60% 100%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 10px);
  opacity: 0.65;
  transform: translateX(-20%);
  animation: sweep 3.6s ease-in-out infinite;
}

@keyframes sweep {
  0% { transform: translateX(-24%); opacity: 0.45; }
  50% { transform: translateX(6%); opacity: 0.70; }
  100% { transform: translateX(-24%); opacity: 0.45; }
}

.signature-inner {
  position: relative;
  z-index: 1;
  padding: 18px 18px 16px;
  display: grid;
  gap: 10px;
}

.sig-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.sig-label {
  font-size: 0.72rem;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--muted2);
}

.sig-code {
  font-family: var(--font-mono);
  color: var(--gold2);
  font-size: 0.82rem;
}

.sig-title {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: 0.6px;
  font-size: 1.55rem;
  margin: 0;
}

.sig-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

.sig-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.metric {
  background: var(--wash2);
  border: 1px solid var(--line2);
  border-radius: 12px;
  padding: 10px 10px;
}

.metric .k {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--muted2);
}

.metric .v {
  margin-top: 6px;
  font-weight: 600;
  color: var(--gold2);
  letter-spacing: 0.2px;
}

/* BENEFITS */
.benefits {
  padding: 18px 0 4px;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.benefit {
  border-radius: 14px;
  background: linear-gradient(180deg, var(--wash), var(--wash2));
  border: 1px solid var(--line2);
  box-shadow: var(--shadow2);
  padding: 14px 14px;
  display: grid;
  gap: 8px;
}

.benefit .b-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.benefit .icon {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(198, 167, 94, 0.08);
  border: 1px solid rgba(198, 167, 94, 0.18);
  color: var(--gold2);
}

.benefit h3 {
  margin: 0;
  font-size: 0.92rem;
  letter-spacing: 0.2px;
}

.benefit p {
  margin: 0;
  color: var(--muted2);
  font-size: 0.86rem;
  line-height: 1.45;
}

/* CATALOG */
.catalog {
  padding: 22px 0 44px;
}

/* FOOTER */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10,10,14,0.20), rgba(10,10,14,0.72));
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(700px 360px at 20% 0%, rgba(198, 167, 94, 0.10), transparent 60%),
    radial-gradient(640px 360px at 80% 30%, rgba(95, 182, 255, 0.06), transparent 65%);
  opacity: 0.9;
}

.footer-grid {
  position: relative;
  z-index: 1;
  padding: 34px 0 22px;
  display: grid;
  grid-template-columns: 1.35fr 0.75fr 0.75fr 0.75fr;
  gap: 18px;
}

.footer-brand { padding-right: 8px; }

.footer-mark {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.45));
}

.footer-name {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--gold2);
}

.footer-tag {
  margin-top: 2px;
  font-size: 0.70rem;
  color: var(--muted2);
  letter-spacing: 2.4px;
  text-transform: uppercase;
}

.footer-copy {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.90rem;
  line-height: 1.6;
  max-width: 58ch;
}

.footer-title {
  font-size: 0.78rem;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: var(--gold2);
  margin-bottom: 10px;
}

.footer-col {
  display: grid;
  align-content: start;
  gap: 8px;
  padding-top: 4px;
}

.footer-link {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.90rem;
  padding: 6px 8px;
  margin-left: -8px;
  border-radius: 10px;
  border: 1px solid transparent;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.footer-link:hover {
  background: var(--wash);
  border-color: var(--line2);
  color: var(--text);
}

.footer-link:focus-visible {
  outline: 2px solid rgba(198, 167, 94, 0.62);
  outline-offset: 2px;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 0 22px;
  border-top: 1px solid var(--line2);
  color: var(--muted2);
  font-size: 0.86rem;
}

.footer-mini {
  font-family: var(--font-mono);
  letter-spacing: 0.2px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 0 14px;
}

.section-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.8rem;
  letter-spacing: 0.6px;
}

.section-sub {
  margin: 0;
  color: var(--muted2);
  font-size: 0.95rem;
  line-height: 1.45;
}

.productos-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.catalog-actions {
  margin-top: 18px;
  display: grid;
  place-items: center;
  gap: 10px;
}

.load-more-meta {
  color: var(--muted2);
  font-size: 0.88rem;
}

.producto-card {
  grid-column: span 4;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: linear-gradient(180deg, var(--wash), var(--wash2));
  border: 1px solid var(--line2);
  box-shadow: var(--shadow1);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  position: relative;
}

.producto-card:hover {
  transform: translateY(-3px);
  border-color: rgba(198, 167, 94, 0.22);
  box-shadow: var(--glow);
}

.producto-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(600px 220px at 20% 0%, rgba(226, 205, 141, 0.10), transparent 60%);
  opacity: 0;
  transition: opacity 180ms ease;
}

.producto-card:hover::before { opacity: 1; }

.producto-media {
  position: relative;
  height: 214px;
  background: var(--panel2);
}

.producto-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: contrast(1.02) saturate(1.02);
  transform: scale(1.001);
  transition: transform 260ms ease, filter 260ms ease;
}

.producto-card:hover .producto-media img {
  transform: scale(1.03);
  filter: contrast(1.05) saturate(1.05);
}

.producto-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(60% 90% at 40% 15%, rgba(255,255,255,0.14), transparent 55%),
    linear-gradient(180deg, rgba(0,0,0,0.0) 10%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}

.badge-stock {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  border: 1px solid var(--line2);
  background: var(--panel);
  backdrop-filter: blur(10px);
}

.badge-ok { color: var(--gold2); border-color: rgba(198, 167, 94, 0.24); }
.badge-bajo { color: rgba(255, 193, 7, 0.92); border-color: rgba(255, 193, 7, 0.22); }
.badge-agotado { color: rgba(255, 107, 107, 0.92); border-color: rgba(255, 107, 107, 0.22); }

.producto-info {
  padding: 14px 14px 14px;
}

.producto-nombre {
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: 0.2px;
  margin: 0 0 6px;
}

.producto-descripcion {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.producto-descripcion.expandida {
  -webkit-line-clamp: unset;
}

.btn-desc {
  margin-top: 10px;
  background: transparent;
  border: 1px solid var(--line2);
  color: var(--gold2);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.80rem;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}

.btn-desc:hover {
  background: rgba(198, 167, 94, 0.08);
  border-color: rgba(198, 167, 94, 0.20);
}

.btn-desc:active { transform: translateY(0); }

.row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.precio {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--gold2);
  letter-spacing: 0.2px;
}

.stock-texto {
  color: var(--muted2);
  font-size: 0.82rem;
}

/* Empty state */
.empty-state {
  margin: 24px 0 0;
  border-radius: var(--r-lg);
  border: 1px dashed rgba(198, 167, 94, 0.20);
  background: var(--wash2);
  padding: 36px 16px;
  text-align: center;
  color: var(--muted);
}

.empty-state h3 {
  margin: 10px 0 6px;
  font-family: var(--font-serif);
  color: var(--gold2);
  font-size: 1.5rem;
}

/* FILTROS */
.filtros-container {
  margin-bottom: 20px;
  position: relative;
}

.dropdown {
  position: relative;
  display: inline-block;
}

.filtros-toggle {
  background: none;
  border: none;
  padding: 0;
  color: var(--text);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.filtros-toggle:hover {
  color: var(--primary);
  text-decoration: underline;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10;
  min-width: 300px;
  padding: 16px;
}

.dropdown-content.show {
  display: block;
}

.filtros-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.filtro-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filtro-group label {
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--text);
}

.filtro-group select {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--panel2);
  color: var(--text);
  font-size: 0.85rem;
}

.btn-filtrar {
  align-self: flex-end;
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.85rem;
  transition: background 0.2s ease;
}

.btn-filtrar:hover {
  background: var(--primary-hover);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: rgba(26, 26, 26, 0.85) !important;
  color: white !important;
  padding: 20px 40px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 1.1rem;
  font-weight: 600;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1 !important;
  transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; }
  .signature { min-height: 220px; }
  .benefits-grid { grid-template-columns: repeat(2, 1fr); }
  .producto-card { grid-column: span 6; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { width: min(var(--max), calc(100% - 28px)); }
  .brand-tag { display: none; }
  .nav-brand { min-width: 0; }
  .producto-card { grid-column: span 12; }
  .benefits-grid { grid-template-columns: 1fr; }
  .sig-metrics { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}
