/* ==========================================================================
   JM · Componentes — tarjeta de producto, filtros, ficha, carrito
   ========================================================================== */

/* ======================================================================
   TARJETA DE PRODUCTO
   ====================================================================== */

.wd-product {
  position: relative;
  display: flex;
  flex-direction: column;
}

.wd-product__wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* --- área de imagen ---------------------------------------------------- */

.wd-product__thumb {
  position: relative;
  overflow: hidden;
  border-radius: var(--wd-radius-lg);
  background: var(--wd-surface);
  margin-bottom: 14px;
}

.wd-product__media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
}

.wd-product__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--wd-t-slow), transform var(--wd-t-slow);
}

.wd-product__slide:first-child {
  opacity: 1;
}

.wd-product__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* el leve aumento deja margen para que el desplazamiento del parallax
     nunca enseñe los bordes del marco */
  transform: scale(1.1);
}

/* Parallax: la foto se mueve dentro de su marco al hacer scroll. La escala
   la define el CSS y el desplazamiento llega por la variable --px. */
.js-parallax .wd-product__media img {
  transform: translate3d(0, var(--px, 0px), 0) scale(1.1);
}

/* --- puntos de la galería --------------------------------------------- */

.wd-product__dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity var(--wd-t), transform var(--wd-t), visibility var(--wd-t);
}

.wd-product__dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: background var(--wd-t-fast), transform var(--wd-t-fast);
}

.wd-product__dots span.is-active {
  background: var(--wd-primary-color);
  transform: scale(1.25);
}

/* --- botones de acción (superior derecha) ------------------------------ */

.wd-product__actions {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 0;
  transform: translateX(12px);
  transition: opacity var(--wd-t), transform var(--wd-t);
}

.wd-action {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--wd-dark-2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: background var(--wd-t-fast), color var(--wd-t-fast), transform var(--wd-t-fast);
}

.wd-action svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wd-action:hover {
  background: var(--wd-primary-color);
  color: #fff;
  transform: translateY(-2px);
}

/* En pantallas táctiles los botones flotantes de la tarjeta grow un poco
   para alcanzar el mínimo de 44px de área táctil. */
@media (hover: none), (max-width: 768px) {
  .wd-action {
    width: 44px;
    height: 44px;
  }
}

.wd-action.is-active {
  background: var(--wd-primary-color);
  color: #fff;
}

/* --- botón agregar al carrito ------------------------------------------ */

.wd-product__cart {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 4;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--wd-radius);
  background: var(--wd-primary-color);
  color: #fff;
  box-shadow: 0 8px 20px rgba(46, 107, 198, 0.32);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity var(--wd-t), transform var(--wd-t), background var(--wd-t-fast);
}

.wd-product__cart svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wd-product__cart:hover {
  background: var(--wd-primary-color-hover);
}

.wd-product__cart.is-done {
  background: var(--wd-success-color);
}

/* --- badges sobre la imagen -------------------------------------------- */

.wd-product__flags {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.wd-product__flags .label-hot {
  width: 38px;
  height: 38px;
  font-size: 11px;
}

/* --- información ------------------------------------------------------- */

.wd-product__title {
  font-family: var(--wd-title-font);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--wd-entities-title-color);
  margin-bottom: 4px;
}

.wd-product__title a {
  color: inherit;
}

.wd-product__title a:hover {
  color: var(--wd-entities-title-color-hover);
}

.wd-product__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.wd-product__cats a {
  color: var(--wd-text-color);
  /* área táctil mínima razonable para el enlace de categoría */
  display: inline-block;
  padding: 4px 0;
  min-height: 28px;
}

.wd-product__cats a:hover {
  color: var(--wd-primary-color);
}

.wd-product__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0 9px;
  font-size: 16px;
  font-weight: 700;
  color: var(--wd-primary-color);
}

.wd-product__price del {
  font-size: 13px;
  font-weight: 400;
  color: var(--wd-text-color);
}

/* --- estado hover ------------------------------------------------------ */

.wd-product:hover .wd-product__actions {
  opacity: 1;
  transform: translateX(0);
}

.wd-product:hover .wd-product__cart {
  opacity: 1;
  transform: translateY(0);
}

