/* ==========================================================
   PROPERTY DETAILS PAGE
========================================================== */
body{ padding-bottom:150px; background:var(--bg-light); }

.detail-topbar{
  position:sticky; top:0; z-index:40;
  display:flex; align-items:center; justify-content:space-between;
  padding:14px 16px;
  background:var(--navy-deep);
}
.back-btn, .topbar-fav{
  width:38px; height:38px;
  border-radius:50%;
  background:rgba(255,255,255,0.08);
  border:none;
  display:flex; align-items:center; justify-content:center;
  touch-action:manipulation;
}
.topbar-fav.active svg path{ fill:var(--burgundy); stroke:var(--burgundy); }
.detail-topbar-title{ color:var(--white); font-family:var(--font-head); font-weight:700; font-size:15px; }

.detail-loading{ padding:60px 20px; text-align:center; color:var(--text-muted); }

/* Gallery */
.gallery{ position:relative; }
.gallery-main{
  position:relative;
  width:100%;
  padding-top:75%;
  overflow:hidden;
  background:#0B1935;
}
.gallery-main img{
  position:absolute; inset:0;
  width:100%; height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity .3s ease;
}
.gallery-main img.active{ opacity:1; }
.gallery-count{
  position:absolute; bottom:14px; right:14px;
  background:rgba(7,21,47,0.72);
  color:var(--white);
  font-size:12.5px; font-weight:700;
  padding:6px 12px;
  border-radius:20px;
  backdrop-filter:blur(4px);
}
.gallery-thumbs{
  display:flex; gap:8px;
  padding:12px 16px;
  overflow-x:auto;
  scrollbar-width:none;
  background:var(--white);
}
.gallery-thumbs::-webkit-scrollbar{ display:none; }
.gallery-thumb{
  flex:0 0 62px;
  height:52px;
  border-radius:8px;
  overflow:hidden;
  border:2px solid transparent;
  opacity:0.6;
  transition:opacity .15s ease, border-color .15s ease;
}
.gallery-thumb img{ width:100%; height:100%; object-fit:cover; }
.gallery-thumb.active{ border-color:var(--gold); opacity:1; }

/* Header block */
.detail-header{ padding:18px 18px 6px; background:var(--white); }
.detail-badges{ display:flex; gap:8px; margin-bottom:10px; }
.badge{
  font-size:11.5px; font-weight:700;
  padding:5px 11px;
  border-radius:6px;
  letter-spacing:0.3px;
}
.badge.status{ background:var(--navy-deep); color:var(--white); }
.badge.type{ background:rgba(242,181,43,0.14); color:var(--gold-dark); }
.detail-header h1{ font-size:21px; font-weight:800; line-height:1.28; margin-bottom:8px; }
.detail-loc{ display:flex; align-items:center; gap:6px; color:var(--text-muted); font-size:13.5px; margin-bottom:12px; }
.detail-price{ font-family:var(--font-head); font-weight:800; font-size:24px; color:var(--gold-dark); }
.detail-price .per{ font-size:13px; font-weight:600; color:var(--text-muted); }

/* Info card */
.info-card{
  margin:16px 18px 0;
  background:var(--white);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  display:flex;
  box-shadow:var(--shadow-card);
  overflow:hidden;
}
.info-cell{
  flex:1;
  text-align:center;
  padding:16px 6px;
  border-right:1px solid var(--border);
}
.info-cell:last-child{ border-right:none; }
.info-cell .num{ display:block; font-family:var(--font-head); font-weight:800; font-size:19px; color:var(--text); }
.info-cell .lbl{ display:block; font-size:11.5px; color:var(--text-muted); margin-top:2px; }

/* Generic detail section */
.detail-section{ padding:26px 18px 4px; background:var(--bg-light); }
.detail-section h2{ font-size:17px; font-weight:800; margin-bottom:12px; }
.detail-section.on-white{ background:var(--white); }
.desc-text{ font-size:14px; line-height:1.65; color:var(--text-muted); }

/* Agent card */
.agent-card{
  display:flex; align-items:center; gap:14px;
  background:var(--white);
  border:1px solid var(--border);
  border-radius:var(--radius-md);
  padding:16px;
  box-shadow:var(--shadow-card);
}
.agent-photo{ width:56px; height:56px; border-radius:50%; object-fit:cover; flex-shrink:0; }
.agent-info{ flex:1; min-width:0; }
.agent-info h4{ font-size:15px; font-weight:700; }
.agent-info p{ font-size:12.5px; color:var(--text-muted); margin-top:2px; }
.agent-contact-icons{ display:flex; gap:8px; flex-shrink:0; }
.agent-icon-btn{
  width:38px; height:38px;
  border-radius:50%;
  background:rgba(242,181,43,0.1);
  border:none;
  display:flex; align-items:center; justify-content:center;
  touch-action:manipulation;
}

/* Facts table */
.facts-table{ background:var(--white); border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-card); }
.facts-row{ display:flex; justify-content:space-between; padding:13px 16px; font-size:13.5px; border-bottom:1px solid var(--border); }
.facts-row:last-child{ border-bottom:none; }
.facts-row .k{ color:var(--text-muted); font-weight:500; }
.facts-row .v{ color:var(--text); font-weight:700; }

