/* GoMonte property detail — small overrides on top of Tailwind. */

/* Amenity chip icons can grow slightly larger than text. */
.amenity-icon { font-size: 1.1em; }

/* Lightbox image transitions in subtly. */
#gallery-lightbox img { transition: opacity 0.15s ease; }

/* Map tile container needs explicit height (Tailwind h-96 already does it,
   but Leaflet sometimes complains without an inline cue). */
#property-map { z-index: 0; }

/* POI section */
.poi-chip { transition: background-color 0.15s ease; }
.poi-item.poi-active { background: #fce7f3; border-color: #fbcfe8; }

/* Lightbox iframe needs explicit background so vertical videos look intentional. */
#gallery-lightbox iframe { background: #000; }

/* Map markers — distinct shapes for the property vs POIs. The property
   uses a clean solid pink teardrop (Google-Maps-style — the shape says
   "this is the place"); POIs use a smaller flat circle with a category
   emoji (says "nearby"). The teardrop's tip is anchored at lat/lng. */
.gm-marker-pin {
  width: 22px;
  height: 32px;
  background: #d4145a;
  /* Inverted teardrop: round top, pointed bottom. Built via clip-path so
     the inner dot stays upright (no rotate-and-counter-rotate kludge). */
  clip-path: path('M 11 0 C 4.92 0 0 4.92 0 11 C 0 19.25 11 32 11 32 C 11 32 22 19.25 22 11 C 22 4.92 17.08 0 11 0 Z');
  position: relative;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
.gm-marker-pin::after {
  content: "";
  position: absolute;
  top: 7px;
  left: 7px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}
.gm-marker-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  line-height: 1;
  border: 2px solid white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Mobile photo carousel (≤768px) ─────────────────────────────────
   On mobile we override the grid layout so the gallery becomes a
   horizontal-swipe strip (scroll-snap). Each photo fills the viewport
   width; counter updates via property.js on scroll. */
@media (max-width: 768px) {
  #gallery {
    display: flex !important;
    grid-template-columns: none !important;
    gap: 0 !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    border-radius: 0;
    margin-left: -1rem; margin-right: -1rem; /* break out of px-4 padding */
  }
  #gallery::-webkit-scrollbar { display: none; }
  #gallery > a:not(.gm-back-floating):not(.gm-photo-count) {
    flex: 0 0 100%;
    scroll-snap-align: start;
    aspect-ratio: 4 / 3 !important;
    margin: 0;
    border-radius: 0 !important;
  }
  #gallery > a img { width: 100%; height: 100%; object-fit: cover; }
  /* Hide the desktop "All N items" overlay anchor on mobile — the
     counter takes its place. (It's already inside #gallery as an
     absolute pill so we just hide it.) */
  #gallery > a[class*="bottom-4"][class*="right-4"] { display: none; }
  .gm-photo-count {
    position: absolute;
    bottom: 12px; right: 12px;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    pointer-events: none;
  }
}

/* ── Contact action-sheet (mobile primary, desktop modal) ─────────────
   The sticky "Contact" button opens this sheet so the visitor picks a
   channel rather than landing in WhatsApp by default. Three buttons
   inside use .gm-btn class so the existing intent-enrichment script
   (which rewrites a.gm-btn[href*="wa.me"]) keeps working. */
.gm-contact-sheet { position: fixed; inset: 0; z-index: 100; display: none; }
.gm-contact-sheet[data-open] { display: block; }
.gm-contact-sheet-backdrop {
  position: absolute; inset: 0; background: rgba(15, 23, 42, 0.55);
  animation: gm-cs-fade .15s ease;
}
.gm-contact-sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: #fff; border-top-left-radius: 16px; border-top-right-radius: 16px;
  padding: 18px 18px 28px;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  animation: gm-cs-slide .2s ease;
}
@media (min-width: 769px) {
  .gm-contact-sheet-body {
    left: 50%; right: auto; bottom: 50%;
    transform: translate(-50%, 50%);
    width: min(420px, calc(100vw - 32px));
    border-radius: 16px;
    padding: 24px;
  }
}
.gm-contact-sheet-body h3 {
  font-size: 16px; font-weight: 600; color: #111;
  margin: 0 0 16px;
}
.gm-contact-sheet-close {
  position: absolute; top: 12px; right: 12px;
  width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: #f3f4f6; color: #111;
  font-size: 18px; cursor: pointer;
}
.gm-contact-sheet a {
  display: flex; align-items: center; gap: 10px;
  width: 100%; margin-top: 10px;
  padding: 14px 16px; border-radius: 12px;
  font-weight: 600; text-decoration: none;
  font-size: 15px;
}
.gm-contact-sheet a:first-of-type { margin-top: 0; }
.gm-contact-sheet a.cs-wa { background: #16a34a; color: #fff; }
.gm-contact-sheet a.cs-vb { background: #7c3aed; color: #fff; }
.gm-contact-sheet a.cs-em { background: #fff; color: #111; border: 1px solid #d1d5db; }
@keyframes gm-cs-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gm-cs-slide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Mobile-only chrome (≤768px) ──────────────────────────────────────
   Airbnb-style: floating back arrow over the hero, sticky bottom CTA
   that's always visible regardless of scroll. */
@media (max-width: 768px) {
  .gm-back-floating {
    position: absolute;
    top: 16px; left: 16px; z-index: 10;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    color: #111;
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
    transition: background 0.12s;
  }
  .gm-back-floating:hover { background: #fff; }

  .gm-sticky-cta {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    padding: 10px 14px;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
  }
  .gm-sticky-cta .gm-sticky-price { flex: 0 0 auto; line-height: 1.2; min-width: 0; }
  .gm-sticky-cta .gm-sticky-price .amount {
    font-size: 17px; font-weight: 700; color: #db2777;
    white-space: nowrap;
  }
  .gm-sticky-cta .gm-sticky-price .label {
    font-size: 10px; color: #6b7280; text-transform: uppercase;
    letter-spacing: 0.4px;
  }
  .gm-sticky-cta a.gm-sticky-cta-btn {
    flex: 1 1 auto;
    padding: 12px 14px;
    border-radius: 8px;
    background: #16a34a;
    color: #fff;
    text-align: center;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .gm-sticky-cta a.gm-sticky-cta-btn:hover { background: #15803d; }

  /* Reserve room at the bottom so the sticky CTA doesn't cover the last
     row of the footer. 64px = sticky bar height + breathing room. */
  body { padding-bottom: 72px; }
}
@media (min-width: 769px) {
  .gm-back-floating, .gm-sticky-cta { display: none; }
}
