/**
 * ML Boutique - Hoja de Estilos Principal (Tienda Pública)
 * Paleta oficial:
 *   --color-gold:       #b8954a
 *   --color-gold-dark:  #8e7032
 *   --color-gold-soft:  #e9dcc0
 *   --color-cream:      #f7f1e8
 *   --color-sand:       #ece3d5
 *   --color-blush:      #b5577a
 *   --color-blush-dark: #93405f
 *   --color-blush-soft: #f5e3ea
 *   --color-ink:        #1c1a19
 *   --color-muted:      #6f6660
 *   --color-wa:         #1f9e55
 *   --color-wa-dark:    #178244
 * Tipografías:
 *   Serif: Cormorant Garamond
 *   Sans:  Inter
 */

:root {
  --color-gold: #b8954a;
  --color-gold-dark: #8e7032;
  --color-gold-soft: #e9dcc0;
  --color-cream: #f7f1e8;
  --color-sand: #ece3d5;
  --color-blush: #b5577a;
  --color-blush-dark: #93405f;
  --color-blush-soft: #f5e3ea;
  --color-ink: #1c1a19;
  --color-muted: #6f6660;
  --color-wa: #1f9e55;
  --color-wa-dark: #178244;
  --color-white: #ffffff;

  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(28, 26, 25, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(28, 26, 25, 0.07), 0 2px 4px -2px rgba(28, 26, 25, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(28, 26, 25, 0.08), 0 4px 6px -4px rgba(28, 26, 25, 0.04);

  /* Sombras teñidas con el dorado de la paleta (en lugar de negro plano) */
  --shadow-card: 0 1px 2px rgba(142, 112, 50, 0.06), 0 10px 28px -16px rgba(142, 112, 50, 0.28);
  --shadow-card-hover: 0 2px 4px rgba(142, 112, 50, 0.06), 0 28px 48px -22px rgba(142, 112, 50, 0.42);

  /* Movimiento: curvas suaves de salida, nunca lineales */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 180ms;
  --dur: 320ms;
  --dur-slow: 800ms;
}

/* ==========================================================================
   Reset & Base
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-tap-highlight-color: transparent;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--color-ink);
  background-color: var(--color-cream);
  /* Luz ambiental muy tenue con los mismos tonos de la paleta */
  background-image:
    radial-gradient(60rem 40rem at 85% -10%, rgba(233, 220, 192, 0.55), transparent 60%),
    radial-gradient(50rem 36rem at -10% 30%, rgba(245, 227, 234, 0.35), transparent 60%);
  background-attachment: fixed;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Grano fino de papel: rompe la planitud digital sin alterar los colores */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection {
  background-color: var(--color-gold-soft);
  color: var(--color-ink);
}

/* Anillo de foco visible solo con teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

img, svg {
  display: block;
}

.font-serif {
  font-family: var(--font-serif);
}

.font-mono {
  font-family: var(--font-mono);
}

.text-muted {
  color: var(--color-muted);
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */
.main-content {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content > main {
  flex: 1;
}

.container {
  width: 100%;
  max-width: 72rem; /* 1152px (max-w-6xl) */
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* ==========================================================================
   Header de la Tienda
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(184, 149, 74, 0.25);
  background-color: rgba(247, 241, 232, 0.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  transition: box-shadow var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out);
}

/* Al hacer scroll el encabezado gana cuerpo (lo activa app.js) */
.site-header.is-scrolled {
  background-color: rgba(247, 241, 232, 0.94);
  box-shadow: 0 10px 30px -22px rgba(142, 112, 50, 0.55);
}

.site-header-inner {
  display: flex;
  height: 4rem;
  align-items: center;
  justify-content: space-between;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.brand-link svg {
  transition: transform var(--dur-slow) var(--ease-out);
}

.brand-link:hover svg {
  transform: rotate(-12deg) scale(1.04);
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--color-ink);
}

.brand-gold {
  color: var(--color-gold-dark);
}

.cart-icon-btn {
  position: relative;
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  color: var(--color-ink);
  transition: background-color var(--dur-fast) ease, transform var(--dur-fast) var(--ease-out);
}

.cart-icon-btn:hover {
  background-color: var(--color-sand);
}

.cart-icon-btn:active {
  transform: scale(0.94);
}

/* Rebote breve cuando cambia el número de artículos (lo activa app.js) */
.cart-badge.bump {
  animation: badge-bump 520ms var(--ease-out);
}

@keyframes badge-bump {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.cart-badge {
  position: absolute;
  top: 0.125rem;
  right: 0.125rem;
  display: flex;
  min-width: 1.25rem;
  height: 1.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: var(--color-blush);
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.25rem;
  color: var(--color-white);
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
  display: grid;
  gap: 1.5rem;
  align-items: center;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
}

@media (min-width: 640px) {
  .hero-section {
    grid-template-columns: 1.1fr 1fr;
    padding-top: 2.5rem;
  }
}

.hero-text-col {
  order: 2;
}

@media (min-width: 640px) {
  .hero-text-col {
    order: 1;
  }
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

/* Filete dorado que se dibuja al cargar */
.hero-kicker::before {
  content: "";
  width: 2rem;
  height: 1px;
  background-color: var(--color-gold);
  transform-origin: left center;
  animation: line-draw 1.1s var(--ease-out) 0.2s both;
}

@keyframes line-draw {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.hero-title {
  margin-top: 0.75rem;
  font-family: var(--font-serif);
  font-size: clamp(2.35rem, 5.2vw, 3.6rem);
  line-height: 1.02;
  font-weight: 600;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

.steps-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--color-muted);
  list-style: none;
  max-width: 30rem;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.step-number {
  display: flex;
  width: 1.75rem;
  height: 1.75rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(184, 149, 74, 0.55);
  background-color: rgba(255, 255, 255, 0.5);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-gold-dark);
}

.hero-img-col {
  order: 1;
  overflow: hidden;
  border-radius: 1.75rem;
  box-shadow: 0 30px 60px -36px rgba(142, 112, 50, 0.55);
  /* Revelado tipo cortina: la foto se descubre de abajo hacia arriba */
  animation: hero-reveal 1.3s var(--ease-out) 0.1s both;
}

@keyframes hero-reveal {
  from { clip-path: inset(100% 0 0 0 round 1.75rem); }
  to { clip-path: inset(0 0 0 0 round 1.75rem); }
}

.hero-img-col .hero-img {
  /* "backwards" y no "both": al terminar libera transform para el hover */
  animation: hero-settle 1.8s var(--ease-out) 0.1s backwards;
  transition: transform 1.6s var(--ease-out);
}

@keyframes hero-settle {
  from { transform: scale(1.12); }
  to { transform: scale(1); }
}

.hero-img-col:hover .hero-img {
  transform: scale(1.03);
}

/* Entrada escalonada de bloques: cada uno define su retraso con --d */
.anim-fade-up {
  animation: fade-up 0.9s var(--ease-out) var(--d, 0ms) both;
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}

@media (min-width: 640px) {
  .hero-img-col {
    order: 2;
  }
}

.hero-img {
  aspect-ratio: 16 / 11;
  width: 100%;
  object-fit: cover;
  object-position: 50% 35%;
}

@media (min-width: 640px) {
  .hero-img {
    aspect-ratio: 5 / 4;
  }
}

/* ==========================================================================
   Buscador Sticky y Chips de Categorías
   ========================================================================== */
.sticky-search-bar {
  position: sticky;
  top: 4rem;
  z-index: 20;
  border-bottom: 1px solid rgba(184, 149, 74, 0.15);
  background-color: rgba(247, 241, 232, 0.88);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  padding: 0.75rem 0;
}

.search-wrapper {
  position: relative;
  display: block;
}

.search-icon-pos {
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--color-muted);
  display: flex;
  align-items: center;
}

.search-input {
  width: 100%;
  border-radius: 9999px !important;
  padding: 0.625rem 1rem 0.625rem 2.75rem !important;
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
  outline: none;
  font-size: 1rem;
  box-shadow: 0 1px 2px rgba(142, 112, 50, 0.05);
  transition: border-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.search-input:hover {
  border-color: rgba(184, 149, 74, 0.45);
}

.search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 4px rgba(184, 149, 74, 0.18), 0 8px 24px -14px rgba(142, 112, 50, 0.45);
}

.search-icon-pos {
  transition: color var(--dur) var(--ease-out);
}

.search-wrapper:focus-within .search-icon-pos {
  color: var(--color-gold-dark);
}

.category-chips-row {
  margin-top: 0.75rem;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.25rem;
  white-space: nowrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-ink);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  white-space: nowrap;
}

.chip:hover {
  border-color: rgba(28, 26, 25, 0.4);
}

.chip:active:not(:disabled) {
  transform: scale(0.96);
}

.chip:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.chip.active {
  border-color: var(--color-ink);
  background-color: var(--color-ink);
  color: var(--color-cream);
}

.chip-gold-active,
.chip[aria-pressed="true"] {
  border-color: var(--color-gold);
  background-color: var(--color-gold-soft);
  color: var(--color-gold-dark);
}

/* ==========================================================================
   Cuadrícula de Productos
   ========================================================================== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 1rem;
  row-gap: 2rem;
  padding-top: 1.5rem;
}

@media (min-width: 640px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .product-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background-color: var(--color-white);
  border: 1px solid rgba(184, 149, 74, 0.14);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition:
    transform 0.55s var(--ease-out),
    box-shadow 0.55s var(--ease-out),
    border-color 0.55s var(--ease-out);
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-card-hover);
  border-color: rgba(184, 149, 74, 0.4);
}

.product-card:active {
  transform: translateY(-1px) scale(0.99);
  transition-duration: var(--dur-fast);
}

.product-thumb-wrap {
  position: relative;
  overflow: hidden;
  background-color: var(--color-sand);
  margin: 0.5rem 0.5rem 0 0.5rem;
  border-radius: 0.95rem;
  isolation: isolate;
  /* La proporción la manda la CAJA, no la foto: así una imagen de 4000x3000
     o una vertical de 1080x1920 ocupan exactamente el mismo hueco y todas
     las tarjetas del grid miden igual. */
  aspect-ratio: 4 / 5;
}

/* Velo cálido inferior que aparece al pasar el cursor */
.product-thumb-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to top, rgba(28, 26, 25, 0.18), transparent 45%);
  opacity: 0;
  transition: opacity 0.6s var(--ease-out);
}

