/* =========================================================================
   WIWU Perú · Destacados por línea (propuesta B, 27-11-2026). Solo modo claro.
   Pestañas por línea, un destacado grande y una fila de hasta 4 productos de esa línea.
   Celular: todo entra en una pantalla (foto baja, texto corto y fila de 4 miniaturas).
   Tablet: destacado horizontal. Computadora: destacado ancho y la fila debajo, en una pantalla.
   Fotos con fondo blanco: se funden con mix-blend-mode: multiply (nunca filter: drop-shadow).
   ========================================================================= */

.dxa {
  --dxa-ink: #0d1424;
  --dxa-soft: #4c5568;
  --dxa-tile: #edf2f9;
  --dxa-star: #e5ecf6;
  --dxa-line: rgba(13, 20, 36, .5);
  --dxa-wa: #168a45;
  --dxa-wa-ink: #116b37;
  --dxa-wa-bg: #dff2e7;
  --dxa-focus: #4d74b8;
  --dxa-ease: cubic-bezier(.23, 1, .32, 1);
  padding: clamp(1.25rem, 3vw, 2.4rem) 0 clamp(2.2rem, 5vw, 4rem);
  background: var(--bg, #f7faff);
  color: var(--dxa-ink);
}
.dxa__title { margin: 0 0 clamp(1rem, 2.2vw, 1.8rem); font-size: clamp(2rem, 4.2vw, 3.7rem); font-weight: 800; line-height: 1.04; letter-spacing: -.02em; color: var(--dxa-ink); text-wrap: balance; }
.dxa__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.dxa-panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }

