/* =====================================================================
   DAX Parfums · estilos
   La estructura está en index.html y la lógica en app.js.
   Orden: 1 Variables · 2 Base · 3 Header y menú · 4 Botones · 5 Portada
          6 Secciones · 7 Tarjetas · 8 Contacto y políticas · 9 Checkout
          10 Toast y footer · 11 Animaciones · 12 Modo oscuro fijo
   Los temas de temporada están en archivos aparte (los elige season.js):
     tema-halloween.css · tema-patrias.css · tema-navidad.css
   ===================================================================== */

@property --a {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* ===== 1. VARIABLES ===== */
:root {
  --bg: #faf7f2;
  --ink: #17130e;
  --muted: #6f675c;
  --surface: #fff;
  --line: #e6dfd3;
  --accent: #9a7022;
  --accent2: #c99a43;
  --glass: #faf7f2d9;
  --accent-ink: #fff;
  --stock: #1f9d5a;
  --art-bg: #f1ebdf;
  --r: 22px;
  color-scheme: light;
}

[data-theme=dark] {
  --bg: #0c0b0a;
  --ink: #f3ede2;
  --muted: #a39a8b;
  --surface: #16130f;
  --line: #2a251d;
  --accent: #e0bb72;
  --accent2: #e0bb72;
  --glass: #0c0b0ad9;
  --accent-ink: #17130e;
  --stock: #22b86a;
  --art-bg: #1e1a14;
  color-scheme: dark;
}

/* ===== 2. BASE ===== */
* {
  box-sizing: border-box;
  margin: 0;
}

body {
  font: 400 16px/1.55 'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  letter-spacing: -.025em;
  line-height: 1.08;
  text-wrap: balance;
}

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 20px;
}

.nojs {
  max-width: 560px;
  margin: 60px auto;
  padding: 0 20px;
  text-align: center;
}

/* ===== 3. HEADER Y MENÚ ===== */
.promo {
  background: var(--bg);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}

header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "logo acts" "nav nav";
  align-items: center;
  gap: 4px 12px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}

header .logo { grid-area: logo; }
header .acts { grid-area: acts; }

.logo img {
  display: block;
  height: 46px;
  width: auto;
}
.logo .logo-dark { display: none; }
[data-theme=dark] .logo .logo-light { display: none; }
[data-theme=dark] .logo .logo-dark { display: block; }

.acts {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.ib {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  min-width: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  font-size: 14px;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.ib:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

#cnt {
  background: var(--accent);
  color: var(--bg);
  border-radius: 99px;
  min-width: 22px;
  padding: 0 6px;
  text-align: center;
  font-size: 13px;
}

@keyframes bump { 40% { scale: 1.35; } }
.bump { animation: bump .4s ease; }

/* Barra de progreso al hacer scroll */
@supports (animation-timeline: scroll()) {
  header::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transform-origin: left;
    scale: 0 1;
    animation: prog linear both;
    animation-timeline: scroll(root);
  }
  @keyframes prog { to { scale: 1 1; } }
}

/* Menú superior (Inicio · Perfumes · Contacto) */
html { scroll-padding-top: 116px; }

.topnav {
  grid-area: nav;
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0 -6px;
}

.topnav > a,
.ddb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 0;
  border-radius: 99px;
  background: none;
  color: var(--ink);
  font: 500 16px 'DM Sans', sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, color .2s;
}

.topnav > a:hover,
.ddb:hover,
.dd[data-open] .ddb,
.topnav a[aria-current=page] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.dd { position: static; }

.ddb i {
  display: block;
  width: 7px;
  height: 7px;
  border: solid currentColor;
  border-width: 0 2px 2px 0;
  rotate: 45deg;
  translate: 0 -2px;
  transition: rotate .25s, translate .25s;
}
.dd[data-open] .ddb i {
  rotate: 225deg;
  translate: 0 2px;
}

.ddp {
  position: absolute;
  top: 100%;
  left: 12px;
  right: 12px;
  max-height: calc(100dvh - 150px);
  margin-top: 6px;
  padding: 8px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  translate: 0 -8px;
  transition: opacity .2s, translate .25s, visibility .2s;
}
.dd[data-open] .ddp {
  opacity: 1;
  visibility: visible;
  translate: 0 0;
}