.wd-product:hover .wd-product__dots {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.wd-product:hover .wd-product__slide.is-active {
  opacity: 0;
}

.wd-product:hover .wd-product__slide.is-active + .wd-product__slide {
  opacity: 1;
}

/* ======================================================================
   PESTAÑAS DE CATEGORÍA
   ====================================================================== */

.wd-tabs__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 30px;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--wd-border-soft);
}

.wd-tabs__btn {
  position: relative;
  padding: 10px 0 14px;
  font-family: var(--wd-title-font);
  font-size: 17px;
  font-weight: 600;
  color: var(--wd-text-color);
  transition: color var(--wd-t-fast);
}

.wd-tabs__btn::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--wd-primary-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--wd-t);
}

.wd-tabs__btn:hover {
  color: var(--wd-dark-2);
}

.wd-tabs__btn.is-active {
  color: var(--wd-dark-2);
}

.wd-tabs__btn.is-active::after {
  transform: scaleX(1);
}

.wd-tabs__count {
  font-family: var(--wd-text-font);
  font-size: 12px;
  font-weight: 400;
  color: var(--wd-text-color);
  margin-left: 5px;
}

.wd-tabs__panel {
  display: none;
}

.wd-tabs__panel.is-active {
  display: block;
  animation: wd-fade-up 0.45s var(--wd-ease) both;
}

/* ======================================================================
   TIENDA — sidebar + contenido
   ====================================================================== */

.wd-shop {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

/* Los hijos del grid deben poder encogerse por debajo de su min-content:
   sin esto, un hijo ancho (paginación, toolbar) fija la pista y la página
   se desborda horizontalmente en móvil. */
.wd-shop > * {
  min-width: 0;
}

@media (max-width: 1024px) {
  .wd-shop {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

/* --- filtros ----------------------------------------------------------- */

.wd-filters {
  position: sticky;
  top: calc(var(--wd-header-h) + 20px);
}

.wd-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--wd-border);
  margin-bottom: 6px;
}

.wd-filters__title {
  font-size: 17px;
  color: var(--wd-dark-2);
}

.wd-filters__clear {
  font-size: 12px;
  font-weight: 600;
  color: var(--wd-primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.wd-filters__clear:hover {
  color: var(--wd-primary-color-hover);
}

.wd-fgroup {
  border-bottom: 1px solid var(--wd-border-soft);
  padding: 16px 0;
}

.wd-fgroup__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-family: var(--wd-title-font);
  font-size: 15px;
  font-weight: 600;
  color: var(--wd-dark-2);
  margin-bottom: 12px;
}

.wd-fgroup__head svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  transition: transform var(--wd-t-fast);
}

.wd-fgroup.is-collapsed .wd-fgroup__head svg {
  transform: rotate(-90deg);
}

.wd-fgroup.is-collapsed .wd-fgroup__body {
  display: none;
}

.wd-fgroup__body {
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}

.wd-fcheck {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  font-size: 14px;
  color: var(--wd-text-color);
  cursor: pointer;
  transition: color var(--wd-t-fast);
}

.wd-fcheck:hover {
  color: var(--wd-dark-2);
}

.wd-fcheck input {
  appearance: none;
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
  border: 1px solid var(--wd-border);
  border-radius: 3px;
  background: #fff;
  cursor: pointer;
  transition: background var(--wd-t-fast), border-color var(--wd-t-fast);
}

.wd-fcheck input:checked {
  background: var(--wd-primary-color);
  border-color: var(--wd-primary-color);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-size: 11px 11px;
  background-position: center;
  background-repeat: no-repeat;
}

.wd-fcheck__count {
  margin-left: auto;
  font-size: 12px;
  color: #b3b3b3;
}

/* --- rango de precio ---------------------------------------------------- */

.wd-range {
  padding-top: 4px;
}

.wd-range__values {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--wd-dark-2);
}

.wd-range__slider {
  position: relative;
  height: 4px;
  border-radius: 2px;
  background: var(--wd-border);
}

.wd-range__fill {
  position: absolute;
  top: 0;
  bottom: 0;
  background: var(--wd-primary-color);
  border-radius: 2px;
}

.wd-range input[type='range'] {
  position: absolute;
  top: -7px;
  left: 0;
  width: 100%;
  height: 18px;
  appearance: none;
  background: none;
  pointer-events: none;
  margin: 0;
}