/* ---------- Pestañas: una fila que se desliza hasta el borde de la pantalla ---------- */
.dxa-tabs {
  display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  margin: 0 calc(-1 * var(--gutter, 16px)); padding: 3px var(--gutter, 16px);
}
.dxa-tabs::-webkit-scrollbar { display: none; }
.dxa .dxa-tab {
  flex: none; min-height: 44px; padding: 0 1.1rem; border: 0; border-radius: 99px; cursor: pointer;
  background: #fff; color: var(--dxa-soft); box-shadow: inset 0 0 0 1px rgba(13, 20, 36, .16);
  font: inherit; font-size: .95rem; font-weight: 700; white-space: nowrap;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  transition: transform 140ms var(--dxa-ease), background-color 160ms ease, color 160ms ease;
}
.dxa .dxa-tab[aria-selected="true"] { background: var(--dxa-ink); color: #fff; box-shadow: none; }
.dxa .dxa-tab:active { transform: scale(.97); }
.dxa .dxa-tab:focus-visible { outline: 2px solid var(--dxa-focus); outline-offset: 2px; }

/* ---------- Foto (botón que abre la ficha) ---------- */
.dxa-media {
  position: relative; display: block; width: 100%; padding: 0; border: 0; overflow: hidden; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.dxa-media:focus-visible { outline: 2px solid var(--dxa-focus); outline-offset: -4px; border-radius: 18px; }

/* ---------- Destacado grande ---------- */
.dxa-star { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; border-radius: 22px; overflow: hidden; background: var(--dxa-star); }
.dxa-star__media { position: relative; min-width: 0; }
.dxa-media--star {
  height: clamp(210px, 30svh, 320px); container-type: size;
  background-color: color-mix(in srgb, var(--dxa-tint, #edf2f9) var(--dxa-tint-w, 0%), #edf2f9);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 70%);
  transition: background-color 220ms ease;
}
.dxa-media--star img { position: absolute; inset: 5% 8%; width: 84%; height: 90%; object-fit: contain; mix-blend-mode: multiply; transform: scale(var(--z, 1)); }
/* Los cases medidos se ajustan por su propia altura: todos se ven igual de altos y nunca se cortan.
   --bh/--bx/--by: alto y centro del case dentro de su foto · --slim: el case más ancho para su altura. */
.dxa-media--medida img {
  --case-h: min(calc(100cqh - 24px), calc(100cqw * .9 * var(--slim, 2)));
  --s: calc(var(--case-h) / var(--bh, .82));
  inset: auto; left: calc(50cqw - var(--bx, .5) * var(--s)); top: calc(50cqh - var(--by, .5) * var(--s));
  width: var(--s); height: var(--s); max-width: none; max-height: none; transform: none;
}
.dxa-media--star.dxa-media--edge img { inset: 0; width: 100%; height: 100%; object-position: 100% 100%; transform-origin: 100% 100%; -webkit-mask-image: linear-gradient(to bottom, #000 76%, transparent 100%); mask-image: linear-gradient(to bottom, #000 76%, transparent 100%); }

.dxa-star__body { display: grid; align-content: start; gap: 8px; min-width: 0; padding: 12px 14px 14px; }
.dxa-slot { display: grid; min-width: 0; }
.dxa-slot > * { grid-area: 1 / 1; display: grid; align-content: start; gap: 3px; min-width: 0; }
.dxa-slot__ghost { visibility: hidden; pointer-events: none; }
.dxa-star__name { margin: 0; font-size: clamp(1.4rem, 6vw, 1.8rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.dxa-star__desc { display: none; margin: 6px 0 0; max-width: 52ch; font-size: 1rem; line-height: 1.45; color: var(--dxa-soft); text-wrap: pretty; }
.dxa-model { margin: 0; font-size: .85rem; font-weight: 600; line-height: 1.3; color: var(--dxa-soft); font-variant-numeric: tabular-nums; }
.dxa-compat { display: flex; align-items: flex-start; gap: 6px; margin: 0; font-size: .88rem; font-weight: 600; line-height: 1.35; color: var(--dxa-ink); text-wrap: pretty; }
.dxa-compat svg { flex: none; width: 17px; height: 17px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.dxa-nw { white-space: nowrap; }
.dxa-star__colors { display: grid; align-content: center; min-height: 44px; }

/* ---------- Colores ---------- */
.dxa-colors { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dxa-colors__label { margin: 0; font-size: .95rem; color: var(--dxa-soft); }
.dxa-colors__label strong { font-weight: 700; color: var(--dxa-ink); }
.dxa-sw { display: flex; margin-right: -6px; }
.dxa-sw button {
  position: relative;
  flex: 0 1 44px;
  width: 44px;
  min-width: 34px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}
/* Punto y aro con tamaño fijo y centrados: siguen redondos aunque el botón se angoste en pantallas chicas */
.dxa-sw button::before,
.dxa-sw button::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
}
.dxa-sw button::before {
  width: 26px;
  height: 26px;
  margin: -13px 0 0 -13px;
  background: var(--sw);
  box-shadow: inset 0 0 0 1px var(--dxa-line);
  transition: transform 140ms var(--dxa-ease);
}
.dxa-sw button::after {
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  box-shadow: inset 0 0 0 2px transparent;
  transition: box-shadow 160ms ease;
}
.dxa-sw button[aria-pressed="true"]::after { box-shadow: inset 0 0 0 2px var(--dxa-ink); }
.dxa-sw button:active::before { transform: scale(.92); }
.dxa-sw button:focus-visible { outline: 2px solid var(--dxa-focus); outline-offset: 0; }

/* En el destacado: "Color: Negro" y los puntos en la misma fila en el celular; apilados en pantallas anchas */
.dxa-star .dxa-sw { margin: 0 -4px 0 0; }

/* ---------- Acciones ---------- */
.dxa-actions { display: flex; gap: 8px; }
.dxa .dxa-add {
  flex: 1 1 0;
  min-width: 0;
  min-height: 46px;
  padding: 0 .75rem;
  font-size: .95rem;
  white-space: nowrap;
}
.dxa .dxa-add.is-done { background: #127a3e; }
.dxa .dxa-add:focus-visible, .dxa-wa:focus-visible { outline: 2px solid var(--dxa-focus); outline-offset: 2px; }
.dxa-wa {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--dxa-wa-bg);
  color: var(--dxa-wa);
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 140ms var(--dxa-ease), background-color 160ms ease;
}
.dxa-wa svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.dxa-wa:active { transform: scale(.97); }
.dxa-wa--label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1 1 0;
  width: auto;
  height: auto;
  min-height: 46px;
  padding: 0 1rem;
  border-radius: 99px;
  color: var(--dxa-wa-ink);
  font-size: .95rem;
  font-weight: 700;
  white-space: nowrap;
}
.dxa-wa--label svg { color: var(--dxa-wa-ink); }
.dxa-actions--star { margin-top: 2px; }

/* ---------- Fila de productos de la línea ---------- */
.dxa-thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.dxa .dxa-thumb {
  display: grid; grid-template-rows: auto 1fr; align-content: start; gap: 4px; min-width: 0; padding: 5px 4px 7px; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--dxa-tile); color: var(--dxa-ink); box-shadow: inset 0 0 0 2px transparent; font: inherit;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  transition: transform 140ms var(--dxa-ease), box-shadow 160ms ease;
}
.dxa .dxa-thumb[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--dxa-ink); }
.dxa .dxa-thumb:active { transform: scale(.97); }
.dxa .dxa-thumb:focus-visible { outline: 2px solid var(--dxa-focus); outline-offset: 2px; }
.dxa-thumb__media { position: relative; display: block; width: 100%; aspect-ratio: 5 / 4; overflow: hidden; }
.dxa-thumb__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; transform: scale(var(--z, 1)); }
.dxa-thumb__media--edge img { object-position: 100% 100%; transform: none; }
.dxa-thumb__name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: .75rem; font-weight: 700; line-height: 1.2; text-align: center; overflow-wrap: anywhere; hyphens: auto; }

/* ---------- Acceso visible a la ficha ---------- */
.dxa-peek {
  position: absolute; right: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 .8rem;
  border-radius: 99px; background: rgba(255, 255, 255, .92); color: var(--dxa-ink); font-size: .82rem; font-weight: 700; box-shadow: 0 4px 14px rgba(13, 20, 36, .08);
}
.dxa-peek svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Tablet: destacado horizontal ---------- */
@media (min-width: 620px) {
  .dxa__grid, .dxa-panel { gap: 14px; }
  .dxa-star { grid-template-columns: minmax(0, .95fr) minmax(0, 1fr); }
  .dxa-star__media { min-height: 420px; }
  .dxa .dxa-media--star { position: absolute; inset: 0; height: auto; }   /* tamaño definido: el encuadre mide el marco en cqw/cqh */
  .dxa-star__body { align-content: center; gap: 16px; padding: clamp(20px, 3vw, 32px); }
  .dxa-star__name { font-size: clamp(1.85rem, 3.2vw, 2.4rem); }
  .dxa-star__desc { display: block; }
  .dxa-compat { font-size: .95rem; }
  .dxa-star .dxa-colors { display: grid; justify-content: start; gap: 2px; }
  .dxa-star .dxa-sw { margin: 0 0 0 -4px; }
  .dxa-star__colors { min-height: 70px; }
  .dxa-thumbs { gap: 14px; }
  .dxa-thumb__name { font-size: .88rem; }
}

/* ---------- Computadora: todo en una pantalla; la fila de abajo en horizontal (foto a la izquierda, nombre al lado) ---------- */
@media (min-width: 1024px) {
  .dxa .dxa-tab { min-height: 46px; padding: 0 1.35rem; font-size: 1rem; }
  .dxa-star { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); height: clamp(430px, calc(100svh - var(--header-h, 68px) - 340px), 580px); }
  .dxa-star__media { min-height: 0; }
  .dxa-star__body { overflow: hidden; padding: clamp(20px, 2.6vw, 44px); }
  .dxa-star__name { font-size: clamp(2rem, 2.8vw, 3rem); }
  .dxa-star__desc { font-size: 1.05rem; }
  .dxa .dxa-actions--star { max-width: 460px; }
  .dxa .dxa-thumb { grid-template-rows: none; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 12px; padding: 8px 14px 8px 8px; }
  .dxa-thumb__media { aspect-ratio: 1; }
  .dxa-thumb__name { font-size: 1rem; text-align: left; overflow-wrap: normal; }
}

/* ---------- Puntero fino: hover sin quedarse pegado en pantallas táctiles ---------- */
@media (hover: hover) and (pointer: fine) {
  .dxa .dxa-tab:hover:not([aria-selected="true"]) { background: #eef2f8; color: var(--dxa-ink); }
  .dxa .dxa-thumb:hover:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 2px rgba(13, 20, 36, .3); }
  .dxa .dxa-add:hover:not(.is-done) { background: #1f2a42; }
  .dxa-wa:hover { background: #cdebd9; }
  .dxa-sw button:hover:not([aria-pressed="true"])::after { box-shadow: inset 0 0 0 2px rgba(13, 20, 36, .35); }
  .dxa-media:hover .dxa-peek { background: #fff; }
}

/* ---------- Menos movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
  .dxa .dxa-tab, .dxa .dxa-thumb, .dxa-wa, .dxa-sw button::before { transition: none; }
  .dxa .dxa-tab:active, .dxa .dxa-thumb:active, .dxa-wa:active, .dxa-sw button:active::before { transform: none; }
}