.ddp a {
  display: block;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 500;
}
.ddp a:hover,
.ddp a[aria-current=page] {
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.ddh {
  margin: 8px 14px 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.ddm { display: grid; grid-template-columns: 1fr 1fr; }
.ddm a { padding: 6px 14px; font-size: 14px; }

@media (min-width: 900px) {
  header {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "logo nav acts";
    gap: 28px;
    padding-inline: max(24px, calc(50% - 600px));
  }
  .topnav { margin: 0; }
  .topnav > a,
  .ddb { min-height: 40px; padding: 0 16px; }
  .dd { position: relative; }
  .ddp {
    left: 0;
    right: auto;
    min-width: 290px;
    margin-top: 12px;
  }
  html { scroll-padding-top: 84px; }
}

/* ===== 4. BOTONES ===== */
.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 0 26px;
  border: 0;
  border-radius: 99px;
  background: linear-gradient(135deg, var(--accent2), color-mix(in srgb, var(--accent2) 60%, #fff));
  color: #17130e;
  font-weight: 700;
  text-decoration: none;
  transition: transform .2s, box-shadow .3s;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent2) 40%, transparent);
}
.btn.outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}
.btn:disabled {
  opacity: .6;
  cursor: wait;
  transform: none;
}

/* ===== 5. PORTADA ===== */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  text-align: center;
  padding: clamp(70px, 13vw, 150px) 20px clamp(60px, 10vw, 110px);
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse at 50% 120%, color-mix(in srgb, var(--accent2) 28%, transparent), transparent 60%),
    conic-gradient(from var(--a) at 50% 40%, color-mix(in srgb, var(--accent2) 22%, transparent), transparent 30%, #7a4be633 55%, transparent 80%, color-mix(in srgb, var(--accent2) 22%, transparent));
  animation: spin 24s linear infinite;
}
@keyframes spin { to { --a: 360deg; } }

.hero h1 {
  font-size: clamp(38px, 8vw, 92px);
  max-width: 15ch;
  margin: 18px auto;
}

.lead {
  max-width: 56ch;
  margin: 0 auto 30px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 20px);
}

.cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--accent);
  font-size: 14px;
  background: var(--glass);
}

.mq {
  overflow: hidden;
  border-block: 1px solid var(--line);
  padding: 18px 0;
}
.mq div {
  display: flex;
  gap: 56px;
  width: max-content;
  animation: mq 34s linear infinite;
  font: 700 22px 'Bricolage Grotesque', sans-serif;
  color: var(--muted);
}
@keyframes mq { to { transform: translateX(-50%); } }

/* ===== 6. SECCIONES ===== */
.h2 {
  font-size: clamp(28px, 4.5vw, 46px);
  margin-bottom: 22px;
}

.sech {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}
.sech a { color: var(--accent); }

.cats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.cats a {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 170px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent2) 16%, var(--surface)), var(--surface));
  transition: transform .3s, border-color .3s;
}
.cats a:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
}
.cats b { font: 700 26px 'Bricolage Grotesque', sans-serif; }
.cats span { color: var(--muted); }

@media (max-width: 640px) {
  .cats {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin-inline: -20px;
    padding: 0 20px 6px;
    scrollbar-width: none;
  }
  .cats::-webkit-scrollbar { display: none; }
  .cats a {
    flex: 0 0 auto;
    min-height: 0;
    padding: 12px 18px;
    scroll-snap-align: start;
    justify-content: center;
    border-radius: 16px;
  }
  .cats b { font-size: 17px; white-space: nowrap; }
  .cats span { font-size: 12px; white-space: nowrap; }
}

.scr {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
  scrollbar-width: thin;
}
.scr .card {
  flex: 0 0 min(270px, 74vw);
  scroll-snap-align: start;
}

.ph {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) 20px 0;
}
.ph h1 { font-size: clamp(34px, 6vw, 64px); }
.ph p {
  max-width: 60ch;
  margin-top: 10px;
  color: var(--muted);
}

.crumb {
  margin-bottom: 14px;
  font-size: 14px;
  color: var(--muted);
}
.crumb a {
  color: var(--accent);
  text-decoration: none;
}