.wd-range input[type='range']::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--wd-primary-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  pointer-events: auto;
}

.wd-range input[type='range']::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--wd-primary-color);
  cursor: pointer;
  pointer-events: auto;
}

/* ======================================================================
   BARRA DE HERRAMIENTAS DE LA TIENDA
   ====================================================================== */

.wd-shop__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--wd-border);
}

.wd-shop__count {
  font-size: 14px;
  color: var(--wd-text-color);
}

.wd-shop__count b {
  color: var(--wd-dark-2);
}

.wd-shop__controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.wd-select {
  position: relative;
}

.wd-select select {
  appearance: none;
  padding: 10px 36px 10px 14px;
  min-width: 190px;
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  background: #fff;
  font-size: 13px;
  color: var(--wd-dark-2);
  cursor: pointer;
  transition: border-color var(--wd-t-fast);
}

.wd-select select:hover {
  border-color: var(--wd-primary-color);
}

.wd-select__caret {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -5px;
  border-right: 1.5px solid var(--wd-text-color);
  border-bottom: 1.5px solid var(--wd-text-color);
  transform: rotate(45deg);
  pointer-events: none;
}

.wd-viewtoggle {
  display: flex;
  gap: 4px;
}

.wd-viewtoggle button {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--wd-radius);
  color: var(--wd-text-color);
  transition: color var(--wd-t-fast), border-color var(--wd-t-fast), background var(--wd-t-fast);
}

.wd-viewtoggle button:hover {
  color: var(--wd-primary-color);
}

.wd-viewtoggle button.is-active {
  border-color: var(--wd-border);
  background: var(--wd-surface);
  color: var(--wd-dark-2);
}

.wd-viewtoggle svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
}

/* En móvil la barra de la tienda se reordena en dos filas para que el
   contador, los filtros, el orden y el cambio de vista quepan sin desbordar:
   fila 1 = contador + vista, fila 2 = filtros + ordenar. */
@media (max-width: 767px) {
  .wd-shop__toolbar {
    gap: 12px;
  }
  .wd-shop__count {
    order: 1;
  }
  .wd-viewtoggle {
    order: 2;
    margin-left: auto;
  }
  .wd-shop__controls {
    order: 3;
    flex: 1 1 100%;
    min-width: 0;
    flex-wrap: wrap;
    gap: 10px;
  }
  .wd-select {
    flex: 1 1 150px;
    min-width: 0;
  }
  .wd-select select {
    min-width: 0;
    width: 100%;
  }
}

.wd-filters-toggle {
  display: none;
}

@media (max-width: 1024px) {
  .wd-filters-toggle {
    display: inline-flex;
  }
  .wd-shop__toolbar {
    flex-wrap: wrap;
  }
}

/* ======================================================================
   PAGINACIÓN
   ====================================================================== */

.wd-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 46px;
}

.wd-pagination button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  border-radius: var(--wd-radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--wd-dark-2);
  transition: all var(--wd-t-fast);
}

.wd-pagination button:hover:not(:disabled) {
  border-color: var(--wd-border);
  color: var(--wd-primary-color);
}

.wd-pagination button.is-active {
  background: var(--wd-primary-color);
  border-color: var(--wd-primary-color);
  color: #fff;
}

/* Los puntos suspensivos no son botones pulsables */
.wd-pagination button.wd-pagination__gap {
  min-width: 20px;
  padding: 0;
  border: 0;
  color: var(--wd-text-color);
}

.wd-pagination button:disabled {
  opacity: 0.35;
  cursor: default;
}

.wd-pagination svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

/* ======================================================================
   FICHA DE PRODUCTO
   ====================================================================== */

.wd-single {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

@media (max-width: 900px) {
  .wd-single {
    /* minmax(0,…) para que la pista pueda encogerse por debajo del ancho
       mínimo del contenido; con 1fr sola se desborda en pantallas de 320px */
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
}

.wd-single__gallery {
  position: sticky;
  top: calc(var(--wd-header-h) + 20px);
}

/* En móvil la galería va apilada arriba del texto. Si se queda "sticky" la
   imagen permanece clavada en pantalla y el título, el precio y las
   miniaturas se leen por detrás de la foto.
   Este bloque va DESPUÉS de la regla base: una media query no gana por sí
   sola, así que si se pone antes el navegador aplica la regla posterior. */
@media (max-width: 900px) {
  .wd-single__gallery {
    position: static;
  }
}

.wd-single__stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--wd-radius-lg);
  background: var(--wd-surface);
  overflow: hidden;
}