.product-card:hover .product-thumb-wrap::before {
  opacity: 1;
}

.product-thumb {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  /* Reserva de hueco si la tarjeta se pinta antes de que el wrapper tenga
     tamaño (y para el placeholder SVG, que no es una imagen). */
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 50%;
  transition: transform 1.1s var(--ease-out), opacity 0.7s var(--ease-out);
}

.product-card:hover .product-thumb {
  transform: scale(1.045);
}

/* Las fotos aparecen con fundido al terminar de descargarse */
.img-fade:not(.is-loaded) {
  opacity: 0;
}

/* Texto solo para lectores de pantalla (anuncios del catálogo: #catalog-status-msg) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Esqueletos de carga del catálogo
   skeletonCardsHtml() ya emitía estas clases, pero solo estaban definidas en
   admin.css (que la tienda no carga): los placeholders salían con altura 0 y
   el grid daba un salto al llegar los datos. La altura se fija con el mismo
   aspect-ratio 4/5 de .product-thumb para que el hueco sea exacto (CLS ~0).
   -------------------------------------------------------------------------- */
.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background-color: var(--color-white);
  border: 1px solid rgba(184, 149, 74, 0.14);
  border-radius: 1.25rem;
  overflow: hidden;
  padding: 0.5rem 0.5rem 1rem;
}