/* Location */
.map-preview{
  border-radius:var(--radius-md);
  overflow:hidden;
  border:1px solid var(--border);
  box-shadow:var(--shadow-card);
}
.map-preview iframe{ width:100%; height:200px; border:0; display:block; }
.map-info{ background:var(--white); padding:14px 16px; }
.map-info .addr-main{ font-size:14px; font-weight:700; margin-bottom:2px; }
.map-info .addr-sub{ font-size:12.5px; color:var(--text-muted); margin-bottom:12px; }
.directions-link{
  display:inline-flex; align-items:center; gap:6px;
  font-size:13.5px; font-weight:700; color:var(--gold-dark);
}

/* Action buttons */
.action-grid{ display:flex; flex-direction:column; gap:10px; }
.action-row{ display:flex; gap:10px; }
.action-btn{
  flex:1;
  display:flex; align-items:center; justify-content:center; gap:8px;
  padding:14px 10px;
  border-radius:12px;
  font-family:var(--font-head);
  font-weight:700;
  font-size:13.5px;
  border:1.5px solid var(--border);
  background:var(--white);
  color:var(--text);
  touch-action:manipulation;
}
.action-btn.whatsapp{ background:#25D366; color:var(--white); border-color:#25D366; }
.action-btn.call{ background:var(--navy-deep); color:var(--white); border-color:var(--navy-deep); }
.action-btn.save.active{ color:var(--burgundy); border-color:var(--burgundy); }
.action-btn.inspect{ background:linear-gradient(180deg, var(--gold) 0%, var(--gold-dark) 100%); color:var(--navy-deep); border-color:transparent; }

.sticky-actions{ display:none; }

@media (min-width:960px){
  .detail-topbar{ display:none; }
  #propertyDetailRoot{ max-width:900px; margin:0 auto; padding-top:24px; }
  .gallery-main{ border-radius:16px; padding-top:52%; }
  .info-card, .detail-section, .detail-header{ margin-left:0; margin-right:0; }
}

@media (min-width:960px){
  .detail-topbar{
    max-width:none !important;
    padding:0 48px !important;
    height:78px !important;
  }
  #propertyDetailRoot{
    width:min(calc(100% - 96px),1440px);
    margin:0 auto;
  }
  .detail-gallery{
    border-radius:0 0 22px 22px !important;
    overflow:hidden;
  }
}
@media (min-width:1280px){
  .detail-topbar{padding:0 64px !important;}
  #propertyDetailRoot{width:min(calc(100% - 128px),1440px);}
}

