/* =========================================================
   ARMERÍA EL DOGO · Detalle de producto
   ========================================================= */

/* ---------- Tarjetas: abren el detalle ---------- */
.card { cursor: pointer; }
.card__link { color: inherit; text-decoration: none; }
.card__link:focus-visible { outline: none; }
.card:has(.card__link:focus-visible) { outline: 2px solid var(--ember-deep); outline-offset: 3px; }
.card__view {
  position: absolute; left: 12px; bottom: 12px;
  padding: 6px 12px; border-radius: 99px;
  background: oklch(0.24 0.02 60 / .85); color: var(--canvas);
  font-size: .78rem; font-weight: 700;
  opacity: 0; transform: translateY(8px);
  transition: opacity .4s, transform .6s var(--ease-expo);
}
.card:hover .card__view { opacity: 1; transform: none; }
@media (hover: none) { .card__view { display: none; } }
.ci__img { display: block; }
.ci__name a { color: inherit; text-decoration: none; }
.ci__name a:hover { text-decoration: underline; }
.ci__price b { color: var(--bark); }

/* ---------- Página ---------- */
.pdp {
  min-height: 100vh;
  padding-top: var(--nav-h);
  background: var(--canvas); color: var(--bark);
  background-image:
    repeating-linear-gradient(0deg, oklch(0.5 0.03 70 / .035) 0 1px, transparent 1px 4px),
    repeating-linear-gradient(90deg, oklch(0.5 0.03 70 / .03) 0 1px, transparent 1px 5px);
}
.pdp__inner { padding: clamp(18px, 3vw, 32px) var(--pad) clamp(96px, 10vw, 140px); }
.pdp.is-in .crumbs, .pdp.is-in .gal, .pdp.is-in .pdp__info { animation: pdpIn .9s var(--ease-expo) both; }
.pdp.is-in .gal { animation-delay: .05s; }
.pdp.is-in .pdp__info { animation-delay: .14s; }
@keyframes pdpIn { from { opacity: 0; transform: translateY(24px); } }

.btn--dark { --bg: var(--bark); --fg: var(--canvas); }
.btn--dark:hover { --bg: var(--ember-deep); }
.btn--dark.added { --bg: var(--moss); }
.btn--ghost-dark { --bg: transparent; --fg: var(--bark); box-shadow: inset 0 0 0 1.5px var(--bark-dim); }
.btn--ghost-dark:hover { --bg: var(--canvas-2); }

/* migas */
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: .9rem; color: var(--bark-dim); margin-bottom: clamp(18px, 2.4vw, 32px); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { color: var(--bark); text-decoration: underline; }
.crumbs i { font-style: normal; opacity: .45; }
.crumbs span[aria-current] { color: var(--bark); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.crumbs__back {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px; margin-right: 6px;
  border: 0; border-radius: 99px; background: var(--bark); color: var(--canvas); font-weight: 600; font-size: .88rem;
  transition: background-color .3s;
}
.crumbs__back:hover { background: var(--ember-deep); }
.crumbs__back svg { width: 18px; height: 18px; }

.pdp__grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 80px); align-items: start; }

