/*
  TEMA: Algodón de Azúcar
  Castock · capa de personalización de catálogo
  ------------------------------------------------------------------
  Esta hoja NO modifica ninguna regla de catalog-v1.css ni del resto
  de los módulos. Todo vive adentro de html[data-theme="algodon-de-azucar"],
  así que si ese atributo no está presente en <html>, esta hoja no
  tiene ningún efecto: el catálogo se ve exactamente como siempre.

  Cómo se activa:
    <html data-theme="algodon-de-azucar">
  o en runtime:
    document.documentElement.setAttribute('data-theme','algodon-de-azucar')

  Se suma a index.html DESPUÉS de los demás <link> de catálogo:
    <link rel="stylesheet" href="/catalogo/catalog-theme-algodon-de-azucar-v1.css?v=1" />
*/

/* ---------- 1. Paleta y tipografía (mismas variables que ya usa el catálogo) ---------- */
html[data-theme="algodon-de-azucar"]{
  --primary:#D6337D;         /* frutilla — botones, precios, foco */
  --accent:#7C5CE0;          /* lavanda — ofertas, insignias */
  --surface:#FFF5F8;         /* fondo general, crema rosado */
  --on-primary:#fff;
  --ink:#3A1F3D;              /* texto principal, ciruela oscuro */
  --muted:#8C7690;
  --card:#FFFFFF;
  --line:rgba(139,45,110,.14);
  --shadow:0 18px 50px rgba(214,51,125,.18);

  /* tokens propios del tema, sólo para los adornos de esta hoja */
  --heart:#FF7FB4;
  --heart-soft:#FFC2DE;
  --mint:#4FD8AE;
  --coral:#FF8482;

  font-family:'Quicksand',ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;
}

html[data-theme="algodon-de-azucar"] .hero-copy h1,
html[data-theme="algodon-de-azucar"] .section-heading h2,
html[data-theme="algodon-de-azucar"] .product-detail-copy h2,
html[data-theme="algodon-de-azucar"] .cart-sheet h2,
html[data-theme="algodon-de-azucar"] .catalog-empty h3,
html[data-theme="algodon-de-azucar"] .cart-empty h3{
  font-family:'Fredoka',ui-rounded,sans-serif;
  font-weight:600;
  letter-spacing:-.02em;
}

