dialog {
  width: 1100px;
  padding: 48px 32px;
  overscroll-behavior: contain;
}
.detail-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 44px;
}
.detail-grid h2 {
  font-size: 23px;
  margin: 0 0 12px;
  text-transform: uppercase;
  line-height: 1.3;
}
.detail-grid .product-photo {
  background: white;
  aspect-ratio: 3/4;
}
.detail-grid .product-photo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.product-photo:has(img) {
  background: white;
}
.product img {
  object-fit: contain;
}
.stock {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
}
.stock span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #299849;
}
.stock.sold span {
  background: #c83d3d;
}
.size-picker {
  border: 0;
  padding: 0;
  margin: 25px 0 16px;
  display: flex;
  gap: 9px;
}
.size-picker legend {
  margin-bottom: 12px;
  font-size: 12px;
}
.size-picker button {
  flex: 1;
  min-height: 44px;
  background: white;
  border: 1px solid #ddd;
  border-radius: 5px;
  color: #171717;
}
.size-picker button[aria-pressed="true"],
.views button[aria-pressed="true"] {
  border-color: #171717;
  background: #f3f3f3;
}
#size-measures {
  padding: 15px;
  background: #f8f8f8;
  min-height: 190px;
}
#size-measures p {
  font-size: 12px;
  margin: 0 0 12px;
}
#size-measures dl {
  margin: 0;
}
#size-measures dl div {
  display: flex;
  justify-content: space-between;
  padding: 5px 0;
  font-size: 12px;
}
#size-measures dd {
  margin: 0;
}
#size-measures small {
  display: block;
  font-size: 11px;
  line-height: 1.6;
  margin-top: 10px;
}
.detail-grid .cta {
  margin: 20px 0 9px;
  font-size: 12px;
  line-height: 1.5;
}
.views button {
  min-height: 44px;
  flex: 1;
}
@media (max-width: 650px) {
  dialog {
    padding: 45px 18px 24px;
    max-width: 100%;
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
  }
  .detail-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 25px;
  }
  .detail-grid .product-photo {
    aspect-ratio: 3/4;
    max-height: 65dvh;
  }
  .detail-grid h2 {
    font-size: 21px;
  }
}

/* GALERÍAS DEL CATÁLOGO Y DE LA FICHA */
.product {
  min-width: 0;
}
.product-name {
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.gallery {
  position: relative;
  min-width: 0;
  background: #f8f8f6;
}
.gallery-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  aspect-ratio: 3 / 4;
  cursor: grab;
}
.gallery-track::-webkit-scrollbar {
  display: none;
}
.gallery-track.dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}
.gallery-slide {
  position: relative;
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: grid;
  place-items: center;
  user-select: none;
  cursor: inherit;
}
.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: absolute;
  inset: 0;
  user-select: none;
  -webkit-user-drag: none;
}
.gallery-slide img[hidden],
.gallery-placeholder[hidden] {
  display: none;
}
.gallery-placeholder {
  color: #777;
  font-size: 11px;
}
.gallery .badge {
  pointer-events: none;
  background: #ffffffd9;
  padding: 5px;
}
.gallery-counter {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffffdf;
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  pointer-events: none;
}
.gallery-arrow {
  position: absolute;
  top: 35%;
  height: 30%;
  width: 18%;
  min-width: 44px;
  border: 0;
  padding: 0;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.gallery-arrow.previous {
  left: 0;
}
.gallery-arrow.next {
  right: 0;
}
.gallery-arrow span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 44px;
  background: #ffffffa6;
  backdrop-filter: blur(6px);
  border-radius: 22px;
  font-size: 32px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s;
}
.gallery:hover .gallery-arrow span,
.gallery-arrow:hover span,
.gallery-arrow:focus-visible span {
  opacity: 1;
}
.gallery-arrow:disabled {
  visibility: hidden;
}
.gallery-track:focus-visible,
.gallery-slide:focus-visible,
.product-name:focus-visible,
.size-picker button:focus-visible {
  outline: 2px solid #171717;
  outline-offset: -3px;
}
@media (hover: none) and (pointer: coarse) {
  .gallery-arrow {
    display: none;
  }
}

/* DISPONIBILIDAD INDIVIDUAL POR TALLA */
.size-picker {
  flex-wrap: wrap;
}
.size-picker button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  cursor: pointer;
}

.size-picker .size-available {
  border-color: #ddd;
}
.size-picker .size-sold {
  color: #757575;
  background: #f3f3f3;
}
.size-sold .size-label {
  text-decoration: line-through;
}
.size-picker button[aria-pressed="true"] {
  border: 2px solid #171717;
}
@media (max-width: 650px) {
  #detail-gallery .gallery-track {
    max-height: 65dvh;
  }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-arrow span {
    transition: none;
  }
}