.tools {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.tools input,
.tools select {
  flex: 1 1 220px;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 22px;
}
.chips button,
.pg button {
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
}
.chips button[aria-pressed=true],
.pg button[aria-pressed=true] {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chips small {
  margin-left: auto;
  color: var(--muted);
}

.pg {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 34px;
}

.feat {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 30px;
  align-items: center;
  padding: clamp(20px, 4vw, 44px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent2) 14%, var(--surface)), var(--surface));
}
.feat .art { border-radius: 24px; }
.feat .brand { margin-top: 14px; }
.feat h2 {
  font-size: clamp(30px, 5vw, 52px);
  margin: 6px 0;
}

.box {
  text-align: center;
  padding: clamp(34px, 6vw, 70px) 20px;
  border-radius: 32px;
  background: linear-gradient(135deg, var(--accent2), color-mix(in srgb, var(--accent2) 55%, #fff));
  color: #17130e;
}
.box p { margin: 10px 0 22px; }
.box .btn {
  background: #17130e;
  color: #fff;
}

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px;
}

/* ===== 7. TARJETAS DE PERFUME ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 18px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  transition: transform .35s, box-shadow .35s, border-color .35s;
}
.card:hover {
  transform: translateY(-6px);
  border-color: var(--accent);
}

/* position y overflow: mantienen el destello y la neblina dentro de la foto */
.art {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.art img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  animation: bob 7s ease-in-out infinite;
  transition: transform .6s cubic-bezier(.2, .9, .3, 1.4);
}
.card:nth-child(3n+2) .art img { animation-delay: -2.3s; }
.card:nth-child(3n) .art img { animation-delay: -4.6s; }
.card:hover .art img { transform: scale(1.12) rotate(-4deg); }
@keyframes bob { 50% { translate: 0 -7px; } }

.info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  padding: 16px 18px 18px;
}
.brand {
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}
.info h3 { font-size: 21px; }
.sub {
  color: var(--muted);
  font-size: 14px;
}

.pr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 10px;
}
.pr b { font: 700 24px 'Bricolage Grotesque', sans-serif; }

.tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 99px;
  font-weight: 700;
}
.tag.in {
  color: var(--stock);
  background: color-mix(in srgb, var(--stock) 14%, transparent);
}
.tag.in::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 50%;
  background: currentColor;
  animation: ping 1.8s ease-out infinite;
}
.tag.out {
  background: #8884;
  color: var(--muted);
}
@keyframes ping {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
  100% { box-shadow: 0 0 0 8px transparent; }
}

.qty-control,
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 99px;
}
.qty-control { align-self: flex-start; }
.qty-control button,
.qty button {
  width: 38px;
  height: 38px;
  border: 0;
  background: none;
  font-size: 18px;
}
.qty-control span,
.qty span {
  min-width: 24px;
  text-align: center;
}

.add,
.ask {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 46px;
  margin-top: 8px;
  border: 0;
  border-radius: 99px;
  font-weight: 700;
  text-decoration: none;
}
.add {
  position: relative;
  overflow: hidden;
  background: var(--accent);
  color: var(--accent-ink);
  transition: scale .15s, box-shadow .3s;
}
.add::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%);
  translate: -100% 0;
}
.add:hover::after {
  translate: 100% 0;
  transition: translate .7s;
}
.add:active { scale: .94; }

.ask {
  border: 1px solid var(--line);
  transition: .2s;
}
.ask:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.incart {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--stock);
  text-align: center;
}

/* ===== 8. CONTACTO Y POLÍTICAS ===== */
.info2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 26px 0;
}
.info2 > div {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
}
.info2 small { color: var(--muted); }
.info2 b {
  display: block;
  font: 700 22px 'Bricolage Grotesque', sans-serif;
}

.ct {
  display: flex;
  flex-direction: column;
  gap: 6px;
  scroll-margin-top: 100px;
}
.ct .btn,
.ct .cta-row { margin-top: 12px; }
.ct .cta-row { justify-content: flex-start; }
.ct.hl { border-color: var(--accent); }

.ptabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 22px 0;
}
.ptabs a {
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 99px;
  text-decoration: none;
}
.ptabs a[aria-current=page] {
  background: var(--ink);
  color: var(--bg);
}

.pbody { max-width: 760px; }
.pbody .res {
  margin-bottom: 18px;
  font: 600 22px 'Bricolage Grotesque', sans-serif;
}
.pbody .upd { margin-top: 22px; }