.wd-single__stage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity var(--wd-t-slow);
}

.wd-single__stage img.is-active {
  opacity: 1;
}

/* En móvil la foto de la ficha también se desplaza con el scroll (en
   escritorio la galería es "sticky", así que allí no tiene sentido). */
@media (max-width: 900px) {
  .js-parallax .wd-single__stage img {
    transform: translate3d(0, var(--px, 0px), 0) scale(1.1);
  }
}

.wd-single__thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.wd-single__thumb {
  width: 76px;
  height: 76px;
  border-radius: var(--wd-radius);
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--wd-surface);
  transition: border-color var(--wd-t-fast);
}

.wd-single__thumb.is-active {
  border-color: var(--wd-primary-color);
}

.wd-single__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wd-single__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 12px;
}

.wd-single__cats a {
  color: var(--wd-text-color);
  display: inline-block;
  padding: 4px 0;
  min-height: 28px;
}

.wd-single__cats a:hover {
  color: var(--wd-primary-color);
}

.wd-single__title {
  font-size: 34px;
  line-height: 1.15;
  margin-bottom: 14px;
}

.wd-single__price {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 28px;
  font-weight: 700;
  color: var(--wd-primary-color);
  margin-bottom: 6px;
}

.wd-single__price del {
  font-size: 19px;
  font-weight: 400;
  color: var(--wd-text-color);
}

.wd-single__stock {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 22px;
}

.wd-single__stock::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--wd-success-color);
}

.wd-single__stock.is-out::before {
  background: var(--wd-sale-color);
}

.wd-single__ship {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--wd-text-color);
  margin: -14px 0 22px;
}

.wd-single__ship svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
}

.wd-single__excerpt {
  font-size: 15px;
  line-height: 1.7;
  margin-bottom: 26px;
  max-width: 560px;
}

.wd-single__actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.wd-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--wd-border);
  border-radius: var(--wd-radius);
  overflow: hidden;
}

.wd-qty button {
  width: 40px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--wd-dark-2);
  transition: background var(--wd-t-fast);
}

.wd-qty button:hover {
  background: var(--wd-surface);
}

.wd-qty button svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wd-qty input {
  width: 46px;
  height: 48px;
  border: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--wd-dark-2);
  -moz-appearance: textfield;
}

.wd-qty input::-webkit-outer-spin-button,
.wd-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* --- pestañas de la ficha ---------------------------------------------- */

.wd-specs {
  border-top: 1px solid var(--wd-border);
  margin-top: 8px;
}

.wd-specs__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 26px;
  border-bottom: 1px solid var(--wd-border);
}

.wd-specs__tab {
  padding: 16px 0;
  font-family: var(--wd-title-font);
  font-size: 16px;
  font-weight: 600;
  color: var(--wd-text-color);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--wd-t-fast), border-color var(--wd-t-fast);
}

.wd-specs__tab.is-active {
  color: var(--wd-dark-2);
  border-bottom-color: var(--wd-primary-color);
}

.wd-specs__panel {
  display: none;
  padding: 24px 0;
}

.wd-specs__panel.is-active {
  display: block;
  animation: wd-fade-up 0.4s var(--wd-ease) both;
}

.wd-specs__panel h4 {
  font-size: 16px;
  margin: 22px 0 10px;
}

.wd-specs__panel h4:first-child {
  margin-top: 0;
}

.wd-specs__panel ul {
  margin: 0;
}

.wd-specs__panel li {
  position: relative;
  padding-left: 16px;
  font-size: 14px;
  line-height: 1.75;
}

.wd-specs__panel li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(var(--wd-primary-color-rgb), 0.55);
}

.wd-specs__panel p {
  font-size: 14px;
  line-height: 1.75;
}

/* ======================================================================
   CARRITO LATERAL
   ====================================================================== */

