/* =========================================================
   MODAL.CSS — property detail overlay, gallery, specs, side cards
   ========================================================= */

.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(8,24,22,.55); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); display: none; padding: 28px 18px; overflow-y: auto; }
.overlay.open { display: block; animation: fade .2s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

.modal { max-width: 980px; margin: 0 auto; background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 24px 60px rgba(10,30,28,.22); animation: rise .28s cubic-bezier(.2,.9,.3,1); }
@keyframes rise { from { opacity: 0; transform: translateY(22px) scale(.985); } to { opacity: 1; transform: none; } }

.gallery { position: relative; background: #dfe9e7; }
.gallery-main { aspect-ratio: 16 / 8.4; overflow: hidden; background: linear-gradient(140deg, #dfe9e7, #c6d6d3); }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { position: absolute; bottom: 14px; left: 14px; display: flex; gap: 8px; }
.gallery-thumbs button { width: 62px; height: 46px; border-radius: 9px; overflow: hidden; border: 2px solid rgba(255,255,255,.65); transition: .15s; background: #c6d6d3; padding: 0; }
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button:hover { border-color: #fff; transform: translateY(-2px); }
.gallery-thumbs button.active { border-color: #fff; box-shadow: 0 0 0 2px var(--accent, #0d7a6b); }

.modal-close { position: absolute; top: 14px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.94); display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.2); transition: .15s; z-index: 2; }
.modal-close:hover { background: #fff; transform: rotate(90deg); }
.modal-close svg { width: 17px; height: 17px; stroke-width: 2.4; }

.modal-share { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 11px; background: rgba(255,255,255,.94); box-shadow: 0 4px 14px rgba(0,0,0,.2); font-weight: 600; font-size: 13px; color: var(--ink, #0e1a1a); transition: .15s; z-index: 2; }
.modal-share:hover { background: #fff; }
.modal-share svg { width: 15px; height: 15px; }
.modal-share.copied { background: var(--accent, #0d7a6b); color: #fff; }

.modal-body { padding: 26px 30px 30px; }
.modal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap; }
.modal-price { font-size: 31px; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; color: var(--ink, #0e1a1a); }
.modal-badges { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.modal-badges .badge { box-shadow: none; backdrop-filter: none; }
.modal-badges .badge-new  { background: var(--accent-soft, #e6f2f0); color: var(--accent-dark, #095c50); }
.modal-badges .badge-open { background: #fff5e6; color: #8a4b00; }
.modal-badges .badge-drop { background: #fff1ec; color: var(--danger, #c2410c); }
.modal-addr { color: var(--muted, #6b7b7a); font-size: 14.5px; margin-top: 4px; line-height: 1.5; }
.modal-actions { display: flex; gap: 8px; flex-shrink: 0; }
.modal-fav { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 11px; border: 1px solid var(--line, #e3e8e7); font-weight: 600; font-size: 13.5px; color: var(--ink, #0e1a1a); transition: .15s; background: #fff; cursor: pointer; }
.modal-fav:hover { border-color: #c9d6d4; background: #fafcfb; }
.modal-fav svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; color: #8d9c9a; }
.modal-fav.saved { background: #fff1f4; border-color: #f8d3da; color: #c02b48; }
.modal-fav.saved svg { fill: #e0526b; stroke: #e0526b; }

.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(108px, 1fr)); gap: 2px; margin: 24px 0; background: #f2f6f5; border-radius: 14px; overflow: hidden; }
.spec { background: #fff; padding: 15px 16px; }
.spec .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted, #6b7b7a); font-weight: 650; margin-bottom: 4px; }
.spec .v { font-size: 16px; font-weight: 700; letter-spacing: -.015em; color: var(--ink, #0e1a1a); }

.modal-grid { display: grid; grid-template-columns: 1fr 300px; gap: 32px; margin-top: 6px; }
.modal h4 { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted, #6b7b7a); }
.desc { font-size: 14.5px; line-height: 1.72; color: var(--ink-2, #3d4d4c); margin: 0 0 26px; }

.features { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.feature { padding: 7px 13px; border-radius: 9px; background: #f4f8f7; border: 1px solid #e8efee; font-size: 13px; font-weight: 500; color: var(--ink-2, #3d4d4c); }

.side-card { background: #f8fbfa; border: 1px solid var(--line, #e3e8e7); border-radius: 15px; padding: 18px; margin-bottom: 16px; }
.side-card h4 { margin-bottom: 14px; }
.mortgage-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--ink, #0e1a1a); }
.mortgage-value small { font-size: 13px; font-weight: 600; color: var(--muted, #6b7b7a); letter-spacing: 0; }
.mortgage-note { font-size: 12px; color: var(--muted, #6b7b7a); margin-top: 8px; line-height: 1.5; }
.dp-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.dp-row label { font-size: 13px; font-weight: 600; color: var(--ink-2, #3d4d4c); }
.dp-row select { padding: 8px 28px 8px 11px; border: 1px solid var(--line, #e3e8e7); border-radius: 9px; background: #fff; font-weight: 600; font-size: 13px; color: var(--ink, #0e1a1a); outline: 0; appearance: none; -webkit-appearance: none; cursor: pointer; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7b7a' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; }

.agent { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex-shrink: 0; background: linear-gradient(145deg, var(--accent, #0d7a6b), #12a08c); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 16px; }
.agent-name { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; color: var(--ink, #0e1a1a); }
.agent-role { font-size: 12.5px; color: var(--muted, #6b7b7a); }
.side-card .btn-primary { width: 100%; text-align: center; padding: 12px; display: block; }

/* MAP */
.modal-map { position: relative; border-radius: 14px; overflow: hidden; margin: 22px 0; background: #dfe9e7; aspect-ratio: 16 / 7; border: 1px solid var(--line, #e3e8e7); }
.modal-map iframe { width: 100%; height: 100%; border: 0; display: block; }
.modal-map-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; z-index: 2; }
.modal-map-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.96); border: 1px solid #e3e8e7; color: var(--ink, #0e1a1a); padding: 8px 12px; border-radius: 9px; font-size: 12.5px; font-weight: 600; box-shadow: 0 4px 12px rgba(0,0,0,.12); transition: .15s; cursor: pointer; text-decoration: none; }
.modal-map-btn:hover { background: #fff; border-color: var(--accent, #0d7a6b); color: var(--accent, #0d7a6b); }
.modal-map-btn svg { width: 14px; height: 14px; }

/* NEARBY */
.nearby { margin: 26px 0; }
.nearby h4 { margin-bottom: 12px !important; }
.nearby-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.nearby-card { border: 1px solid var(--line, #e3e8e7); border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; transition: .15s; text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.nearby-card:hover { border-color: var(--accent, #0d7a6b); box-shadow: 0 4px 14px rgba(13,122,107,.15); transform: translateY(-2px); }
.nearby-thumb { aspect-ratio: 4 / 3; overflow: hidden; background: linear-gradient(140deg, #dfe9e7, #c6d6d3); }
.nearby-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.nearby-card:hover .nearby-thumb img { transform: scale(1.06); }
.nearby-body { padding: 9px 11px 11px; }
.nearby-price { font-size: 14px; font-weight: 800; letter-spacing: -.02em; color: var(--ink, #0e1a1a); margin-bottom: 2px; }
.nearby-meta { font-size: 11.5px; color: var(--muted, #6b7b7a); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FEATURE RATINGS */
.features-rating { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.feature-row { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line, #e3e8e7); border-radius: 10px; background: #fff; transition: .15s; }
.feature-row:hover { border-color: #d5e0de; background: #fafcfb; }
.feature-row.checked { border-color: var(--accent, #0d7a6b); background: var(--accent-soft, #e6f2f0); }
.feature-row input[type="checkbox"] { appearance: none; -webkit-appearance: none; width: 16px; height: 16px; border: 1.5px solid #c8d4d2; border-radius: 4px; margin: 0; flex-shrink: 0; cursor: pointer; position: relative; transition: .15s; }
.feature-row input[type="checkbox"]:checked { background: var(--accent, #0d7a6b); border-color: var(--accent, #0d7a6b); }
.feature-row input[type="checkbox"]:checked::after { content: ''; position: absolute; left: 4.5px; top: 1px; width: 5px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0; transform: rotate(45deg); }
.feature-name { font-size: 12.5px; font-weight: 500; color: var(--ink-2, #3d4d4c); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feature-rating { display: flex; gap: 1px; flex-shrink: 0; }
.feature-star { width: 16px; height: 16px; background: none; border: 0; padding: 0; cursor: pointer; color: #d5e0de; transition: .12s; }
.feature-star svg { width: 16px; height: 16px; fill: currentColor; }
.feature-star.on { color: #f5b400; }

/* CONTACT FORM */
.contact-agent-form { background: #f8fbfa; border: 1px solid var(--line, #e3e8e7); border-radius: 14px; padding: 22px; margin-top: 26px; }
.contact-agent-form h4 { margin-bottom: 6px; }
.contact-agent-form .form-intro { font-size: 13px; color: var(--muted, #6b7b7a); line-height: 1.55; margin-bottom: 16px; }
.contact-agent-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.contact-agent-form label { display: grid; gap: 5px; }
.contact-agent-form label span { font-size: 11.5px; font-weight: 600; color: var(--ink-2, #3d4d4c); }
.contact-agent-form input,
.contact-agent-form textarea { padding: 10px 13px; border: 1px solid var(--line, #e3e8e7); border-radius: 9px; font-size: 13.5px; color: var(--ink, #0e1a1a); background: #fff; outline: 0; transition: .15s; font-family: inherit; }
.contact-agent-form input:focus,
.contact-agent-form textarea:focus { border-color: var(--accent, #0d7a6b); box-shadow: 0 0 0 3px rgba(13,122,107,.12); }
.contact-agent-form textarea { min-height: 90px; resize: vertical; line-height: 1.55; font-family: inherit; }
.contact-agent-form .form-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.contact-agent-form button { background: var(--accent, #0d7a6b); color: #fff; padding: 12px 22px; border-radius: 10px; font-size: 13.5px; font-weight: 700; border: 0; cursor: pointer; transition: .15s; }
.contact-agent-form button:hover { background: var(--accent-dark, #095c50); }
.contact-agent-form .form-success { background: #e6f2f0; color: var(--accent-dark, #095c50); padding: 12px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-top: 12px; display: none; }
.contact-agent-form .form-success.show { display: block; }

@media (max-width: 1040px) {
  .modal-grid { grid-template-columns: 1fr; gap: 24px; }
}
@media (max-width: 640px) {
  .modal-body { padding: 20px 18px 24px; }
  .modal-price { font-size: 26px; }
  .gallery-thumbs button { width: 50px; height: 38px; }
  .nearby-grid { grid-template-columns: 1fr 1fr; }
  .nearby-grid .nearby-card:nth-child(3) { display: none; }
  .features-rating { grid-template-columns: 1fr; }
  .contact-agent-form .form-grid { grid-template-columns: 1fr; }
  .modal-map { aspect-ratio: 4 / 3; }
}
/* GALLERY GRID — 1 big LEFT (60×50) + 2 stacked RIGHT (30×25) */
.gallery-grid {
  display: grid;
  grid-template-columns: 60fr 40fr;   /* left 60%, right 40% */
  grid-template-rows: 1fr;
  gap: 4px;
  aspect-ratio: 16 / 8.4;
  background: #dfe9e7;
}
.gallery-cell {
  position: relative;
  overflow: hidden;
  background: #c6d6d3;
  cursor: pointer;
}
.gallery-cell.big {
  /* Big image on the left — 60% width, full height */
}
.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.gallery-cell:hover img {
  opacity: .9;
  transform: scale(1.02);
}
.gallery-col {
  display: grid;
  grid-template-rows: 1fr 1fr;  /* 2 stacked images = 50/50 vertical */
  gap: 4px;
}
.gallery-more {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(0,0,0,.75);
  color: #fff;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: .15s;
}
.gallery-more:hover {
  background: rgba(0,0,0,.9);
}

/* Mobile: stack all images vertically */
@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    aspect-ratio: auto;
  }
  .gallery-cell.big {
    aspect-ratio: 4 / 3;
  }
  .gallery-col {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr;
  }
  .gallery-cell.small {
    aspect-ratio: 4 / 3;
  }
}

/* LIGHTBOX */
.gallery-lightbox { display: none; position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.92); align-items: center; justify-content: center; }
.gallery-lightbox.open { display: flex; }
.gallery-lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.lightbox-close, .lightbox-nav { position: absolute; width: 50px; height: 50px; border-radius: 50%; background: rgba(255,255,255,.9); border: 0; font-size: 26px; cursor: pointer; color: #000; }
.lightbox-close { top: 20px; right: 20px; font-size: 20px; }
.lightbox-nav.prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lightbox-nav.next { right: 20px; top: 50%; transform: translateY(-50%); }

/* MAP + CONTACT ROW */
.map-contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 24px 0; align-items: stretch; }
.map-contact-row .modal-map { margin: 0; aspect-ratio: auto; min-height: 320px; }
.contact-agent-form { background: #f8fbfa; border: 1px solid var(--line); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; }
.contact-agent-form h4 { margin-bottom: 12px; }
.contact-agent-form form { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.contact-agent-form label { display: grid; gap: 4px; }
.contact-agent-form label span { font-size: 11.5px; font-weight: 600; color: var(--ink-2); }
.contact-agent-form input, .contact-agent-form textarea { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; font-family: inherit; outline: 0; }
.contact-agent-form textarea { min-height: 70px; resize: vertical; }
.contact-agent-form button { background: var(--accent); color: #fff; padding: 11px; border-radius: 9px; font-weight: 700; font-size: 13px; border: 0; cursor: pointer; margin-top: auto; }
.contact-agent-form .form-success { background: #e6f2f0; color: var(--accent-dark); padding: 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; margin-top: 8px; display: none; }
.contact-agent-form .form-success.show { display: block; }
@media (max-width: 720px) { .map-contact-row { grid-template-columns: 1fr; } }

/* STATS BAR */
.prop-stats { display: flex; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 14px 0; }
.prop-stat { display: flex; flex-direction: column; }
.prop-stat strong { font-size: 18px; font-weight: 800; color: var(--ink); letter-spacing: -.02em; }
.prop-stat span { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* DESCRIPTION SHOW MORE */
.desc-wrap { margin-bottom: 24px; }
.desc.collapsed { display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { background: none; border: 0; color: var(--accent); font-weight: 600; font-size: 13px; cursor: pointer; padding: 0; margin-top: 6px; }
.desc-toggle:hover { text-decoration: underline; }

/* PRICE DROP BADGE */
.price-drop-badge { background: #fff1ec; color: #c2410c; font-size: 14px; font-weight: 800; padding: 3px 10px; border-radius: 8px; margin-left: 8px; vertical-align: middle; }

/* AGENT CARD extra info */
.agent-company { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.agent-contact { font-size: 11.5px; color: var(--ink-2); margin-top: 3px; }
/* =========================================================
   GALLERY — 2 top + 3 bottom
   ========================================================= */
.gallery-grid {
  display: flex;
  flex-direction: column;
  gap: 4px;
  aspect-ratio: 16 / 8.4;
  background: #dfe9e7;
}
.gallery-row {
  display: grid;
  gap: 4px;
}
.gallery-row.top {
  grid-template-columns: 1fr 1fr;
  flex: 55 1 0;
  min-height: 0;
}
.gallery-row.bottom {
  grid-template-columns: 1fr 1fr 1fr;
  flex: 45 1 0;
  min-height: 0;
}
.gallery-cell {
  position: relative;
  overflow: hidden;
  background: #c6d6d3;
  cursor: pointer;
  min-height: 0;
}
.gallery-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.gallery-cell:hover img {
  transform: scale(1.03);
}
.gallery-more {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,.78);
  color: #fff;
  border: 0;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  z-index: 2;
}
.gallery-more:hover { background: rgba(0,0,0,.95); }
.gallery-counter {
  position: absolute;
  top: 14px;
  right: 60px;
  background: rgba(0,0,0,.7);
  color: #fff;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
}

@media (max-width: 640px) {
  .gallery-grid { aspect-ratio: auto; }
  .gallery-row.top .gallery-cell { aspect-ratio: 4/3; }
  .gallery-row.bottom .gallery-cell { aspect-ratio: 1/1; }
}

/* =========================================================
   GALLERY VARIANTS
   ========================================================= */

/* If only 1 photo: full width single image */
.gallery-grid[data-count="1"] .gallery-row.top { grid-template-columns: 1fr; }
.gallery-grid[data-count="1"] .gallery-row.bottom { display: none; }

/* If 2 photos: 2 equal columns */
.gallery-grid[data-count="2"] .gallery-row.bottom { display: none; }

/* If 3 photos: 1 big + 2 stacked (classic) */
.gallery-grid[data-count="3"] .gallery-row.top { grid-template-columns: 1fr 1fr; }
.gallery-grid[data-count="3"] .gallery-row.bottom { display: none; }

/* If 4 photos: 2 top + 2 bottom */
.gallery-grid[data-count="4"] .gallery-row.bottom { grid-template-columns: 1fr 1fr; }

/* 5+ photos: 2 top + 3 bottom (already default) */

/* =========================================================
   DESCRIPTION STYLING — better readability
   ========================================================= */
.desc-wrap {
  position: relative;
  margin-bottom: 28px;
}
.desc {
  font-size: 15px;
  line-height: 1.75;
  color: #3d4d4c;
  margin: 0;
  letter-spacing: -.005em;
}
.desc.collapsed {
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}
.desc.collapsed::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to bottom, transparent, #fff);
  pointer-events: none;
}
.desc-toggle {
  display: inline-block;
  background: none;
  border: 0;
  color: var(--accent, #0d7a6b);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  padding: 6px 0;
  margin-top: 10px;
  border-bottom: 1px solid transparent;
  transition: .15s;
}
.desc-toggle:hover {
  border-bottom-color: var(--accent, #0d7a6b);
}

/* =========================================================
   FEATURES — better spacing
   ========================================================= */
.features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.feature {
  padding: 8px 14px;
  border-radius: 10px;
  background: #f4f8f7;
  border: 1px solid #e8efee;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2, #3d4d4c);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.feature::before {
  content: '✓';
  color: var(--accent, #0d7a6b);
  font-weight: 800;
  font-size: 11px;
}

/* ============================================================
   MODAL GALLERY FIX — prevent image overflow on mobile
   Applies at all widths, critical below 900px
   ============================================================ */
.gallery {
  overflow: hidden !important;
  position: relative;
  isolation: isolate;
}
.gallery-grid {
  overflow: hidden !important;
}
.gallery-row {
  overflow: hidden;
}
.gallery-cell {
  overflow: hidden;
  position: relative;
}
.gallery-cell img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-more {
  pointer-events: auto;
}

/* Mobile: make the gallery square, not 16/8.4 (which is too short for 2+3 stack) */
@media (max-width: 900px) {
  .gallery-grid {
    aspect-ratio: 1 / 1 !important;
  }
}
@media (max-width: 640px) {
  .gallery-grid {
    aspect-ratio: 4 / 3 !important;
  }
  .modal-body {
    position: relative;
    z-index: 2;
    background: #fff;
    margin-top: 0;
  }
  .modal-top {
    position: relative;
    z-index: 2;
  }
  .modal-price {
    position: relative;
    z-index: 2;
  }
}