.skeleton-block {
  background: linear-gradient(
    90deg,
    rgba(184, 149, 74, 0.08) 25%,
    rgba(184, 149, 74, 0.18) 37%,
    rgba(184, 149, 74, 0.08) 63%
  );
  background-size: 400% 100%;
  border-radius: 0.5rem;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}

.skeleton-thumb {
  aspect-ratio: 4 / 5;
  width: 100%;
  border-radius: 0.95rem;
}

.skeleton-line {
  height: 0.85rem;
  width: 55%;
  margin-left: 0.35rem;
}

.skeleton-line.wide {
  width: 80%;
}

@keyframes skeleton-shimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* Quien pide menos movimiento ve el placeholder quieto, no parpadeando. */
@media (prefers-reduced-motion: reduce) {
  .skeleton-block {
    animation: none;
  }
}

/* Centinela del scroll infinito: ocupa una línea del grid y no se ve. */
.catalog-sentinel {
  height: 1px;
  margin: 0;
  padding: 0;
}

/* Brillo de carga mientras la foto llega (solo navegadores con :has) */
.product-thumb-wrap:has(.img-fade:not(.is-loaded))::after,
.gallery-main:has(.img-fade:not(.is-loaded))::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.55) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.product-thumb.sold-out {
  opacity: 0.5;
  filter: grayscale(60%);
}