/* ---------- 2. Formas más mimosas: esquinas, sombras, halo del avatar ---------- */
html[data-theme="algodon-de-azucar"] .product-card{border-radius:22px}
html[data-theme="algodon-de-azucar"] .skeleton-card,
html[data-theme="algodon-de-azucar"] .skeleton-card i{border-radius:22px}
html[data-theme="algodon-de-azucar"] .checkout-button,
html[data-theme="algodon-de-azucar"] .whatsapp-link,
html[data-theme="algodon-de-azucar"] .detail-add{border-radius:18px}
html[data-theme="algodon-de-azucar"] .sheet-card{border-radius:0}
html[data-theme="algodon-de-azucar"] .product-media{background:linear-gradient(160deg,#FFE3F0,#FDEFFF)}
html[data-theme="algodon-de-azucar"] .product-placeholder{
  background:radial-gradient(circle at 70% 20%,color-mix(in srgb,var(--heart) 30%,transparent),transparent 45%),
             linear-gradient(150deg,#FFE6F2,#F2E9FF);
  color:color-mix(in srgb,var(--primary) 82%,black);
}
html[data-theme="algodon-de-azucar"] .store-hero:before{
  background:radial-gradient(circle,color-mix(in srgb,var(--heart) 22%,transparent),transparent 70%);
  filter:blur(6px);
}
html[data-theme="algodon-de-azucar"] .store-hero:after{
  border-color:color-mix(in srgb,var(--accent) 12%,transparent);
}
html[data-theme="algodon-de-azucar"] .profile-avatar{
  border-color:color-mix(in srgb,var(--heart) 30%,white);
}

/* ---------- 2.5 Entrada del hero: impacto liviano, todo CSS, nada de imágenes ---------- */
/* Puntitos blancos hechos con radial-gradient (nada de imágenes ni SVG):
   3 capas de distinto tamaño/opacidad, cada una con su propio recorrido,
   todo dentro de UN solo @keyframes (así se pueden mover independientes
   sin pisarse entre sí). Van con ease-in-out y vuelven exactas al punto
   de partida en 100%, así el loop no se nota — no hay "salto" ni corte,
   se siente como flotar, no como una cinta corriendo. */
html[data-theme="algodon-de-azucar"] .store-hero{
  background-image:
    radial-gradient(circle,rgba(255,255,255,.85) 0 1.6px,transparent 1.7px),
    radial-gradient(circle,rgba(255,255,255,.55) 0 1.3px,transparent 1.4px),
    radial-gradient(circle,rgba(255,255,255,.35) 0 1.1px,transparent 1.2px);
  background-repeat:repeat,repeat,repeat;
  background-size:44px 44px,74px 74px,112px 112px;
  background-position:0 0,0 0,0 0;
  animation:ambientDrift 30s ease-in-out infinite;
}
@keyframes ambientDrift{
  0%{background-position:0% 0%,0% 0%,0% 0%}
  22%{background-position:5% 9%,-4% 6%,3% -5%}
  46%{background-position:1% 17%,6% -3%,-4% 8%}
  71%{background-position:-6% 10%,-7% 8%,5% 4%}
  100%{background-position:0% 0%,0% 0%,0% 0%}
}

/* Entrada escalonada: avatar, título, descripción y CTA aparecen en cadena
   al cargar (sin JS, sin scroll listeners: son @keyframes con delay). */
html[data-theme="algodon-de-azucar"] .profile-wrap{
  animation:heroPopIn .7s cubic-bezier(.34,1.56,.64,1) both,avatarFloat 4.2s ease-in-out 1s infinite;
}
html[data-theme="algodon-de-azucar"] .catalog-rating-trigger{animation:heroRise .55s ease .05s both}
html[data-theme="algodon-de-azucar"] .hero-copy h1{
  animation:heroRise .6s ease .15s both,titleShimmer 7s ease-in-out 1s infinite;
  background:linear-gradient(100deg,var(--primary),var(--accent) 45%,var(--heart) 65%,var(--primary));
  background-size:250% 100%;
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}
html[data-theme="algodon-de-azucar"] .hero-copy>p:last-child{animation:heroRise .6s ease .28s both}
html[data-theme="algodon-de-azucar"] .whatsapp-link{animation:heroRise .6s ease .4s both}

@keyframes heroPopIn{
  0%{opacity:0;transform:scale(.6) rotate(-10deg)}
  65%{opacity:1;transform:scale(1.06) rotate(3deg)}
  100%{opacity:1;transform:scale(1) rotate(0)}
}
@keyframes heroRise{from{opacity:0;transform:translateY(14px)}to{opacity:1;transform:translateY(0)}}
@keyframes avatarFloat{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes titleShimmer{0%,100%{background-position:0% 50%}50%{background-position:100% 50%}}

/* ---------- 3. Firma del tema: lluvia de corazones sobre productos en oferta ---------- */
/* Ahora caen por detrás del texto, dentro del bloque blanco (.product-info),
   no sobre la foto. isolation:isolate crea un contexto propio para que el
   z-index negativo sólo empuje los corazones detrás del texto de ESTE
   bloque, sin filtrarse por debajo de la tarjeta entera. */
html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info{
  position:relative;
  isolation:isolate;
  overflow:hidden;
}
html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::before,
html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::after{
  content:"";
  position:absolute;
  z-index:-1;
  inset:-20% -10% -80% -10%;
  pointer-events:none;
  background-repeat:repeat;
}
html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::before{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='30'%3E%3Cpath d='M13 22s-7.5-4.6-10-9.3C1 9 3.2 6 6.6 6c2 0 3.6 1.1 4.4 2.7C11.8 7.1 13.4 6 15.4 6c4 0 6.1 4.2 4.6 7.7C18.5 17.4 13 22 13 22z' fill='%23FF7FB4'/%3E%3C/svg%3E");
  background-size:26px 30px;
  opacity:.22;
  animation:heartFallSlow 5.2s linear infinite;
}
html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::after{
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='21'%3E%3Cpath d='M9 15s-5.2-3.2-7-6.5C.7 6.3 2.2 4 4.6 4c1.4 0 2.5.8 3.1 1.9C8.3 4.8 9.4 4 10.8 4c2.4 0 4.2 2.9 3.2 5.3C12.7 12.4 9 15 9 15z' fill='%23FF9EC6'/%3E%3C/svg%3E");
  background-size:18px 21px;
  background-position:10px 0;
  opacity:.16;
  animation:heartFallFast 3.6s linear infinite;
}
@keyframes heartFallSlow{from{background-position-y:-30px}to{background-position-y:0}}
@keyframes heartFallFast{from{background-position-y:-21px}to{background-position-y:0}}

/* insignia de oferta como "estampita" pastel, con corazón */
html[data-theme="algodon-de-azucar"] .offer-label{
  background:linear-gradient(145deg,var(--heart),var(--accent));
  border-radius:42% 58% 55% 45%/52% 45% 55% 48%;
  border-color:rgba(255,255,255,.75);
  transform:rotate(-6deg);
}
html[data-theme="algodon-de-azucar"] .offer-label b::before{content:"♥ "}
html[data-theme="algodon-de-azucar"] .product-card.has-offer:hover .offer-label{
  transform:rotate(-6deg) scale(1.06);
  transition:transform .25s cubic-bezier(.34,1.56,.64,1);
}
html[data-theme="algodon-de-azucar"] .offer-highlight,
html[data-theme="algodon-de-azucar"] .detail-offer-banner{
  border-radius:14px;
}
html[data-theme="algodon-de-azucar"] .detail-offer-banner{
  background:linear-gradient(120deg,color-mix(in srgb,var(--heart) 20%,var(--card)),color-mix(in srgb,var(--accent) 8%,var(--card)));
}

/* ---------- 4. Microinteracciones (contenidas, no todo se mueve a la vez) ---------- */
html[data-theme="algodon-de-azucar"] .add-button{
  transition:transform .28s cubic-bezier(.34,1.56,.64,1),box-shadow .2s;
}
html[data-theme="algodon-de-azucar"] .add-button:hover{transform:scale(1.1) rotate(6deg)}
html[data-theme="algodon-de-azucar"] .add-button:active{transform:scale(.82) rotate(-8deg)}

html[data-theme="algodon-de-azucar"] .product-card{transition:transform .22s cubic-bezier(.34,1.4,.64,1),box-shadow .22s}
html[data-theme="algodon-de-azucar"] .product-card:hover{transform:translateY(-5px) rotate(-.3deg)}

html[data-theme="algodon-de-azucar"] .stock-dot{background:var(--mint);box-shadow:0 2px 8px rgba(79,216,174,.4)}
html[data-theme="algodon-de-azucar"] .stock-dot.out{background:var(--coral);box-shadow:0 2px 8px rgba(255,132,130,.4)}
html[data-theme="algodon-de-azucar"] .stock-dot:not(.out){animation:dotPulse 2.2s ease-out infinite}
@keyframes dotPulse{
  0%{box-shadow:0 0 0 0 rgba(79,216,174,.55)}
  70%{box-shadow:0 0 0 9px rgba(79,216,174,0)}
  100%{box-shadow:0 0 0 0 rgba(79,216,174,0)}
}

html[data-theme="algodon-de-azucar"] .catalog-rating-trigger:hover span{
  display:inline-block;
  animation:sparkleSpin .5s ease;
}
@keyframes sparkleSpin{
  0%{transform:scale(1) rotate(0)}
  50%{transform:scale(1.35) rotate(18deg)}
  100%{transform:scale(1) rotate(0)}
}

html[data-theme="algodon-de-azucar"] .category-strip button.active,
html[data-theme="algodon-de-azucar"] .collection-filter-strip [aria-pressed="true"]{
  transform:rotate(-1.5deg);
}

/* ---------- 5. Foco visible y respeto por "reducir movimiento" ---------- */
html[data-theme="algodon-de-azucar"] :focus-visible{
  outline:3px solid color-mix(in srgb,var(--accent) 70%,white);
  outline-offset:2px;
}
@media(prefers-reduced-motion:reduce){
  html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::before,
  html[data-theme="algodon-de-azucar"] .product-card.has-offer .product-info::after,
  html[data-theme="algodon-de-azucar"] .stock-dot:not(.out),
  html[data-theme="algodon-de-azucar"] .store-hero,
  html[data-theme="algodon-de-azucar"] .profile-avatar,
  html[data-theme="algodon-de-azucar"] .hero-copy *,
  html[data-theme="algodon-de-azucar"] .whatsapp-link{
    animation:none!important;
  }
}

@media(max-width:700px){
  html[data-theme="algodon-de-azucar"] .product-card{border-radius:18px}
}

/* Professional polish: keep the cart action unmistakably readable. */
html[data-theme="algodon-de-azucar"] .checkout-button,
html[data-theme="algodon-de-azucar"] .checkout-button span {
  color: #fff;
}

html[data-theme="algodon-de-azucar"] .checkout-button b {
  color: var(--primary);
  background: #fff;
}