/* ---------- Galería ---------- */
.gal { position: sticky; top: calc(var(--nav-h) + var(--top-h, 34px) + 20px); }
.gal__main { position: relative; aspect-ratio: 1 / 1; border-radius: 24px; overflow: hidden; background: var(--canvas-2); }
.gal__track {
  display: flex; height: 100%;
  overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain;
}
.gal__track::-webkit-scrollbar { display: none; }
.gal__track:focus-visible { outline: 2px solid var(--ember-deep); outline-offset: -2px; }
.gal__slide { flex: 0 0 100%; margin: 0; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; }
.gal__slide img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s var(--ease-out); user-select: none; -webkit-user-drag: none; }
@media (hover: hover) and (pointer: fine) {
  .gal__slide { cursor: zoom-in; }
  .gal__slide.is-zoom img { transform: scale(2.1); }
}
.gal__badges { position: absolute; top: 16px; left: 16px; pointer-events: none; }
.gal__badges .tag { backdrop-filter: blur(8px); }
.gal__badges .tag--online { background: oklch(0.97 0.01 240 / .92); }
.gal__badges .tag--wa { background: oklch(0.97 0.02 152 / .92); }
.gal__nav {
  position: absolute; top: 50%; translate: 0 -50%;
  width: 46px; height: 46px; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: oklch(0.975 0.01 85 / .92); color: var(--bark);
  box-shadow: 0 8px 20px -10px oklch(0.2 0.03 60 / .5);
  opacity: 0; transition: opacity .3s, transform .4s var(--ease-out);
}
.gal__nav svg { width: 22px; height: 22px; }
.gal__nav--prev { left: 14px; }
.gal__nav--next { right: 14px; }
.gal__nav--next svg { transform: scaleX(-1); }
.gal__main:hover .gal__nav, .gal__nav:focus-visible { opacity: 1; }
.gal__nav:hover { transform: scale(1.06); }
.gal__hint {
  position: absolute; right: 14px; bottom: 14px; pointer-events: none;
  padding: 6px 12px; border-radius: 99px; font-size: .76rem; font-weight: 600;
  background: oklch(0.24 0.02 60 / .75); color: var(--canvas);
  transition: opacity .3s;
}
.gal__main:hover .gal__hint { opacity: 0; }
@media (hover: none), (pointer: coarse) { .gal__hint { display: none; } }
.gal__dots { position: absolute; left: 50%; bottom: 14px; translate: -50% 0; display: none; gap: 6px; padding: 6px 10px; border-radius: 99px; background: oklch(0.24 0.02 60 / .45); }
.gal__dots i { width: 7px; height: 7px; border-radius: 99px; background: oklch(0.97 0.01 85 / .55); transition: width .4s var(--ease-expo), background-color .3s; }
.gal__dots i.is-active { width: 20px; background: var(--canvas); }
.gal__thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gal__thumb {
  width: 84px; aspect-ratio: 1; padding: 0; border: 0; border-radius: 14px; overflow: hidden;
  background: var(--canvas-2); opacity: .55;
  transition: opacity .3s;
}
.gal__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gal__thumb:hover { opacity: .85; }
.gal__thumb.is-active { opacity: 1; outline: 2px solid var(--bark); outline-offset: 2px; }

/* ---------- Info ---------- */
.pdp__info { padding-top: 4px; }
.pdp__meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--bark-dim); }
.pdp__meta span { color: var(--moss); }
.pdp__meta i { font-style: normal; opacity: .5; }
.pdp__title {
  margin: 10px 0 14px;
  font-family: var(--f-display); font-weight: 800; text-transform: uppercase;
  font-size: clamp(2.3rem, 1.5rem + 2.6vw, 4rem); line-height: .94; letter-spacing: -.005em; text-wrap: balance;
}
.pdp__stock { display: inline-flex; align-items: center; gap: 8px; font-size: .92rem; font-weight: 600; color: var(--moss); }
.pdp__stock i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: live 2s var(--ease-out) infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 oklch(0.5 0.075 150 / .5); } 100% { box-shadow: 0 0 0 8px oklch(0.5 0.075 150 / 0); } }
.pdp__stock--low { color: var(--ember-deep); }
.pdp__stock--ask, .pdp__stock--out { color: var(--bark-dim); }
.pdp__stock--ask i, .pdp__stock--out i { animation: none; }

.pdp__price { display: flex; flex-direction: column; gap: 4px; margin: 24px 0; padding: 22px 0; border-top: 1.5px solid var(--canvas-3); border-bottom: 1.5px solid var(--canvas-3); }
.pdp__price strong { font-family: var(--f-display); font-weight: 900; font-size: clamp(2.6rem, 2rem + 1.8vw, 3.6rem); line-height: 1; letter-spacing: .005em; }
.pdp__price--ask strong { font-size: clamp(2rem, 1.6rem + 1.2vw, 2.6rem); color: var(--bark-dim); }
.pdp__cuotas { margin-top: 6px; font-weight: 600; color: var(--moss); }
.pdp__cuotas b { font-weight: 800; }
.pdp__pay { font-size: .9rem; color: var(--bark-dim); max-width: 46ch; }