/* ==========================================================================
   Badges de Stock: mismos colores, movimiento sereno (sin saltos de escala)
   ========================================================================== */
.badge-stock {
  position: absolute;
  top: 0.625rem;
  left: 0.625rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-white);
  box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.35);
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.badge-dot {
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 9999px;
  background-color: #ffffff;
  display: inline-block;
  animation: dot-breathe 2.4s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Agotado */
.badge-sold-out {
  background-color: rgba(28, 26, 25, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Pocas piezas */
.badge-low-stock {
  background: linear-gradient(135deg, #b5577a 0%, #8e3256 100%);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

/* Última pieza: un halo lento que se expande, sin que la etiqueta salte */
.badge-last-piece {
  background: linear-gradient(135deg, #c73a6e 0%, #a82455 100%);
  border: 1px solid rgba(255, 225, 160, 0.45);
  animation: halo-last-piece 2.8s var(--ease-out) infinite;
}

@keyframes halo-last-piece {
  0% { box-shadow: 0 0 0 0 rgba(199, 58, 110, 0.45), 0 6px 16px -8px rgba(0, 0, 0, 0.35); }
  70%, 100% { box-shadow: 0 0 0 10px rgba(199, 58, 110, 0), 0 6px 16px -8px rgba(0, 0, 0, 0.35); }
}

/* Información y tipografía de la tarjeta */
.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 0.875rem 1rem 1rem;
}

.product-category-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
  margin-bottom: 0.25rem;
}

.product-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 600;
  color: var(--color-ink);
  transition: color 0.2s ease;
}

.product-card:hover .product-name {
  color: var(--color-gold-dark);
}

/* Número de catálogo: lo que la clienta copia al bot de WhatsApp. */
.product-catalog-no {
  margin-top: 0.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--color-muted);
  font-variant-numeric: tabular-nums;
}

.pd-catalog-no {
  margin-top: 0.625rem;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(184, 149, 74, 0.35);
  border-radius: 999px;
  background-color: rgba(233, 220, 192, 0.35);
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--color-gold-dark);
  font-variant-numeric: tabular-nums;
}

.pd-catalog-no strong {
  font-weight: 700;
}

@media (max-width: 640px) {
  .pd-catalog-no {
    font-size: 0.6875rem;
    padding: 0.25rem 0.6rem;
  }
}

.product-card-footer {
  margin-top: auto;
  padding-top: 0.625rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.product-price {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--color-gold-dark);
  font-variant-numeric: tabular-nums;
}

.product-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: color var(--dur) var(--ease-out);
}

.product-view-btn svg {
  transition: transform var(--dur) var(--ease-out);
}

.product-card:hover .product-view-btn {
  color: var(--color-ink);
}

.product-card:hover .product-view-btn svg {
  transform: translateX(3px);
}

/* ==========================================================================
   Detalle de Producto (producto.php)
   ========================================================================== */
.product-detail-layout {
  display: grid;
  gap: 2rem;
  margin-top: 0.5rem;
}

@media (min-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

.gallery-main {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background-color: var(--color-sand);
  box-shadow: 0 30px 60px -40px rgba(142, 112, 50, 0.55);
}

.gallery-main-img {
  aspect-ratio: 4 / 5;
  width: 100%;
  object-fit: cover;
  transition: opacity 0.7s var(--ease-out), transform 1.4s var(--ease-out);
}

@media (hover: hover) {
  .gallery-main:hover .gallery-main-img {
    transform: scale(1.03);
  }
}

/* Cambio de foto desde las miniaturas */
.gallery-main-img.swap-in {
  animation: img-swap 0.6s var(--ease-out) backwards;
}

@keyframes img-swap {
  from { opacity: 0; transform: scale(1.03); }
  to { opacity: 1; transform: scale(1); }
}

.gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
}

.thumb-btn {
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  background: none;
  cursor: pointer;
  opacity: 0.6;
  padding: 0;
  transition: opacity var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}

.thumb-btn:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.thumb-btn.active {
  border-color: var(--color-gold);
  opacity: 1;
}

.thumb-img {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
}

.qty-counter {
  display: flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
}

.qty-btn {
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-ink);
  border-radius: 9999px;
  transition: opacity var(--dur-fast), background-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

.qty-btn:hover:not(:disabled),
.cart-qty-btn:hover:not(:disabled) {
  background-color: var(--color-sand);
}

.qty-btn:active:not(:disabled),
.cart-qty-btn:active:not(:disabled) {
  transform: scale(0.9);
}

.qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.qty-num {
  width: 2rem;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Carrito de Compras (carrito.php)
   ========================================================================== */
.cart-list {
  list-style: none;
  margin-top: 1.5rem;
  border-top: 1px solid rgba(184, 149, 74, 0.15);
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(184, 149, 74, 0.15);
}

.cart-item-thumb {
  width: 6rem;
  height: 6rem;
  border-radius: 0.75rem;
  object-fit: cover;
}

.cart-item-body {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.cart-item-header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.cart-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-variant {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.cart-item-remove {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: none;
  background: none;
  color: var(--color-muted);
  cursor: pointer;
  margin-top: -0.25rem;
  margin-right: -0.5rem;
  transition: background-color 0.15s, color 0.15s;
}

.cart-item-remove:hover {
  background-color: var(--color-sand);
  color: var(--color-ink);
}

.cart-item-footer {
  margin-top: auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-top: 0.5rem;
}

.cart-qty-counter {
  display: flex;
  align-items: center;
  border-radius: 9999px;
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
}

.cart-qty-btn {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--color-ink);
  border-radius: 9999px;
  transition: background-color var(--dur-fast), transform var(--dur-fast) var(--ease-out);
}

.cart-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.cart-qty-num {
  width: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Componentes Reutilizables (.btn, .card, .input, .label)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 9999px;
  padding: 0.75rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  letter-spacing: 0.01em;
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Destello diagonal que cruza los botones principales al pasar el cursor */
.btn-dark::after,
.btn-wa::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.16) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform 0.9s var(--ease-out);
}

.btn-dark:hover:not(:disabled)::after,
.btn-wa:hover:not(:disabled)::after {
  transform: translateX(120%);
}

.btn-dark {
  background-color: var(--color-ink);
  color: var(--color-cream);
}

.btn-dark:hover:not(:disabled) {
  background-color: #000000;
  box-shadow: 0 14px 28px -16px rgba(28, 26, 25, 0.6);
}

.btn-gold {
  background-color: var(--color-gold);
  color: var(--color-white);
}

.btn-gold:hover:not(:disabled) {
  background-color: var(--color-gold-dark);
}

.btn-wa {
  background-color: var(--color-wa);
  color: var(--color-white);
}

.btn-wa:hover:not(:disabled) {
  background-color: var(--color-wa-dark);
  box-shadow: 0 14px 28px -16px rgba(23, 130, 68, 0.7);
}

.btn-outline {
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
  color: var(--color-ink);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(28, 26, 25, 0.4);
}

.btn-danger {
  border: 1px solid #fecaca;
  background-color: var(--color-white);
  color: #b91c1c;
}

.btn-danger:hover:not(:disabled) {
  background-color: #fef2f2;
}

.card {
  border-radius: 1.25rem;
  border: 1px solid rgba(184, 149, 74, 0.16);
  background-color: var(--color-white);
  box-shadow: var(--shadow-card);
}

.input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(28, 26, 25, 0.15);
  background-color: var(--color-white);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(184, 149, 74, 0.25);
}

.label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(28, 26, 25, 0.8);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  margin-top: 4rem;
  border-top: 1px solid rgba(184, 149, 74, 0.25);
  background-color: rgba(236, 227, 213, 0.6);
}

.footer-inner {
  display: grid;
  gap: 2rem;
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-brand-title {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.footer-brand-subtitle {
  font-size: 0.875rem;
  color: var(--color-muted);
}

.footer-copy {
  padding-bottom: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: rgba(111, 102, 96, 0.7);
}

/* ==========================================================================
   Icon Utilities
   ========================================================================== */
.size-4  { width: 1rem; height: 1rem; }
.size-5  { width: 1.25rem; height: 1.25rem; }
.size-6  { width: 1.5rem; height: 1.5rem; }
.size-8  { width: 2rem; height: 2rem; }
.size-9  { width: 2.25rem; height: 2.25rem; }
.size-10 { width: 2.5rem; height: 2.5rem; }
.size-11 { width: 2.75rem; height: 2.75rem; }
.size-12 { width: 3rem; height: 3rem; }
.size-14 { width: 3.5rem; height: 3.5rem; }
.size-16 { width: 4rem; height: 4rem; }
.size-24 { width: 6rem; height: 6rem; }

/* ==========================================================================
/* ==========================================================================
   Loader Boutique de Lujo & Spinners
   ========================================================================== */
.spinner-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 5rem 1rem;
  width: 100%;
}

.boutique-loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.boutique-loader-rings {
  position: relative;
  width: 5rem;
  height: 5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.boutique-loader-svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 12px rgba(184, 149, 74, 0.25));
}

