/* ─────────────────────────────────────────────
   MODAL — Detalle de obra
───────────────────────────────────────────── */

#modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 800;
  background: rgba(14, 14, 14, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 3vw, 2rem);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: opacity 0.35s var(--ease-out);
}

#modal-overlay.is-open {
  opacity: 1;
  pointer-events: all;
}

/* ── Caja modal ── */
#modal-box {
  background: var(--white);
  width: 100%;
  max-width: 960px;
  max-height: 90svh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  position: relative;
  transform: translateY(30px) scale(0.97);
  transition: transform 0.45s var(--ease-expo);
  overscroll-behavior: contain;
}

#modal-overlay.is-open #modal-box {
  transform: translateY(0) scale(1);
}

/* scrollbar dentro del modal */
#modal-box::-webkit-scrollbar { width: 3px; }
#modal-box::-webkit-scrollbar-thumb { background: var(--border-med); }

/* ── Imagen ── */
#modal-img-wrap {
  background: var(--bg-alt1);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(2rem, 5vw, 3.5rem);
  min-height: clamp(300px, 50vw, 520px);
  position: sticky;
  top: 0;
  align-self: start;
}

#modal-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
  max-height: 70svh;
  transform: scale(0.95);
  transition: transform 0.45s var(--ease-expo) 0.1s;
}

#modal-overlay.is-open #modal-img {
  transform: scale(1);
}

/* ── Info ── */
#modal-info {
  padding: clamp(2rem, 4vw, 3rem) clamp(1.5rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.5rem);
}

#modal-tag {
  /* usa clase .label */
}

#modal-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--black);
}

#modal-medium {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.1vw, 0.7rem);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -0.25rem;
}

#modal-desc {
  font-size: clamp(0.82rem, 1.5vw, 0.92rem);
  color: var(--muted);
  line-height: 1.8;
}

/* ── Tabla de detalles ── */
.modal-details {
  border-top: 1px solid var(--border);
  padding-top: clamp(0.75rem, 2vw, 1rem);
}

.modal-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: clamp(0.4rem, 1vw, 0.6rem) 0;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.modal-detail-row:last-child {
  border-bottom: none;
}

.modal-detail-row__label {
  font-family: var(--mono);
  font-size: clamp(0.5rem, 0.9vw, 0.58rem);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted-light);
  flex-shrink: 0;
}

.modal-detail-row__value {
  font-size: clamp(0.75rem, 1.4vw, 0.85rem);
  font-weight: 500;
  color: var(--black);
  text-align: right;
}

/* ── Botón WhatsApp ── */
#modal-wa-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--black);
  color: var(--white);
  padding: clamp(0.9rem, 2.5vw, 1.15rem) clamp(1.25rem, 3vw, 1.75rem);
  text-decoration: none;
  transition: background 0.3s;
  cursor: none;
  margin-top: auto;
  gap: 1rem;
}

#modal-wa-btn:hover {
  background: var(--red);
}

.modal-wa-btn__text {
  font-family: var(--mono);
  font-size: clamp(0.6rem, 1.1vw, 0.7rem);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1.3;
}

.modal-wa-btn__icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  fill: white;
}

/* ── Botón cerrar ── */
#modal-close {
  position: absolute;
  top: clamp(0.6rem, 1.5vw, 1rem);
  right: clamp(0.6rem, 1.5vw, 1rem);
  width: 36px;
  height: 36px;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: background 0.25s;
  z-index: 10;
  cursor: none;
  border: none;
}

#modal-close:hover {
  background: var(--red);
}