:root {
  --bg: #f1eef7;
  --bg-2: #e3ddf0;
  --card: #ffffff;
  --ink: #241a3d;
  --muted: #6f6688;
  --line: #d9d2e8;
  --violet: #6a5596;
  --wine: #8c2849;
  --wine-ink: #6e1d38;
  --ok: #2f7a55;
  --rose: #c46794;
  --rose-90: rgba(196, 103, 148, .9);
  --plum: #72638e;
  --focus: #5e407a;  /* anillo de foco: morado oscuro para que se vea sobre fondos claros */
  --sold: #e0e4f0;
  --field-line: #8a80a3;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(36, 26, 61, .06), 0 10px 30px rgba(36, 26, 61, .08);
  --display: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%) fixed;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; }

/* Corona KAAY (PNG transparente) */
.crown { display: block; height: auto; }

/* Barra superior */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px clamp(16px, 4vw, 40px);
  background: rgba(241, 238, 247, .85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 600; letter-spacing: .3em; font-size: 14px; }
.brand .crown { height: 34px; width: auto; }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 500;
}
.cart-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.badge {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px;
  background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center;
}

/* Hero */
.hero { position: relative; z-index: 0; text-align: center; padding: clamp(48px, 9vw, 110px) 16px clamp(56px, 8vw, 96px); color: #fff; }
.hero__bg {
  position: absolute; inset: 0 0 -280px; z-index: -1; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 460px), rgba(0, 0, 0, .55) calc(100% - 230px), transparent 100%);
          mask-image: linear-gradient(180deg, #000 0, #000 calc(100% - 460px), rgba(0, 0, 0, .55) calc(100% - 230px), transparent 100%);
  background: url("img/kaay-concierto.jpg") center 35% / cover no-repeat;
}
/* Velo oscuro para que el texto blanco se lea sobre la foto */
.hero__bg::after { content: ""; position: absolute; inset: 0; background:
  radial-gradient(ellipse 60% 70% at center, rgba(18, 14, 28, .62), rgba(18, 14, 28, .38) 100%),
  linear-gradient(180deg, rgba(18, 14, 28, .35), rgba(18, 14, 28, .55)); }