.loader-ring-outer {
  transform-origin: 50% 50%;
  animation: boutique-spin 3s linear infinite;
}

@keyframes boutique-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.loader-ring-inner {
  transform-origin: 50% 50%;
  animation: boutique-pulse 2s ease-in-out infinite;
}

.loader-monogram {
  transform-origin: 50% 50%;
  animation: monogram-breathe 2s ease-in-out infinite;
}

@keyframes boutique-pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.95;
  }
  50% {
    transform: scale(1.03);
    opacity: 1;
  }
}

@keyframes monogram-breathe {
  0%, 100% {
    opacity: 0.85;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.05);
  }
}

.boutique-loader-brand {
  margin-top: 1rem;
  font-family: var(--font-serif);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--color-ink);
}

.boutique-loader-text {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--color-muted);
  letter-spacing: 0.04em;
  animation: text-pulse 1.8s ease-in-out infinite;
}

@keyframes text-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.spinner {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  border: 2.5px solid rgba(184, 149, 74, 0.25);
  border-top-color: var(--color-gold);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  scrollbar-width: none;
}

/* ==========================================================================
   Movimiento: revelado al hacer scroll (la clase .reveal la pone app.js
   solo si el navegador soporta IntersectionObserver)
   ========================================================================== */
@keyframes shimmer {
  from { background-position: 150% 0; }
  to { background-position: -50% 0; }
}

.reveal {
  opacity: 0;
}

/* "backwards" en vez de "both": al terminar libera transform para el hover */
.reveal.is-visible {
  opacity: 1;
  animation: reveal-up 0.9s var(--ease-out) var(--reveal-delay, 0ms) backwards;
}

@keyframes reveal-up {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Esqueletos de carga con la misma forma que las tarjetas
   ========================================================================== */
.skeleton-card {
  border-radius: 1.25rem;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(184, 149, 74, 0.1);
  padding: 0.5rem 0.5rem 1rem;
}

.skeleton-block {
  border-radius: 0.75rem;
  background-color: var(--color-sand);
  background-image: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.6) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}

.skeleton-thumb {
  aspect-ratio: 4 / 5;
  border-radius: 0.95rem;
}

.skeleton-line {
  height: 0.7rem;
  margin: 0.9rem 0.5rem 0;
  width: 40%;
}

.skeleton-line.wide {
  width: 75%;
  height: 0.85rem;
  margin-top: 0.6rem;
}

/* ==========================================================================
   Encabezados de sección y productos sugeridos (producto.php)
   ========================================================================== */
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

.section-kicker::before {
  content: "";
  width: 1.75rem;
  height: 1px;
  background-color: var(--color-gold);
}

.section-title {
  margin-top: 0.5rem;
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.related-section {
  margin-top: 4.5rem;
  padding-top: 3rem;
  padding-bottom: 1rem;
  border-top: 1px solid rgba(184, 149, 74, 0.2);
}

.related-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
}

.related-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gold-dark);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease-out);
}

.related-link:hover {
  background-size: 100% 1px;
}

.related-grid {
  padding-top: 2rem;
}

/* ==========================================================================
   Detalle de producto: entrada escalonada solo en el primer pintado
   ========================================================================== */
.pd-enter .gallery-main {
  animation: hero-reveal 1.1s var(--ease-out) both;
}

.pd-enter .pd-info > * {
  animation: fade-up 0.8s var(--ease-out) backwards;
}

.pd-enter .pd-info > *:nth-child(1) { animation-delay: 120ms; }
.pd-enter .pd-info > *:nth-child(2) { animation-delay: 190ms; }
.pd-enter .pd-info > *:nth-child(3) { animation-delay: 260ms; }
.pd-enter .pd-info > *:nth-child(4) { animation-delay: 330ms; }
.pd-enter .pd-info > *:nth-child(5) { animation-delay: 400ms; }
.pd-enter .pd-info > *:nth-child(n+6) { animation-delay: 470ms; }

.pd-price {
  font-variant-numeric: tabular-nums;
}

/* Aviso "Agregado al carrito" */
.added-alert.is-shown {
  animation: alert-in 0.55s var(--ease-out) backwards;
}