/* ---------- Reserve card, rules, recommendations ---------- */
.action-btn.book{ background:var(--navy-deep); color:var(--white); border-color:var(--navy-deep); }
.action-grid .action-btn{ width:100%; flex:none; }
.reserve-note{ font-size:12.5px; line-height:1.55; color:var(--text-muted); margin:12px 2px 0; }
.book-card-price{ display:flex; align-items:baseline; gap:6px; margin:-2px 0 14px; }
.book-card-price strong{ font-family:var(--font-head); font-size:24px; color:var(--text); }
.book-card-price span{ font-size:13.5px; color:var(--text-muted); }
.rules-list{ margin:0; padding:0; list-style:none; background:var(--white); border:1px solid var(--border); border-radius:var(--radius-md); box-shadow:var(--shadow-card); overflow:hidden; }
.rules-list li{ padding:13px 16px 13px 40px; font-size:13.5px; line-height:1.5; border-bottom:1px solid var(--border); position:relative; }
.rules-list li:last-child{ border-bottom:none; }
.rules-list li::before{ content:"\2713"; position:absolute; left:16px; top:13px; color:var(--gold-dark); font-weight:900; }
.rules-more{ margin:10px 2px 0; font-size:13px; }
.rules-more a{ color:var(--gold-dark); font-weight:700; }
.rec-row{ display:flex; gap:12px; overflow-x:auto; padding:2px 2px 12px; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch; }
.rec-row::-webkit-scrollbar{ display:none; }
.rec-card{ flex:0 0 220px; scroll-snap-align:start; background:var(--white); border:1px solid var(--border); border-radius:var(--radius-md); overflow:hidden; box-shadow:var(--shadow-card); display:flex; flex-direction:column; }
.rec-img{ display:block; aspect-ratio:4/3; background:#ece7da; }
.rec-img img{ width:100%; height:100%; object-fit:cover; }
.rec-body{ display:flex; flex-direction:column; gap:2px; padding:10px 12px 12px; }
.rec-body b{ font-size:14px; line-height:1.3; }
.rec-body small{ color:var(--text-muted); font-size:12.5px; }
.rec-body em{ font-style:normal; font-weight:800; color:var(--burgundy); font-size:13.5px; margin-top:4px; }
@media (min-width:960px){
  .rec-row{ display:grid; grid-template-columns:repeat(2,1fr); overflow:visible; }
  .rec-card{ flex:none; }
  .detail-sidebar .book-card-price{ border-bottom:1px solid rgba(15,23,43,.08); padding-bottom:14px; }
}

/* ---------- Availability calendar ---------- */
.avail-overlay{ position:fixed; inset:0; background:rgba(10,17,32,.55); z-index:1200; opacity:0; pointer-events:none; transition:opacity .2s; }
.avail-overlay.open{ opacity:1; pointer-events:auto; }
.avail-modal{
  position:fixed; left:0; right:0; bottom:0; z-index:1201; background:#fff; border-radius:22px 22px 0 0;
  max-height:92vh; overflow-y:auto; padding:18px 18px calc(22px + env(safe-area-inset-bottom));
  transform:translateY(100%); transition:transform .25s ease; visibility:hidden;
}
.avail-modal.open{ transform:none; visibility:visible; }
.av-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; margin-bottom:10px; }
.av-head h3{ margin:0; font-family:var(--font-head); font-size:19px; color:var(--navy-deep); }
.av-head p{ margin:3px 0 0; font-size:13px; color:var(--text-muted); }
.av-close{ border:none; background:var(--bg-light); width:36px; height:36px; border-radius:50%; font-size:22px; line-height:1; cursor:pointer; color:var(--navy-deep); }
.av-nav{ display:flex; align-items:center; justify-content:space-between; margin:6px 0 8px; }
.av-nav b{ font-family:var(--font-head); font-size:16px; }
.av-arrow{ border:1px solid var(--border); background:#fff; width:38px; height:38px; border-radius:50%; font-size:22px; cursor:pointer; color:var(--navy-deep); }
.av-arrow:disabled{ opacity:.3; cursor:default; }
.av-week, .av-grid{ display:grid; grid-template-columns:repeat(7,1fr); }
.av-week span{ text-align:center; font-size:11.5px; font-weight:700; color:var(--text-muted); padding:4px 0; }
.av-grid{ row-gap:4px; }
.av-day{ height:42px; border:none; background:none; font:700 14px var(--font-body); color:var(--navy-deep); border-radius:10px; cursor:pointer; position:relative; }
.av-day.empty{ cursor:default; }
.av-day.past{ color:#c3bfb3; cursor:default; }
.av-day.taken{ background:#f7e3e3; color:#a14a4a; text-decoration:line-through; }
.av-day.today{ box-shadow:inset 0 0 0 1.5px var(--gold-dark); }
.av-day.mid{ background:#fbe9cf; border-radius:0; }
.av-day.start, .av-day.end{ background:var(--navy-deep); color:var(--gold); }
.av-day.start{ border-radius:12px 0 0 12px; }
.av-day.end{ border-radius:0 12px 12px 0; }
.av-day.start:not(.end):not(.mid){ border-radius:12px; }
.av-legend{ display:flex; gap:14px; flex-wrap:wrap; font-size:12px; color:var(--text-muted); margin:10px 2px 4px; }
.av-legend span{ display:inline-flex; align-items:center; gap:6px; }
.lg{ width:14px; height:14px; border-radius:4px; display:inline-block; border:1px solid var(--border); }
.lg.taken{ background:#f7e3e3; border-color:#e8bcbc; }
.lg.sel{ background:var(--navy-deep); border-color:var(--navy-deep); }
.av-result{ margin-top:12px; border-top:1px solid var(--border); padding-top:14px; display:flex; flex-direction:column; gap:10px; }
.av-msg{ margin:0; font-size:13.5px; line-height:1.55; color:#3f485b; }
.av-near{ background:#fff7e8; border:1px solid #f0d49f; border-radius:10px; padding:10px 12px; }
.av-status{ border-radius:12px; padding:12px 14px; display:flex; flex-direction:column; gap:3px; font-size:13px; }
.av-status b{ font-size:15px; }
.av-status.ok{ background:#e9f6ee; color:#1d6b3f; border:1px solid #bfe3cd; }
.av-status.bad{ background:#fbeaea; color:#8c1c1c; border:1px solid #efc4c4; }
.av-actions{ display:flex; gap:10px; }
.av-actions.near{ flex-direction:column-reverse; }
.av-btn{ flex:0 0 auto; display:flex; align-items:center; justify-content:center; text-align:center; height:46px; padding:0 16px; border-radius:12px; border:none; font:700 14px var(--font-head); cursor:pointer; }
.av-actions:not(.near) .av-btn{ flex:1 1 0; }
.av-btn.wa{ background:#25D366; color:#fff; }
.av-btn.book{ background:linear-gradient(180deg,var(--gold),var(--gold-dark)); color:var(--navy-deep); }
@media (min-width:700px){
  .avail-modal{ left:50%; right:auto; bottom:auto; top:50%; width:440px; border-radius:22px; transform:translate(-50%,-46%); opacity:0; }
  .avail-modal.open{ transform:translate(-50%,-50%); opacity:1; }
}
.av-status.warn{ background:#fff7e8; color:#8a5a00; border:1px solid #f0d49f; }
.av-resume{ color:#1f6b3d; font-weight:700; }