details.pd {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
details.pd summary {
  font-weight: 700;
  cursor: pointer;
}
details.pd p {
  margin-top: 8px;
  color: var(--muted);
}

/* ===== 9. CHECKOUT Y PAGO ===== */
.co-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  align-items: start;
  margin-bottom: 60px;
}

.co-card {
  padding: 25px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.co-card h2 {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line);
  font-size: 24px;
}
.co-card h3 {
  margin-bottom: 15px;
  font-size: 1.2em;
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.line small {
  display: block;
  color: var(--muted);
}
.line-name {
  display: block;
  font-size: 1.1em;
}

.big {
  display: flex;
  justify-content: space-between;
  margin: 18px 0;
  font: 700 24px 'Bricolage Grotesque', sans-serif;
}
.co-card .big { margin-bottom: 0; }

.co-fs {
  margin: 0 0 25px;
  padding: 0;
  border: 0;
}
.co-fs legend {
  margin-bottom: 15px;
  padding: 0;
  font: 700 1.2em 'Bricolage Grotesque', sans-serif;
}
.co-opts {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.opt {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 8px;
  background: var(--art-bg);
  cursor: pointer;
}
.opt input { accent-color: var(--accent); }

.co-fields {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 25px;
}
.co-input {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--art-bg);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px evita el zoom automático en iPhone */
}

.terms {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
}
.terms input {
  margin-top: 4px;
  scale: 1.2;
  accent-color: var(--accent);
}
.terms a { color: var(--ink); }

.err {
  min-height: 1.4em;
  margin-bottom: 15px;
  color: #e5484d;
  font-size: 14px;
  font-weight: 700;
}

.co-btn {
  width: 100%;
  min-height: 54px;
  font-size: 1.1em;
}

.co-empty {
  text-align: center;
  padding: 40px 0;
}
.co-empty .empty {
  margin-bottom: 20px;
  font-size: 1.1em;
}

.ok-wrap { text-align: center; }
.ok-card {
  max-width: 600px;
  margin: 0 auto;
  padding: 35px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
}
.ok-title {
  margin-bottom: 15px;
  font-size: 1.2em;
  font-weight: 700;
}
.ok-text {
  margin-bottom: 30px;
  color: var(--muted);
  line-height: 1.6;
}
.ok-card .btn {
  padding: 0 30px;
  font-size: 1.1em;
}

/* ===== 10. TOAST Y FOOTER ===== */
#toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  translate: -50% 0;
  z-index: 30;
  background: var(--ink);
  color: var(--bg);
  padding: 12px 22px;
  border-radius: 99px;
  opacity: 0;
  pointer-events: none;
  transition: .3s;
}
#toast.on { opacity: 1; }

footer {
  padding: 34px 20px calc(40px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}
footer nav {
  display: flex;
  gap: 8px 22px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
footer a { text-decoration: none; }
footer a:hover { color: var(--accent); }

/* ===== 11. ANIMACIONES ===== */

/* Transición entre subpáginas (View Transitions) */
::view-transition-old(root) { animation: .25s ease both fade-out; }
::view-transition-new(root) { animation: .4s ease both slide-in; }
@keyframes fade-out { to { opacity: 0; transform: translateY(-8px); } }
@keyframes slide-in { from { opacity: 0; transform: translateY(18px); } }

/* Las tarjetas aparecen al entrar en pantalla */
@supports (animation-timeline: view()) {
  .grid .card {
    animation: rise linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 35%;
  }
  @keyframes rise {
    from { opacity: 0; translate: 0 40px; scale: .96; }
  }
}

/* Borde de luz giratorio (solo al pasar el mouse, para no gastar batería) */
.card::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 2px;
  border-radius: inherit;
  background: conic-gradient(from var(--a), var(--accent), transparent 25%, var(--accent2), transparent 60%, var(--accent));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.card:hover::before {
  opacity: 1;
  animation: spin 3s linear infinite;
}

/* Destello que cruza la foto */
.art::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .28) 50%, transparent 62%);
  translate: -130% 0;
  transition: translate .9s ease;
  pointer-events: none;
}
.card:hover .art::before { translate: 130% 0; }