.opts { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.opts legend { padding: 0; margin-bottom: 10px; font-weight: 600; }
.opts legend b { font-weight: 700; color: var(--bark-dim); }
.opts:has(.is-active) legend b { color: var(--bark); }
.opts__list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-width: 52px; height: 46px; padding: 0 16px; border: 0; border-radius: 12px;
  background: oklch(0.975 0.01 85); box-shadow: inset 0 0 0 1.5px var(--canvas-3);
  font-weight: 600; color: var(--bark);
  transition: background-color .25s, color .25s, box-shadow .25s;
}
.opt:hover:not(:disabled) { box-shadow: inset 0 0 0 1.5px var(--bark-dim); }
.opt.is-active { background: var(--bark); color: var(--canvas); box-shadow: none; }
.opt:disabled { opacity: .4; text-decoration: line-through; cursor: not-allowed; }
.opts.shake { animation: shake .5s var(--ease-out); }
.opts.shake legend { color: var(--ember-deep); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }

.pdp__actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.pdp__actions .btn { min-height: 56px; }
.pdp__now, .pdp__wa { grid-column: 1 / -1; }
.qty--lg { height: 56px; margin: 0; background: oklch(0.975 0.01 85); }
.qty--lg button { width: 46px; height: 46px; font-size: 1.3rem; margin: 0 2px; }
.qty--lg span { min-width: 30px; font-size: 1.05rem; }

.pdp__how { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: h; display: grid; gap: 10px; }
.pdp__how li { counter-increment: h; display: grid; grid-template-columns: 30px 1fr; align-items: baseline; font-size: .95rem; color: var(--bark-dim); }
.pdp__how li::before { content: "0" counter(h); font-family: var(--f-stencil); font-weight: 900; color: var(--ember-deep); }

.pdp__legal {
  display: flex; gap: 14px; align-items: flex-start; margin-top: 22px; padding: 18px;
  border-radius: 16px; background: oklch(0.73 0.165 55 / .12); color: var(--bark);
}
.pdp__legal svg { width: 28px; height: 28px; flex: none; color: var(--ember-deep); }
.pdp__legal p { margin: 0; font-size: .92rem; line-height: 1.55; }

.perks { list-style: none; margin: 26px 0 0; padding: 20px 0 0; border-top: 1.5px solid var(--canvas-3); display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.perks li { display: flex; gap: 12px; align-items: flex-start; }
.perks svg { width: 26px; height: 26px; flex: none; color: var(--moss); }
.perks span { display: flex; flex-direction: column; font-size: .82rem; line-height: 1.4; color: var(--bark-dim); }
.perks b { font-size: .92rem; color: var(--bark); }

.ship { margin-top: 24px; padding: 20px; border-radius: 18px; background: oklch(0.975 0.01 85); box-shadow: inset 0 0 0 1.5px var(--canvas-3); }
.ship label { display: block; font-weight: 700; margin-bottom: 10px; }
.ship__row { display: flex; gap: 8px; }
.ship__row input {
  flex: 1; min-width: 0; height: 50px; padding: 0 18px; border: 0; border-radius: 99px;
  background: var(--canvas); box-shadow: inset 0 0 0 1.5px var(--canvas-3); font: inherit; color: var(--bark); outline: 0;
}
.ship__row input:focus { box-shadow: inset 0 0 0 2px var(--ember-deep); }
.ship__row .btn { min-height: 50px; }
.ship__err { margin: 10px 0 0; font-size: .88rem; color: var(--ember-deep); font-weight: 600; }
.ship__list { list-style: none; margin: 12px 0 0; padding: 0; }
.ship__list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--canvas-3); animation: cardIn .5s var(--ease-expo) both; }
.ship__list li:nth-child(2) { animation-delay: .08s; }
.ship__list span { display: flex; flex-direction: column; font-size: .84rem; color: var(--bark-dim); }
.ship__list span b { font-size: .95rem; color: var(--bark); }
.ship__list strong { font-family: var(--f-display); font-weight: 800; font-size: 1.35rem; white-space: nowrap; }

.pdp__share { display: flex; gap: 8px; margin-top: 22px; flex-wrap: wrap; }
.share-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 99px;
  background: transparent; box-shadow: inset 0 0 0 1.5px var(--canvas-3); color: var(--bark-dim);
  font-size: .88rem; font-weight: 600; text-decoration: none; transition: color .25s, box-shadow .25s;
}
.share-btn:hover { color: var(--bark); box-shadow: inset 0 0 0 1.5px var(--bark-dim); }
.share-btn svg { width: 18px; height: 18px; }

