/* =========================================================
   KAÏ Parfum — estilos base
   Colores, tipografías y bordes están en :root.
   Cambiá una variable aquí y se actualiza toda la página.
   ========================================================= */
:root {
  --navy: #13204b;
  --navy-2: #1c2c62;
  --orange: #ff6a0d;
  --orange-ink: #e2570a;
  --peach: #fde9de;
  --bg: #fbf8f6;
  --surface: #ffffff;
  --fg: #13204b;
  --muted: #5b6382;
  --line: #ece6e2;
  --chip: #f3eeea;
  --wa: #1fa855;

  --f-display: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-accent: "Bodoni Moda", "Didot", "Bodoni 72", Georgia, serif;
  --f-body: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 18px;
  color-scheme: light;
}

/* Modo oscuro (automático según el sistema) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1330; --surface: #141d42; --fg: #f2efff; --muted: #a6acc8; --line: #25305e; --chip: #1c2754;
    --peach: #2a2240; --navy: #091029; --navy-2: #111a3f; --orange-ink: #ff8a3d; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1330; --surface: #141d42; --fg: #f2efff; --muted: #a6acc8; --line: #25305e; --chip: #1c2754;
  --peach: #2a2240; --navy: #091029; --navy-2: #111a3f; --orange-ink: #ff8a3d; color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
h1, h2, h3 { text-wrap: balance; margin: 0; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- Franja de envíos ---------- */
.ship {
  background: var(--orange);
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}
.ship .wrap { padding-block: 9px; }

/* ---------- Barra superior ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--navy);
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.top .wrap { display: flex; align-items: center; gap: 10px; padding-block: 10px; }
.top .sp { flex: 1; }

/* Logo (imagen con fondo transparente: img/logo-kai.png) */
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 66px; width: auto; margin-block: -4px; }
.brand-lg .brand-logo { height: 120px; }

