/* =====================================
   MODAL DE INFORMACIÓN DEL PRODUCTO
===================================== */

body.product-detail-is-open {
  overflow: hidden;
}

.product-detail-overlay {
  position: fixed;
  inset: 0;
  z-index: 1450;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(11, 18, 32, 0.72);
  overflow-y: auto;
}

.product-detail-overlay.is-open {
  display: flex;
}

.product-detail-modal {
  position: relative;

  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;

  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.product-detail__close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;

  width: 42px;
  height: 42px;

  border: 0;
  border-radius: 50%;

  background: #f0f2f6;
  color: #1f2430;

  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.product-detail__layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.1fr);
  gap: 28px;

  padding: 30px;
}

.product-detail__media {
  display: flex;
  align-items: center;
  justify-content: center;

  min-height: 360px;

  border-radius: 18px;
  background: #f4f6f9;
}

.product-detail__media img {
  display: block;

  width: min(100%, 390px);
  max-height: 420px;

  object-fit: contain;
}

.product-detail__content {
  min-width: 0;
  padding: 10px 14px 8px 0;
}

.product-detail__category,
.product-detail__sku {
  margin: 0;

  color: #687282;
  font-size: 0.9rem;
}

.product-detail__title {
  margin: 8px 0 5px;

  font-family: "Poppins", sans-serif;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
  line-height: 1.15;
}

.product-detail__price {
  margin: 16px 0 3px;

  color: #15a344;
  font-size: 1.9rem;
  font-weight: 800;
}

.product-detail__regular-price,
.product-detail__savings {
  margin: 4px 0;
}

.product-detail__regular-price {
  color: #677181;
  text-decoration: line-through;
}

.product-detail__savings {
  color: #a4004d;
  font-weight: 800;
}

.product-detail__stock {
  display: inline-block;

  margin: 14px 0 0;
  padding: 7px 11px;

  border-radius: 999px;

  font-weight: 800;
}

.product-detail__stock.is-available {
  background: #daf5e3;
  color: #126a34;
}

.product-detail__stock.is-low-stock {
  background: #ffe7cd;
  color: #984300;
}

.product-detail__stock.is-out-of-stock {
  background: #f8dce4;
  color: #931832;
}

.product-detail__description {
  margin: 18px 0;

  color: #343b48;
  line-height: 1.65;
  white-space: pre-line;
}

.product-detail__section {
  margin-top: 18px;
  padding: 15px;

  border-radius: 14px;
  background: #f6f7fa;
}

.product-detail__section h4 {
  margin: 0 0 10px;
}

.product-detail__section p {
  margin: 0;
  line-height: 1.55;
}

.product-detail__components {
  display: grid;
  gap: 8px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.product-detail__components li {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.product-detail__actions {
  display: flex;
  align-items: center;
  gap: 12px;

  margin-top: 22px;
}

.product-detail__quantity {
  display: grid;
  grid-template-columns: 42px 62px 42px;

  overflow: hidden;

  border: 1px solid #c4cbd5;
  border-radius: 11px;
}

.product-detail__quantity button,
.product-detail__quantity input {
  min-height: 42px;

  border: 0;
  background: #ffffff;

  font: inherit;
  text-align: center;
}

.product-detail__quantity button {
  cursor: pointer;
  font-size: 1.25rem;
}

.product-detail__quantity button:hover:not(:disabled) {
  background: #edf0f5;
}

.product-detail__quantity input {
  width: 100%;
  border-left: 1px solid #d9dee6;
  border-right: 1px solid #d9dee6;
  appearance: textfield;
}

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

.product-detail__buy {
  flex: 1;

  min-height: 44px;

  border: 0;
  border-radius: 11px;

  padding: 11px 16px;

  background: #18a943;
  color: #ffffff;

  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.product-detail__buy:disabled,
.product-detail__quantity button:disabled,
.product-detail__quantity input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.flash__button__info {
  border: 0;
  border-radius: 9px;

  padding: 9px 12px;

  background: #f3f3fa;

  font: inherit;
  cursor: pointer;
}

@media (max-width: 760px) {
  .product-detail-overlay {
    align-items: stretch;
    padding: 0;
  }

  .product-detail-modal {
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }

  .product-detail__layout {
    grid-template-columns: 1fr;
    gap: 16px;

    padding: 62px 18px 26px;
  }

  .product-detail__media {
    min-height: 250px;
  }

  .product-detail__media img {
    max-height: 290px;
  }

  .product-detail__content {
    padding: 0;
  }

  .product-detail__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .product-detail__quantity {
    align-self: center;
  }

  .product-detail__buy {
    width: 100%;
  }
}