.hero__inner { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; text-shadow: 0 1px 12px rgba(0, 0, 0, .45); }
.hero__crown { width: min(240px, 60vw); margin: 0 auto 14px; filter: drop-shadow(0 1px 8px rgba(0, 0, 0, .5)); }
.tour { margin: 0 0 12px; font-weight: 700; font-size: clamp(14px, 2.2vw, 17px); letter-spacing: .18em; color: #fff; }
.hero h1 { padding-top: 24px; font-size: clamp(40px, 7vw, 68px); line-height: 1; color: #fff; }
.lede { font-size: 17px; color: rgba(255, 255, 255, .9); margin: 14px 0 18px; }
.pickup { margin: 0 0 26px; font-size: 15px; font-weight: 500; color: #fff; }
.hero .btn { display: flex; width: fit-content; margin: 0 auto; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 24px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
/* El botón principal usa el mismo estilo y estados que «Agregar» */
.btn--primary { background: var(--rose); color: #fff; font-size: 19px; font-weight: 700; }
.btn--primary:hover { background: var(--rose-90); }
.btn--primary:active { background: var(--plum); }
.btn--primary:disabled { background: var(--sold); color: var(--muted); opacity: 1; }
.btn--wine { background: var(--wine); color: #fff; }
.btn--wine:hover { background: var(--wine-ink); }
.btn--add { background: var(--rose); color: #fff; font-size: 19px; font-weight: 700; }
.btn--add:hover { background: var(--rose-90); }
.btn--add:active, .btn--add.is-added { background: var(--plum); }
.btn--add.is-added { animation: pop .45s cubic-bezier(.3, 1.6, .5, 1); }
.btn--add:disabled { background: var(--sold); color: var(--muted); opacity: 1; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.07); } 100% { transform: scale(1); } }
.btn--block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* Tienda */
.shop { max-width: 1180px; margin: 0 auto; padding: 8px clamp(16px, 4vw, 40px) 64px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .3s, transform .3s;
}
.card--flash { box-shadow: 0 0 0 3px var(--wine), var(--shadow); }
.card--wide { grid-column: 1 / -1; display: grid; grid-template-columns: 1.4fr 1fr; }
.card__img { background: #f3f2f5; aspect-ratio: 1 / 1; overflow: hidden; position: relative; }
.card--wide .card__img { aspect-ratio: 16 / 9; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card--soldout .card__img img { filter: grayscale(.8); opacity: .6; }
.stamp {
  position: absolute; top: 14px; left: 14px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.92); font-size: 12px; font-weight: 600; letter-spacing: .04em;
}
.stamp--low { color: var(--wine); }
.stamp--out { background: var(--ink); color: #fff; }
.card__body { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.card--wide .card__body { padding: 28px; justify-content: center; }
.card h3 { font-size: 26px; line-height: 1.1; }
.price { font-size: 20px; font-weight: 600; }
.desc { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0; }
.label { padding-bottom: 12px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); font-weight: 600; }

.sizes { display: flex; gap: 8px; flex-wrap: wrap; padding-bottom: 12px; }
.size {
  min-width: 52px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; font-weight: 600; text-align: center; line-height: 1.1;
}
.size:hover:not(:disabled) { border-color: var(--plum); }
.size[aria-pressed="true"] { background: var(--plum); color: #fff; border-color: var(--plum); font-weight: 700; }
.size:disabled { background: var(--sold); border-color: var(--sold); color: var(--muted); cursor: not-allowed; }

.buy { display: flex; gap: 10px; align-items: center; margin-top: auto; padding-top: 4px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 18px; }
.stepper button:disabled { opacity: .3; cursor: not-allowed; }
.stepper output { min-width: 28px; text-align: center; font-weight: 600; }
.stepper--sm button { width: 32px; height: 34px; font-size: 16px; }
.buy .btn { flex: 1; }

.notice { background: #fff; border-left: 4px solid var(--wine); padding: 14px 18px; border-radius: 12px; margin-bottom: 20px; box-shadow: var(--shadow); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* Info */
.info { max-width: 1180px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px) 64px; }
.info h2 { font-size: 36px; margin-bottom: 18px; }
.info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 16px; }
.info__grid > div { background: #FFFFFF; border: 1.5px solid #7D7398; border-radius: var(--radius); padding: 18px 20px; }
.info h3 { font-size: 22px; margin-bottom: 6px; }
.info p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.footer { text-align: center; padding: 28px 16px 40px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); }

/* Drawer */
.scrim { position: fixed; inset: 0; background: rgba(36, 26, 61, .35); z-index: 40; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(440px, 100vw); background: var(--bg);
  transform: translateX(100%); transition: transform .3s ease;
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(36,26,61,.15);
}
.drawer.open { transform: none; }
.drawer__head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 28px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.drawer__body { overflow-y: auto; padding: 16px 20px 28px; flex: 1; }
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; background: #fff; border-radius: 14px; padding: 10px; }
.line img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.line__name { font-weight: 600; font-size: 14px; line-height: 1.3; }
.line__meta { font-size: 13px; color: var(--muted); }
.line__right { display: grid; justify-items: end; gap: 6px; }
.link-btn { border: 0; background: none; color: var(--muted); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.empty { text-align: center; padding: 30px 0; display: grid; gap: 6px; justify-items: center; }
.empty p { margin: 0; }
.empty .btn { margin-top: 12px; }

.checkout fieldset { border: 0; padding: 0; margin: 22px 0 0; display: grid; gap: 16px; }
.checkout legend { font-family: var(--display); font-size: 22px; font-weight: 600; margin-bottom: 8px; }
.methods { display: grid; gap: 8px; }
.method { display: grid; grid-template-columns: auto 1fr auto; column-gap: 16px; align-items: start; background: #fff; border: 1px solid var(--field-line); border-radius: 14px; padding: 14px 16px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background-color .15s; }
.method:hover { border-color: var(--rose); }
.method:has(input:checked) { border-color: var(--plum); box-shadow: 0 0 0 1px var(--plum); background: #f7f3fb; }
/* Radio nativo (se ve como radio en todos los navegadores), en morado al seleccionarse */
.checkout .method input[type="radio"] { -webkit-appearance: radio; appearance: auto; accent-color: var(--plum); width: 20px; height: 20px; min-height: 0; margin: 1px 0 0; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; flex: none; }
.checkout .method input[type="radio"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.method b { font-size: 14px; }
.method span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.method em { font-style: normal; font-weight: 600; font-size: 14px; }
.checkout label { display: grid; gap: 6px; font-size: 13px; font-weight: 500; }
.checkout input, .checkout select { width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--field-line); background: #fff; font-size: 16px; }
.checkout select { appearance: none; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23241a3d' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 14px center; padding-right: 36px; }
.checkout [aria-invalid="true"] { border-color: var(--wine); border-width: 2px; background-color: #fff8fa; }
.field { display: grid; gap: 6px; }
.checkout .field label { display: block; font-size: 13px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; align-items: start; }
.field__hint { margin: 0; font-size: 12px; color: var(--muted); }
.field__error { margin: 0; font-size: 13px; color: var(--wine); font-weight: 500; display: flex; gap: 6px; align-items: flex-start; }
.field__error::before { content: "!"; flex: none; width: 16px; height: 16px; border-radius: 50%; background: var(--wine); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; margin-top: 1px; }
.size-error { margin: -4px 0 8px; }
.totals { margin: 22px 0 14px; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; font-size: 14px; }
.totals dt, .totals dd { margin: 0; }
.totals__grand { border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; font-size: 18px !important; font-weight: 600; }
.error { color: var(--wine); background: #fbeef2; border-radius: 10px; padding: 10px 12px; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  animation: toast-in .3s ease;
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px;
  box-shadow: var(--shadow); max-width: calc(100vw - 32px); text-align: center;
}

@media (max-width: 760px) {
  .card--wide { grid-template-columns: 1fr; }
  .card--wide .card__img { aspect-ratio: 16 / 10; }
  .card--wide .card__body { padding: 20px 22px 22px; }
  .cart-btn span { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@keyframes toast-in { from { opacity: 0; translate: 0 12px; } to { opacity: 1; translate: 0 0; } }
@media (min-width: 761px) {
  .toast { left: auto; right: clamp(16px, 4vw, 40px); top: 72px; bottom: auto; transform: none; border-radius: 14px; padding: 14px 18px; max-width: 360px; text-align: left; }
}

/* Micro-interacción al agregar */
.fly { position: fixed; z-index: 70; border-radius: 14px; object-fit: cover; pointer-events: none; box-shadow: 0 10px 30px rgba(36,26,61,.25); }
.cart-btn.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); border-color: var(--rose); }
.badge.bump { animation: bump .5s cubic-bezier(.3, 1.6, .5, 1); background: var(--rose); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.25); } 100% { transform: scale(1); } }

/* Accesibilidad */
.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; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn:focus-visible, .size:focus-visible, .cart-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.shop:focus { outline: none; }
.toast__action { border: 0; background: none; color: #fff; font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 4px 0 4px 6px; }
@media (max-width: 380px) { .field-row { grid-template-columns: 1fr; } }

/* Variantes de color */
.size--color { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; font-weight: 500; min-height: 44px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.size--color[aria-pressed="true"] .swatch { box-shadow: 0 0 0 2px #fff; }
.label__value { text-transform: none; letter-spacing: 0; color: var(--ink); font-weight: 600; }
.stamp--sample { top: auto; bottom: 14px; left: 14px; background: rgba(36,26,61,.82); color: #fff; font-weight: 500; }

/* Contraste de bordes de controles (WCAG 1.4.11) y tamaño de toque */
.size, .stepper, .cart-btn, .icon-btn { border-color: var(--field-line); }
.stepper--sm button { width: 40px; height: 40px; }
.link-btn { padding: 8px 0; }
.info__grid > div p { color: #5c5374; }
.info address { font-style: normal; margin: 0; color: #5c5374; font-size: 14px; line-height: 1.55; }
.info address strong { color: var(--ink); font-weight: 600; }

/* Las tarjetas de producto quedan encima de la foto que se desvanece */
.shop { position: relative; z-index: 1; }
.method > div { padding-left: 8px; }
/* Píldoras de color: todas del mismo ancho */
.sizes--color { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sizes--color .size--color { justify-content: flex-start; width: 100%; }
/* Se ajusta al ancho de la tarjeta (no de la pantalla): en tarjetas angostas el color va arriba y el nombre abajo */
.card__body { container-type: inline-size; }
.sizes--color .size--color[aria-pressed="true"] { font-weight: 600; }
@container (max-width: 420px) {
  .sizes--color { gap: 6px; }
  .sizes--color .size--color { flex-direction: column; justify-content: center; gap: 4px; padding: 8px 4px; font-size: 14px; text-align: center; }
  .sizes--color .swatch { width: 20px; height: 20px; }
}
/* Móvil (menos que tableta): la foto se reduce para que se vea al menos 60% de ella (160% del ancho → 62.5% visible)
   y se funde con un fondo oscuro debajo, así el texto blanco sigue legible */
@media (max-width: 767px) {
  .hero__bg {
    background:
      linear-gradient(180deg, rgba(18, 14, 28, 0) 0, rgba(18, 14, 28, 0) 55%, #120e1c 100%) center top / 100% 106.6vw no-repeat,
      url("img/kaay-concierto.jpg") center top / 160% auto no-repeat,
      #120e1c;
  }
}