.wabtn, .bagbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  color: #fff;
}
.wabtn { background: var(--wa); }
.bagbtn { background: var(--orange); }
.bagbtn .n {
  background: #fff;
  color: var(--orange-ink);
  border-radius: 999px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 500px at 85% -10%, var(--navy-2), transparent 60%), var(--navy);
  color: #fff;
  overflow: hidden;
}
.hero .wrap {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 32px;
  align-items: center;
  padding-block: 48px 56px;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 800;
  font-size: clamp(34px, 5.4vw, 62px);
  line-height: 1.04;
  letter-spacing: -.02em;
  margin-top: 10px;
}
.hero h1 em {
  font-family: var(--f-accent);
  font-style: italic;
  font-weight: 500;
  color: var(--orange);
  letter-spacing: 0;
}
.hero .lead { color: #c9cee6; max-width: 46ch; margin: 18px 0 26px; font-size: 16px; }
.hero-eyebrow { color: #ffb27f !important; }

.cta { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
}
.btn.wa { background: var(--wa); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, .35); }
.btn.full { justify-content: center; width: 100%; }

.facts { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 30px; color: #c9cee6; font-size: 13px; }
.facts b { display: block; color: #fff; font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }

.stage { position: relative; display: grid; place-items: center; min-height: 320px; }
.stage .glow {
  position: absolute;
  width: 78%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 106, 13, .35), transparent 65%);
}
.stage .bottles {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  width: 100%;
  max-width: 440px;
}
.stage .bottles img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
/* desfase de la columna del medio */
.stage .bottles img:nth-child(3n+2) { margin-top: -22px; margin-bottom: 22px; }

/* ---------- Secciones ---------- */
section { padding-block: 44px 8px; }
.hero { padding-block: 0; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-ink); }
.sh { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.sh h2 { font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.01em; margin-top: 4px; }

/* ---------- Familias ---------- */
.fams { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.fam {
  text-align: left;
  border: 1.5px solid var(--line);
  background: var(--surface);
  border-radius: var(--r);
  padding: 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}
.fam:hover { border-color: var(--orange); }
.fam[aria-pressed="true"] { border-color: var(--orange); background: var(--peach); }
.fam .ic { font-size: 22px; line-height: 1; margin-bottom: 4px; }
.fam .t { font-weight: 700; font-size: 16px; }
.fam .d { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.fam .c { font-size: 12px; color: var(--orange-ink); font-weight: 600; margin-top: 4px; }

/* ---------- Herramientas de búsqueda ---------- */
.tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.search {
  flex: 1 1 260px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  min-width: 0;
  color: var(--muted);
}
.search input { border: 0; background: transparent; color: var(--fg); font: inherit; padding: 11px 0; width: 100%; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--orange); }
.tools { position: relative; z-index: 5; }

/* Menús desplegables: Marca y Ordenar */
.dd { position: relative; flex: 0 1 auto; }
.dd-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 16px;
  min-width: 190px;
  text-align: left;
}
.dd-btn:hover, .dd.op .dd-btn { border-color: var(--orange); }
.dd-k { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.dd-v { flex: 1; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dd-chev { flex: none; color: var(--orange-ink); }
.dd.on .dd-btn { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.dd.on .dd-k { color: inherit; opacity: .7; }
.dd.on .dd-chev { color: var(--orange); }
.dd-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 100%;
  width: max-content;
  max-width: min(300px, calc(100vw - 32px));
  max-height: 340px;
  overflow-y: auto;
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 6px;
  box-shadow: 0 22px 44px rgba(19, 32, 75, .18);
  display: none;
}
.dd.op .dd-menu { display: block; }
.dd-menu [role="option"] {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
}
.dd-menu [role="option"] span { flex: 1; }
.dd-menu [role="option"] small { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.dd-menu [role="option"]:hover, .dd-menu [role="option"]:focus-visible { background: var(--chip); outline: none; }
.dd-menu [role="option"][aria-selected="true"] { color: var(--orange-ink); font-weight: 700; }
.dd-menu [role="option"]::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--orange); opacity: 0; }
.dd-menu [role="option"][aria-selected="true"]::after { opacity: 1; }

.count { font-size: 13px; color: var(--muted); margin: 10px 0 16px; }

/* ---------- Tarjetas de producto ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.card {
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card .ph { position: relative; background: #fff; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: 14px; overflow: hidden; isolation: isolate; }
.card .ph img { position: relative; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.card .bd { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.card .br { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.card h3 { font-size: 16px; font-weight: 700; line-height: 1.25; }
/* El nombre es un botón (para abrir la ficha con teclado) pero se ve como texto */
.ver { all: unset; cursor: pointer; }
.ver:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 4px; }
.card .tg { font-size: 12px; font-weight: 600; color: var(--orange-ink); }
.card .ds { font-size: 13px; color: var(--muted); line-height: 1.45; }
.card .ft { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 8px; }
.price { font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.add {
  border: 0;
  background: var(--wa);
  color: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 600;
  font-size: 13px;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.add:hover { filter: brightness(1.08); }
.add.in { background: var(--fg); color: var(--bg); }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1.5px dashed var(--line); border-radius: var(--r); grid-column: 1 / -1; }

/* ---------- Barra de progreso del scroll ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 30; pointer-events: none; }
.progress span { display: block; height: 100%; background: var(--orange); transform-origin: 0 50%; transform: scaleX(0); }

/* ---------- Ficha del perfume ---------- */
.ficha { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; }
.ficha-fondo { position: absolute; inset: 0; background: rgba(9, 16, 41, .55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.ficha-caja {
  position: relative;
  width: min(860px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 40px 90px rgba(5, 9, 25, .45);
}
.ficha-caja:focus { outline: none; }
.ficha-caja > .x { position: absolute; top: 14px; right: 14px; z-index: 2; }
.ficha-foto { background: #fff; display: grid; place-items: center; padding: 28px; min-height: 0; }
.ficha-foto img { width: 100%; height: 100%; max-height: 420px; object-fit: contain; }
.ficha-info { padding: 40px 32px 32px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ficha-info .br { font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.ficha-info h2 { font-size: clamp(24px, 3.4vw, 34px); font-weight: 800; line-height: 1.1; padding-right: 32px; }
.ficha-k { margin-top: 8px; font-size: 12px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--orange-ink); }
.aroma { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.aroma li { padding: 7px 14px; border-radius: 999px; background: var(--peach); font-weight: 600; font-size: 14px; }
.ficha-desc { margin: 6px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.ficha-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; padding-top: 18px; }
.ficha-pie .price { font-size: 26px; }
.ficha-pie .add { padding: 12px 20px; font-size: 14px; }

/* ---------- Guía rápida ---------- */
.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tip { background: var(--peach); border-radius: var(--r); padding: 20px; }
.tip h3 { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.tip p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---------- Pie de página ---------- */
footer { margin-top: 56px; background: var(--navy); color: #c9cee6; }
footer .wrap {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: center;
  padding-block: 36px calc(36px + env(safe-area-inset-bottom, 0px));
}
footer b { color: #fff; }
footer small { display: block; margin-top: 6px; font-size: 12px; }
.foot-contact { display: grid; gap: 2px; text-align: right; font-size: 13px; }
.phone { font-weight: 800; font-size: 22px; letter-spacing: .02em; color: #fff; text-decoration: none; }

/* ---------- Bolsa de pedido (panel lateral) ---------- */
.scrim { position: fixed; inset: 0; background: rgba(5, 9, 25, .5); z-index: 40; }
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(420px, 100%);
  background: var(--surface);
  z-index: 41;
  display: flex;
  flex-direction: column;
  box-shadow: -20px 0 50px rgba(0, 0, 0, .25);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer header { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer header h2 { font-size: 20px; }
.x { border: 0; background: var(--chip); border-radius: 999px; width: 36px; height: 36px; font-size: 16px; }
.items { flex: 1; overflow: auto; padding: 8px 20px; display: grid; align-content: start; gap: 2px; }
.items .empty { margin-top: 12px; }
.it { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.it img { width: 56px; height: 56px; object-fit: contain; background: #fff; border-radius: 10px; }
.it .nm { font-weight: 600; font-size: 14px; line-height: 1.3; }
.it .pr { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); background: transparent; font-weight: 700; }
.qty span { min-width: 18px; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; }
.sum { padding: 16px 20px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.tot { display: flex; justify-content: space-between; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.sum label { font-size: 13px; font-weight: 600; }
.sum input { width: 100%; font: inherit; color: var(--fg); background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 4px; }
.sum .note { font-size: 12px; color: var(--muted); margin: 0; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  translate: -50% 0;
  background: var(--fg);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  z-index: 80;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; padding-block: 34px 48px; }
  .stage { min-height: 0; }
  .fams { grid-template-columns: repeat(2, 1fr); }
  .fams .fam:last-child { grid-column: 1 / -1; }
  footer .wrap { grid-template-columns: 1fr; }
  .foot-contact { text-align: left; }
}
/* Ficha en el teléfono: foto arriba, datos abajo */
@media (max-width: 700px) {
  .ficha { padding: 10px; align-items: end; }
  .ficha-caja { grid-template-columns: 1fr; max-height: calc(100dvh - 20px); }
  .ficha-foto { padding: 18px; }
  .ficha-foto img { max-height: 34vh; }
  .ficha-info { padding: 20px 20px 22px; }
  .ficha-pie .price { font-size: 22px; }
}
@media (max-width: 520px) {
  .bag-label { display: none; }
  .search { flex-basis: 100%; }
  .dd { flex: 1 1 0; min-width: 0; }
  .dd-btn { min-width: 0; width: 100%; padding: 10px 14px; }
  #ddMarca .dd-menu { right: auto; left: 0; }
  .brand-logo { height: 56px; }
  .wabtn { padding: 9px 13px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .ds { display: none; }
  .card .bd { padding: 10px 12px 12px; }
  .card h3 { font-size: 14px; }
  .price { font-size: 15px; }
  .card .ft { flex-direction: column; align-items: stretch; }
  .add { padding: 9px 10px; font-size: 12.5px; }
}