/* Neblina de perfume */
.art::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 28% 72%, color-mix(in srgb, var(--ink) 9%, transparent), transparent 38%),
    radial-gradient(circle at 74% 28%, color-mix(in srgb, var(--ink) 7%, transparent), transparent 42%);
  transition: opacity .5s;
}
.card:hover .art::after {
  opacity: 1;
  animation: mist 3.5s ease-in-out infinite alternate;
}
@keyframes mist { to { scale: 1.15; rotate: 6deg; } }

/* Entrada escalonada del carrusel (sibling-index) */
@supports (width: calc(sibling-index() * 1px)) {
  .scr .card {
    transition:
      opacity .7s ease calc(sibling-index() * 80ms),
      translate .7s cubic-bezier(.2, .9, .3, 1) calc(sibling-index() * 80ms),
      transform .3s,
      box-shadow .3s;
  }
  @starting-style {
    .scr .card {
      opacity: 0;
      translate: 70px 0;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ===== Teléfono: perfumes en 2 columnas (tarjetas compactas) ===== */
@media (max-width: 640px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .grid .card { border-radius: 16px; }
  .grid .art img { width: 86%; height: 86%; }
  .grid .info { gap: 3px; padding: 10px 10px 12px; }
  .grid .brand { font-size: 11px; }
  .grid .info h3 { font-size: 15px; line-height: 1.15; }
  .grid .sub { font-size: 12px; line-height: 1.3; }
  .grid .notes { font-size: 11px; }
  .grid .pr { flex-wrap: wrap; gap: 4px 6px; padding-top: 8px; }
  .grid .pr b { font-size: 18px; }
  .grid .tag { padding: 3px 8px; font-size: 11px; }
  .grid .qty-control button { width: 32px; height: 32px; font-size: 16px; }
  .grid .add,
  .grid .ask {
    min-height: 40px;
    margin-top: 6px;
    padding: 0 6px;
    font-size: 13px;
    line-height: 1.15;
    text-align: center;
  }
  .grid .incart { font-size: 12px; }
}

/* ===== 12. MODO OSCURO FIJO =====
   La tienda siempre se ve en modo oscuro (theme-init.js fuerza data-theme=dark).
   Se oculta el botón de cambiar tema y se usa siempre el logo para fondo oscuro. */
#themeToggle { display: none; }
.logo .logo-light { display: none; }
.logo .logo-dark { display: block; }

/* ===== Notas de olor (discretas) y botón de Yappy ===== */
.notes {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  letter-spacing: .02em;
  opacity: .7;
}
.yp-note { margin-bottom: 18px; }
btn-yappy { display: block; }

/* ===== Selector de método de pago ===== */
.pay-opts { display: grid; gap: 10px; }
.pay-opt {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: var(--art-bg);
  cursor: pointer;
  transition: border-color .2s, background .2s;
}

/* ===== Ventana de Yappy (aprobar pago): centrada, con fondo atenuado ===== */
dialog#dialog[open] {
  position: fixed !important;
  inset: 0 !important;
  margin: auto !important;          /* anula el "* { margin: 0 }" */
  z-index: 1000 !important;
  width: min(440px, calc(100vw - 32px));
  height: fit-content;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 0;
  border: 0;
  border-radius: 20px;
  color-scheme: light;              /* que no herede el modo oscuro de la tienda */
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .65), 0 24px 60px rgba(0, 0, 0, .5);
}

.pay-opt input { accent-color: var(--accent); scale: 1.25; }
.pay-opt b { display: block; font-size: 16px; }
.pay-opt small { display: block; color: var(--muted); font-size: 13px; }
.pay-opt:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--art-bg));
}


/* ===== Páginas de perfume, marca y categoría (generadas por functions/) ===== */
.card h3 a { text-decoration: none; }
.card h3 a:hover { color: var(--accent); }
.seo-count { margin-bottom: 18px; }
.seo-text { max-width: 760px; }
.seo-text p { color: var(--muted); }
.seo-text p + p { margin-top: 12px; }
.feat .brand a { text-decoration: none; }
.feat .notes { margin-top: 4px; font-size: 14px; }
.feat .qty-control { margin-top: 14px; }
.feat .ask { margin-top: 8px; }


.co-btn[hidden], btn-yappy[hidden] { display: none; }