/* ---------- Descripción, ficha, preguntas ---------- */
.pdp__more {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 80px);
  grid-template-areas: "desc specs" "faq specs";
  margin-top: clamp(64px, 8vw, 120px); padding-top: clamp(40px, 5vw, 64px); border-top: 1.5px solid var(--canvas-3);
}
.pdp__desc { grid-area: desc; }
.pdp__specs { grid-area: specs; }
.pdp__faq { grid-area: faq; }
.pdp__more h2 { margin: 0 0 18px; font-family: var(--f-display); font-weight: 800; text-transform: uppercase; font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.4rem); line-height: 1; }
.pdp__desc p { margin: 0; font-size: 1.08rem; line-height: 1.75; max-width: 62ch; color: oklch(0.34 0.02 62); }
.specs { margin: 0; }
.specs div { display: grid; grid-template-columns: minmax(110px, 40%) 1fr; gap: 16px; padding: 14px 0; border-top: 1px solid var(--canvas-3); }
.specs div:last-child { border-bottom: 1px solid var(--canvas-3); }
.specs dt { font-size: .88rem; color: var(--bark-dim); }
.specs dd { margin: 0; font-weight: 600; }
.pdp__faq details { border-top: 1px solid var(--canvas-3); }
.pdp__faq details:last-child { border-bottom: 1px solid var(--canvas-3); }
.pdp__faq summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 600;
}
.pdp__faq summary::-webkit-details-marker { display: none; }
.pdp__faq summary::after { content: "+"; font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--bark-dim); transition: transform .4s var(--ease-expo); }
.pdp__faq details[open] summary::after { transform: rotate(45deg); }
.pdp__faq details > div p { margin: 0 0 18px; color: var(--bark-dim); max-width: 62ch; }
.pdp__faq details[open] > div { animation: cardIn .5s var(--ease-expo); }

.pdp__related { margin-top: clamp(72px, 9vw, 128px); }
.pdp__related .display { font-size: clamp(2.2rem, 1.4rem + 3vw, 4rem); margin-bottom: 28px; }

/* ---------- Barra fija de compra (celular) ---------- */
.buybar { display: none; }

@media (max-width: 860px) {
  .pdp__grid { grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .gal { position: static; margin: 0 calc(var(--pad) * -1); }
  .gal__main { border-radius: 0; }
  .gal__thumbs, .gal__nav { display: none; }
  .gal__dots { display: flex; }
  .crumbs span[aria-current] { display: none; }
  .crumbs a[data-crumb]:not([data-crumb="todos"]) + i { display: none; }
  .pdp__more { grid-template-columns: 1fr; grid-template-areas: "desc" "specs" "faq"; gap: 48px; }

  .on-pdp .wa-float { display: none; }
  .buybar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px var(--gutter) max(10px, env(safe-area-inset-bottom));
    background: oklch(0.935 0.02 82 / .95); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 -1px 0 var(--canvas-3), 0 -12px 30px -18px oklch(0.2 0.03 60 / .5);
    color: var(--bark);
    transform: translateY(110%); transition: transform .5s var(--ease-expo);
  }
  .on-pdp .buybar.is-on { transform: none; }
  .buybar__info { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
  .buybar__name { font-size: .8rem; color: var(--bark-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buybar strong { font-family: var(--f-display); font-weight: 900; font-size: 1.5rem; }
  .buybar .btn { min-height: 48px; padding: 0 1.2em; flex: none; }
}
@media (max-width: 420px) {
  .pdp__actions { grid-template-columns: minmax(0, 1fr); }
  .pdp__actions .btn, .pdp .btn--block { white-space: normal; text-align: center; line-height: 1.2; }
  .qty--lg { justify-content: space-between; }
  .ship__row { flex-direction: column; }
  .ship__row input { flex: none; }
  .ship__row .btn { width: 100%; }
  .specs div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .gal__main { aspect-ratio: 16 / 10; }
}
@media (prefers-reduced-motion: reduce) {
  .gal__slide.is-zoom img { transform: none; }
}