@keyframes alert-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

/* ==========================================================================
   Carrito: renglones con entrada escalonada en el primer pintado
   ========================================================================== */
.cart-enter .cart-item {
  animation: fade-up 0.7s var(--ease-out) backwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}

.cart-enter .card {
  animation: fade-up 0.8s var(--ease-out) 0.15s backwards;
}

/* ==========================================================================
   Horario y ubicación (index.php "Visítanos" y pie de página)
   ========================================================================== */
.status-pill {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-top: 1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  background-color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(28, 26, 25, 0.08);
  color: var(--color-muted);
}

.status-pill strong {
  font-weight: 600;
  color: var(--color-ink);
}

.status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 9999px;
  background-color: var(--color-muted);
}

.status-pill.is-open .status-dot {
  background-color: var(--color-wa);
  box-shadow: 0 0 0 0 rgba(31, 158, 85, 0.5);
  animation: open-ping 2.4s var(--ease-out) infinite;
}

.status-pill.is-open strong {
  color: var(--color-wa-dark);
}

@keyframes open-ping {
  0% { box-shadow: 0 0 0 0 rgba(31, 158, 85, 0.45); }
  70%, 100% { box-shadow: 0 0 0 7px rgba(31, 158, 85, 0); }
}

.hours-list {
  list-style: none;
  margin-top: 1.25rem;
  max-width: 24rem;
  font-size: 0.9rem;
}

.hours-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(184, 149, 74, 0.25);
  font-variant-numeric: tabular-nums;
}

.hours-list li:last-child {
  border-bottom: 0;
}

/* El lugar de ese día va en su propio renglón, debajo del horario */
.hours-list li {
  flex-wrap: wrap;
}

.hours-place {
  flex-basis: 100%;
  margin-top: -0.15rem;
  font-size: 0.8em;
  font-weight: 400;
  color: var(--color-muted);
}

.hours-list li.is-closed span:last-child {
  color: var(--color-muted);
}

.hours-list li.is-today {
  font-weight: 600;
  color: var(--color-gold-dark);
}

.hours-list em {
  font-style: normal;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-left: 0.35rem;
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background-color: var(--color-gold-soft);
}

.hours-list-compact {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
}

.hours-list-compact li {
  padding: 0.3rem 0;
}

.visit-section {
  padding-top: 2rem;
}

.visit-card {
  display: grid;
  gap: 2rem;
  padding: 1.75rem;
  border-radius: 1.75rem;
  background-color: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(184, 149, 74, 0.18);
  box-shadow: var(--shadow-card);
}

@media (min-width: 768px) {
  .visit-card {
    grid-template-columns: 1fr 1.1fr;
    align-items: stretch;
    padding: 2.5rem;
  }
}

.visit-place-heading {
  margin-top: 1.25rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

.visit-place-heading + .visit-address {
  margin-top: 0.35rem;
}

.visit-address {
  margin-top: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-weight: 500;
  max-width: 28rem;
}

.visit-address svg {
  flex-shrink: 0;
  margin-top: 0.1rem;
  color: var(--color-gold-dark);
}

.visit-note {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-muted);
  max-width: 28rem;
}

.visit-cta {
  margin-top: 1.5rem;
}

.visit-map {
  position: relative;
  min-height: 18rem;
  overflow: hidden;
  border-radius: 1.25rem;
  background-color: var(--color-sand);
}

.visit-map iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  /* Mapa en tonos cálidos para que no rompa la paleta */
  filter: saturate(0.6) sepia(0.12);
  transition: filter 0.6s var(--ease-out);
}

.visit-map:hover iframe {
  filter: none;
}

.footer-store {
  display: grid;
  gap: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 640px) {
  .footer-store {
    grid-template-columns: repeat(2, minmax(0, 20rem));
    gap: 4rem;
  }
}

.footer-heading {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-gold-dark);
}

.footer-store .status-pill {
  margin-top: 0.75rem;
  /* En la columna angosta puede ocupar dos renglones */
  border-radius: 0.875rem;
}

.footer-address {
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

.footer-note {
  margin-top: 0.35rem;
  font-size: 0.8125rem;
  color: var(--color-muted);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-gold-dark);
  padding-bottom: 2px;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size 0.5s var(--ease-out);
}

.text-link:hover {
  background-size: 100% 1px;
}

/* ==========================================================================
   Movimiento reducido: se respeta la preferencia del sistema
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
  }
}
