/* Modal de producto — SHUEVO */
.product-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .35s ease, visibility .35s ease;
}

.product-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.product-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(43, 41, 36, 0.52);
  backdrop-filter: blur(4px);
}

.product-modal-panel {
  position: relative;
  z-index: 1;
  width: min(920px, 100%);
  max-height: min(90vh, 720px);
  overflow: auto;
  background: var(--sh-cream);
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(43, 41, 36, 0.2);
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: translateY(16px) scale(0.98);
  transition: transform .4s cubic-bezier(.22,1,.36,1);
}

.product-modal.is-open .product-modal-panel {
  transform: none;
}

.product-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,0.92);
  color: var(--sh-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.product-modal-close:hover {
  color: var(--sh-olive);
}

.product-modal-gallery {
  position: relative;
  background: #F7F1E9;
  border-radius: 24px 0 0 24px;
  min-height: 360px;
  display: flex;
  flex-direction: column;
}

.product-modal-gallery-main {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 28px 24px 12px;
  min-height: 300px;
}

.product-modal-gallery-main img {
  max-width: 100%;
  max-height: 340px;
  object-fit: contain;
}

.product-modal-track {
  display: none;
}

.product-modal-dots {
  display: none;
}

.product-modal-thumbs {
  display: flex;
  gap: 8px;
  justify-content: center;
  padding: 0 20px 20px;
}

.product-modal-thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid transparent;
  background: #fff;
  padding: 0;
  cursor: pointer;
  opacity: 0.65;
  transition: opacity .2s ease, border-color .2s ease;
}

.product-modal-thumb.is-active,
.product-modal-thumb:hover {
  opacity: 1;
  border-color: var(--sh-olive);
}

.product-modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-modal-body {
  padding: 36px 32px 28px;
  display: flex;
  flex-direction: column;
}

.product-modal-brand {
  margin: 0 0 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sh-gold);
}

.product-modal-pack {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sh-muted);
}

.product-modal-title {
  margin: 0 0 12px;
  font-family: var(--sh-sans);
  font-size: clamp(26px, 3vw, 34px);
  font-weight: 800;
  color: var(--sh-olive);
  line-height: 1.15;
}

.product-modal-price {
  margin: 0 0 16px;
  font-family: var(--sh-sans);
  font-size: 28px;
  font-weight: 800;
  color: var(--sh-ink);
}

.product-modal-desc {
  margin: 0 0 20px;
  color: var(--sh-muted);
  font-size: 14px;
  line-height: 1.7;
  flex: 1;
}

.product-modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: auto;
}

.product-modal-qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(76, 88, 47, 0.2);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.product-modal-qty button {
  width: 38px;
  height: 38px;
  border: 0;
  background: transparent;
  color: var(--sh-olive);
  font-size: 18px;
  cursor: pointer;
}

.product-modal-qty input {
  width: 44px;
  height: 38px;
  border: 0;
  text-align: center;
  font-family: var(--sh-sans);
  font-size: 16px;
  font-weight: 600;
  -moz-appearance: textfield;
  appearance: textfield;
}

.product-modal-qty input::-webkit-outer-spin-button,
.product-modal-qty input::-webkit-inner-spin-button {
  -webkit-appearance: none;
}

.product-modal-add {
  flex: 1;
}

body.modal-product-open {
  overflow: hidden;
}

@media (max-width: 800px) {
  .product-modal {
    padding: 28px 16px 16px;
    align-items: flex-end;
  }

  .product-modal-panel {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 56px);
    max-height: calc(100vh - 56px);
    width: 100%;
    border-radius: 24px 24px 0 0;
  }

  .product-modal-gallery {
    border-radius: 24px 24px 0 0;
    min-height: 0;
    overflow: hidden;
  }

  .product-modal-gallery-main {
    display: none;
  }

  .product-modal-thumbs {
    display: none;
  }

  .product-modal-track {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0;
  }

  .product-modal-track::-webkit-scrollbar {
    display: none;
  }

  .product-modal-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    display: block;
    aspect-ratio: 1 / 1;
    min-height: 0;
    height: auto;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    background: #F7F1E9;
  }

  .product-modal-slide img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    display: block;
  }

  .product-modal-dots {
    display: none;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 12px;
  }

  .product-modal-gallery.has-multi .product-modal-dots {
    display: flex;
  }

  .product-modal-dots button {
    width: 7px;
    height: 7px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    background: rgba(76, 88, 47, 0.22);
    cursor: pointer;
    transition: width .2s ease, background .2s ease;
  }

  .product-modal-dots button.is-active {
    width: 18px;
    background: var(--sh-olive);
  }

  .product-modal-body {
    padding: 18px 20px 20px;
  }

  .product-modal-brand {
    margin: 0 0 2px;
  }

  .product-modal-pack {
    margin: 0 0 6px;
  }

  .product-modal-title {
    margin: 0 0 8px;
    font-size: clamp(24px, 6vw, 30px);
  }

  .product-modal-price {
    margin: 0 0 10px;
    font-size: 24px;
  }

  .product-modal-desc {
    margin: 0 0 14px;
    line-height: 1.55;
  }
}