.wd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 210;
  width: 390px;
  max-width: 92vw;
  display: flex;
  flex-direction: column;
  background: #fff;
  box-shadow: var(--wd-shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--wd-t-slow);
}

.wd-drawer.is-open {
  transform: translateX(0);
}

.wd-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--wd-border);
}

.wd-drawer__title {
  font-size: 19px;
  color: var(--wd-dark-2);
}

.wd-drawer__close {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--wd-dark-2);
  transition: background var(--wd-t-fast);
}

.wd-drawer__close:hover {
  background: var(--wd-surface);
}

.wd-drawer__close svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.wd-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 24px;
}

.wd-drawer__foot {
  padding: 20px 24px 24px;
  border-top: 1px solid var(--wd-border);
}

.wd-cart-row {
  display: flex;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--wd-border-soft);
}

.wd-cart-row__img {
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border-radius: var(--wd-radius);
  overflow: hidden;
  background: var(--wd-surface);
}

.wd-cart-row__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wd-cart-row__body {
  flex: 1;
  min-width: 0;
}

.wd-cart-row__name {
  font-family: var(--wd-title-font);
  font-size: 14px;
  font-weight: 600;
  color: var(--wd-dark-2);
  line-height: 1.35;
  margin-bottom: 4px;
}

.wd-cart-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wd-cart-row__price {
  font-size: 15px;
  font-weight: 700;
  color: var(--wd-primary-color);
}

.wd-cart-row__remove {
  font-size: 12px;
  color: #b3b3b3;
  transition: color var(--wd-t-fast);
}

/* el "quitar" es un botón: necesita área táctil suficiente */
.wd-cart-row__remove {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 4px;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.wd-cart-row__remove:hover {
  color: var(--wd-sale-color);
}

.wd-cart-empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--wd-text-color);
}

.wd-cart-empty svg {
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  stroke: #dcdcdc;
  fill: none;
  stroke-width: 1.2;
}

.wd-drawer__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--wd-dark-2);
}

.wd-drawer__total b {
  font-size: 22px;
  font-weight: 700;
  color: var(--wd-primary-color);
}

/* fila de envío: menor, Secondary */
.wd-drawer__total--ship {
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 400;
  color: var(--wd-text-color);
}

.wd-drawer__total--ship b {
  font-size: 14px;
  font-weight: 600;
  color: var(--wd-text-color);
}

/* fila de total: separa con línea y destaca */
.wd-drawer__total--grand {
  margin-bottom: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--wd-border);
  font-size: 16px;
}

.wd-drawer__total--grand b {
  font-size: 24px;
}

/* ======================================================================
   QUICK VIEW (modal rápido)
   ====================================================================== */

.wd-modal {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--wd-t), visibility var(--wd-t);
}

.wd-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.wd-modal__box {
  position: relative;
  width: min(940px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: #fff;
  border-radius: var(--wd-radius-lg);
  box-shadow: var(--wd-shadow-card);
  transform: translateY(18px) scale(0.98);
  transition: transform var(--wd-t);
}

.wd-modal.is-open .wd-modal__box {
  transform: translateY(0) scale(1);
}

.wd-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--wd-dark-2);
  transition: background var(--wd-t-fast), color var(--wd-t-fast);
}

.wd-modal__close:hover {
  background: var(--wd-primary-color);
  color: #fff;
}

.wd-modal__close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.wd-modal__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  padding: 34px;
}

@media (max-width: 760px) {
  .wd-modal__grid {
    grid-template-columns: 1fr;
    padding: 20px;
  }
}

.wd-modal__img {
  aspect-ratio: 1 / 1;
  border-radius: var(--wd-radius-lg);
  overflow: hidden;
  background: var(--wd-surface);
}

.wd-modal__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ======================================================================
   AVISO flotante (toast)
   ====================================================================== */

.wd-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 240;
  transform: translate(-50%, 20px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: var(--wd-radius);
  background: var(--wd-dark);
  color: #fff;
  font-size: 14px;
  box-shadow: var(--wd-shadow-card);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--wd-t), transform var(--wd-t), visibility var(--wd-t);
}

.wd-toast.is-open {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.wd-toast svg {
  width: 18px;
  height: 18px;
  stroke: var(--wd-success-color);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (max-width: 1024px) {
  .wd-toast {
    bottom: 82px;
  }
}
