/* =========================================================
   MATRIX PROPERTIES LTD — Property details page
   Builds on styles.css + pages.css
   ========================================================= */
.container--detail { max-width: 1396px; }

/* Solid header variant */
.header--solid { box-shadow: 0 2px 14px rgba(15, 35, 95, .08); }
.header--solid .header__inner { height: 76px; padding-left: 24px; padding-right: 24px; }
.header--solid .nav { margin-right: 80px; gap: 40px; }
.header--solid .nav__link { font-size: 16px; }
.header--solid .nav__link.is-active { font-weight: 600; color: var(--navy); }
.header--solid .nav__link.is-active::after { background: var(--blue); bottom: -6px; left: -4px; right: -4px; }
.header--solid .header__cta { font-size: 17px; padding: 9px 20px; }
.header--solid .header__cta .ico { width: 22px; height: 22px; }

.pd-layout {
  display: grid; grid-template-columns: minmax(0, 1fr) 395px; gap: 20px;
  align-items: start; padding-top: 14px; padding-bottom: 6px;
}

/* Head */
.pd-back { display: none; }
.pd-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 0 20px; }
.pd-head .crumbs { grid-column: 1 / -1; margin-bottom: 10px; }
.pd-titlerow { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 14px; grid-column: 1 / -1; }
.pd-title { font-size: clamp(30px, 2.8vw, 42px); font-weight: 700; letter-spacing: -.02em; }
.pd-badges { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tag-deal { background: var(--amber); color: var(--navy); font-weight: 600; font-size: 17px; padding: 3px 16px; border-radius: 4px; }
.tag-sample { background: #e4eefc; color: var(--blue); font-size: 12.5px; padding: 6px 11px; border-radius: 4px; }
.tag-ref { font-size: 14px; color: var(--text); margin-left: 4px; }
.pd-loc { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--navy); margin-top: 4px; }
.pd-loc svg { width: 19px; height: 19px; color: var(--blue); }
.pd-price { font-size: 28px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.pd-share { align-self: end; margin-bottom: 8px; padding: 9px 18px; font-size: 17px; border-width: 1.5px; }
.pd-share .ico { width: 22px; height: 22px; }

/* Gallery */
.gallery { margin-top: 12px; }
.gallery__grid {
  display: grid; grid-template-columns: 566fr 180fr 180fr; grid-template-rows: 1fr 1fr;
  gap: 5px; height: clamp(240px, 20vw, 294px); border-radius: 4px; overflow: hidden;
}
.gallery__item { position: relative; padding: 0; border: 0; cursor: zoom-in; overflow: hidden; background: #e8ecf3; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.gallery__item:hover img { transform: scale(1.04); }
.gallery__item:first-child { grid-row: 1 / span 2; }
.gallery--single .gallery__grid { grid-template-columns: 1fr; grid-template-rows: 1fr; height: clamp(260px, 26vw, 380px); }
.gallery__all {
  position: absolute; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px;
  background: rgba(10, 18, 40, .78); color: #fff; font-size: 13.5px; padding: 8px 12px; border-radius: 4px;
}
.gallery__all svg { width: 20px; height: 20px; }
.gallery__slider, .gallery__thumbs { display: none; }

/* Stats */
.pd-stats {
  display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 4px; margin-top: 12px;
}
.pd-stat { display: flex; align-items: center; gap: 18px; padding: 10px 22px; }
.pd-stat + .pd-stat { border-left: 1px solid var(--line); }
.pd-stat svg { width: 38px; height: 38px; color: var(--navy); flex-shrink: 0; }
.pd-stat b { display: block; font-size: 16px; font-weight: 600; color: var(--navy); }
.pd-stat span { font-size: 14px; color: var(--muted); }

/* Sections */
.pd-section { padding: 14px 0 12px; }
.pd-section + .pd-section { border-top: 1px solid var(--line); }
.pd-section h2 { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
.pd-about p { font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 700px; }
.pd-features ul {
  list-style: none; margin: 0; padding: 0; display: grid;
  grid-auto-flow: column; grid-template-rows: repeat(var(--r3, 2), auto); grid-template-columns: repeat(3, 1fr); gap: 4px 20px;
}
.pd-features li { display: flex; align-items: center; gap: 22px; font-size: 13.5px; color: var(--text); }
.pd-features svg { width: 19px; height: 19px; color: var(--green); flex-shrink: 0; }

.pd-location { display: grid; grid-template-columns: 106px minmax(0, 1fr); }
.pd-location h2 { margin-bottom: 4px; }
.pd-location .pd-loc { font-size: 14px; margin-top: 0; }
.pd-location .pd-loc svg { width: 15px; height: 15px; }
.map { position: relative; height: 112px; border-radius: 6px; overflow: hidden; background: #e9edf2; }
.map iframe { position: absolute; left: 0; top: -70px; width: 100%; height: calc(100% + 140px); border: 0; pointer-events: none; filter: saturate(.55) brightness(1.04); }
.map__ring {
  position: absolute; left: 50%; top: 50%; width: 92px; height: 92px; margin: -46px 0 0 -46px;
  border-radius: 50%; background: rgba(66, 140, 230, .22); border: 1px solid rgba(66, 140, 230, .35);
}
.map__pin { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -30px 0 0 -13px; color: var(--blue); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3)); }
.map__label {
  position: absolute; left: calc(50% + 18px); top: calc(50% - 30px);
  background: var(--navy); color: #fff; font-size: 12px; padding: 3px 9px; border-radius: 4px; white-space: nowrap;
}
.map__note {
  position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 10px; max-width: 186px;
  background: #fff; border-radius: 6px; padding: 7px 10px; font-size: 10.5px; line-height: 1.3; color: var(--navy);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
}
.map__note svg { width: 16px; height: 16px; color: var(--blue); flex-shrink: 0; }

.pd-missing { padding: 60px 0; text-align: center; }
.pd-missing h1 { font-size: 30px; margin-bottom: 10px; }
.pd-missing p { color: var(--muted); margin-bottom: 20px; }

/* Request a viewing */
.viewing { position: sticky; top: 16px; padding-top: 8px; }
.viewing__card {
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  box-shadow: 0 6px 24px rgba(15, 35, 95, .07); padding: 22px 22px 28px;
}
.viewing__title { font-size: 32px; font-weight: 700; letter-spacing: -.015em; }
.viewing__intro { font-size: 16px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.vform { margin-top: 16px; }
.vform__row { display: contents; }
.vfield { display: block; margin-bottom: 14px; }
.vfield__label { display: block; font-size: 15px; font-weight: 600; color: var(--navy); margin-bottom: 6px; }
.vfield__label b { color: #e5383b; font-weight: 600; margin-left: 2px; }
.vfield__label em { font-style: normal; font-weight: 400; font-size: 14px; color: var(--muted); }
.vfield input, .vfield textarea {
  width: 100%; border: 1px solid #cfd6e2; border-radius: 4px; background: #fff;
  font: inherit; font-size: 14px; color: var(--navy); padding: 9px 16px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.vfield input { height: 40px; }
.vfield textarea { resize: vertical; min-height: 90px; }
.vfield input::placeholder, .vfield textarea::placeholder { color: #8a93a5; }
.vfield input:focus, .vfield textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(11, 95, 208, .12); }
.vfield__date { position: relative; display: block; }
.vfield__date input { padding-right: 44px; }
.vfield__date input.is-empty { color: #8a93a5; }
.vfield__date input::-webkit-calendar-picker-indicator { position: absolute; right: 0; width: 44px; height: 100%; opacity: 0; cursor: pointer; }
.vfield__date svg { position: absolute; right: 14px; top: 50%; width: 19px; height: 19px; margin-top: -9.5px; color: var(--navy); pointer-events: none; }
.vfield__error { display: none; font-size: 12.5px; color: #d62f32; margin-top: 4px; }
.vfield.is-invalid input { border-color: #e5383b; }
.vfield.is-invalid .vfield__error { display: block; }
.vform__submit { width: 100%; height: 48px; font-size: 17px; margin-top: 2px; }
.vform__submit .ico { width: 24px; height: 24px; }
.vform__note { text-align: center; font-size: 13.5px; color: var(--muted); margin-top: 10px; }

.vdone { text-align: center; padding: 20px 0 6px; }
.vdone[hidden] { display: none; }
.vdone__icon { width: 54px; height: 54px; color: var(--green); }
.vdone h3 { font-size: 22px; margin: 10px 0 6px; }
.vdone p { font-size: 14.5px; color: var(--muted); margin-bottom: 16px; }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { background: #1f9a40; }
.vdone__again { display: block; margin: 14px auto 0; border: 0; background: none; font: inherit; font-size: 13.5px; color: var(--blue); text-decoration: underline; cursor: pointer; }

.vdirect__or { display: flex; align-items: center; gap: 14px; font-size: 13.5px; color: var(--navy); margin: 24px 0 18px; }
.vdirect__or::before, .vdirect__or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vdirect__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vdirect__call, .vdirect__wa { display: flex; align-items: center; justify-content: center; border-radius: 4px; height: 62px; font-weight: 600; transition: background .2s, color .2s; }
.vdirect__call { flex-direction: column; border: 1.5px solid var(--blue); color: var(--blue); font-size: 15px; line-height: 1.25; }
.vdirect__call span { display: flex; align-items: center; gap: 10px; font-size: 17px; }
.vdirect__call svg { width: 18px; height: 18px; }
.vdirect__call:hover { background: var(--blue); color: #fff; }
.vdirect__wa { gap: 10px; background: var(--wa); color: #fff; font-size: 16px; font-weight: 500; }
.vdirect__wa svg { width: 32px; height: 32px; }
.vdirect__wa:hover { background: #1f9a40; }

/* Footer with links */
.footer--links .footer__inner { padding-top: 14px; padding-bottom: 14px; gap: 24px; }
.footer--links .footer__icon { height: 46px; }
.footer--links .footer__word { font-size: 26px; }
.footer--links .footer__word small { font-size: 8px; }
.footer__nav { display: flex; gap: 28px; margin: 0 auto; font-size: 14px; }
.footer__nav a:hover { color: var(--amber); }
.footer__where { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.footer__where em { font-size: 11.5px; opacity: .85; padding-left: 26px; }
.footer--links .footer__sep { height: 22px; }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 200; background: rgba(6, 12, 30, .94);
  display: flex; align-items: center; justify-content: center; padding: 60px 70px;
}
.lightbox[hidden] { display: none; }
.lightbox__img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 4px; }
.lightbox__close, .lightbox__nav {
  position: absolute; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; transition: background .2s;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255, 255, 255, .28); }
.lightbox__close svg, .lightbox__nav svg { width: 22px; height: 22px; }
.lightbox__close { top: 14px; right: 14px; }
.lightbox__nav--prev { left: 14px; top: 50%; margin-top: -23px; }
.lightbox__nav--next { right: 14px; top: 50%; margin-top: -23px; }
.lightbox__count { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; z-index: 210; transform: translate(-50%, 20px);
  background: var(--navy); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 6px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; max-width: calc(100% - 32px);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
  .pd-layout { grid-template-columns: minmax(0, 1fr) 340px; }
  .header--solid .nav { margin-right: 24px; gap: 24px; }
  .footer__nav { gap: 18px; }
  .pd-stat { padding: 10px 14px; gap: 12px; }
}

@media (max-width: 960px) {
  .pd-layout { grid-template-columns: minmax(0, 1fr); }
  .viewing { position: static; }
  .footer--links .footer__inner { flex-wrap: wrap; }
  .footer__nav { order: 3; flex-basis: 100%; margin: 0; flex-wrap: wrap; gap: 8px 20px; }
}

/* ---------- Details: mobile ---------- */
@media (max-width: 760px) {
  body.page-detail { padding-bottom: 72px; }
  .page-detail .header { background: #fff; }
  .page-detail .header__inner { height: 70px; padding: 0 16px 0 20px; }
  .page-detail .logo, .page-detail .burger { top: 0; }
  .page-detail .nav { margin-top: 8px; }
  .page-detail .logo__icon { height: 54px; }
  .page-detail .logo__text { height: 34px; }

  .pd-layout { padding-top: 12px; gap: 12px; }
  .pd-head .crumbs { display: none; }
  .pd-back { display: inline-flex; align-items: center; gap: 12px; grid-column: 1 / -1; justify-self: start; font-size: 15px; color: var(--navy); margin-bottom: 10px; }
  .pd-back svg { width: 18px; height: 18px; }
  .pd-titlerow { flex-direction: column-reverse; align-items: flex-start; gap: 8px; }
  .tag-deal { font-size: 15px; padding: 3px 14px; }
  .tag-sample { font-size: 11.5px; padding: 5px 10px; }
  .pd-title { font-size: clamp(26px, 8vw, 34px); }
  .pd-loc { font-size: 16px; }
  .pd-price { font-size: 26px; }
  .pd-share { padding: 7px 14px; font-size: 15px; margin-bottom: 30px; }
  .pd-share .ico { width: 19px; height: 19px; }

  .gallery__grid { display: none; }
  .gallery__slider { display: block; position: relative; aspect-ratio: 2 / 1; border-radius: 6px; overflow: hidden; background: #e8ecf3; }
  .gallery__slider img { width: 100%; height: 100%; object-fit: cover; }
  .gallery__arrow {
    position: absolute; top: 50%; margin-top: -19px; width: 38px; height: 38px; border-radius: 50%; border: 0;
    background: #fff; color: var(--navy); display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
  }
  .gallery__arrow svg { width: 18px; height: 18px; }
  .gallery__arrow--prev { left: 10px; }
  .gallery__arrow--next { right: 10px; }
  .gallery__counter, .gallery__full {
    position: absolute; bottom: 10px; height: 36px; display: grid; place-items: center;
    background: rgba(10, 18, 40, .75); color: #fff; border-radius: 6px; border: 0;
  }
  .gallery__counter { right: 54px; padding: 0 12px; font-size: 15px; }
  .gallery__full { right: 10px; width: 38px; cursor: pointer; }
  .gallery__full svg { width: 18px; height: 18px; }
  .gallery__thumbs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
  .gallery__thumb { padding: 0; border: 2px solid transparent; border-radius: 4px; overflow: hidden; aspect-ratio: 4 / 3; cursor: pointer; background: none; }
  .gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
  .gallery__thumb.is-active { border-color: var(--blue); }
  .gallery__thumb:nth-child(n+5) { display: none; }
  .gallery--single .gallery__arrow, .gallery--single .gallery__counter, .gallery--single .gallery__thumbs { display: none; }

  .pd-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pd-stat { padding: 10px 10px 10px 18px; gap: 16px; }
  .pd-stat + .pd-stat { border-left: 0; }
  .pd-stat:nth-child(even) { border-left: 1px solid var(--line); }
  .pd-stat:nth-child(n+3) { border-top: 1px solid var(--line); }
  .pd-stat svg { width: 32px; height: 32px; }
  .pd-stat span { font-size: 15px; }

  .pd-section h2 { font-size: 22px; }
  .pd-about p { font-size: 15px; }
  .pd-features ul { grid-template-rows: repeat(var(--r2, 3), auto); grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; }
  .pd-features li { font-size: 15px; gap: 18px; }
  .pd-location { grid-template-columns: minmax(0, 1fr); }
  .pd-location .pd-loc { font-size: 15px; margin-bottom: 8px; }
  .map { height: 116px; }
  .map__label { display: none; }
  .map__note { max-width: 200px; font-size: 10.5px; padding: 6px 9px; }

  .viewing { padding-top: 0; }
  .viewing__card { background: #f5f8fd; border-color: #eaeff7; box-shadow: none; padding: 16px 18px 14px; }
  .viewing__title { font-size: 22px; }
  .viewing__intro { font-size: 14px; margin-top: 4px; }
  .vform { margin-top: 10px; }
  .vform__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .vfield { margin-bottom: 10px; }
  .vfield__label { font-size: 14px; margin-bottom: 4px; }
  .vfield input { height: 42px; padding: 8px 12px; font-size: 13.5px; }
  .vfield textarea { min-height: 60px; padding: 8px 12px; font-size: 13.5px; }
  .vform__submit { height: 46px; font-size: 16px; }
  .vform__note { font-size: 13px; margin-top: 8px; }
  .vdirect { display: none; }

  .footer--links .footer__inner { gap: 10px 16px; padding-top: 12px; padding-bottom: 12px; }
  .footer--links .footer__icon { height: 34px; }
  .footer--links .footer__word { font-size: 18px; }
  .footer--links .footer__word small { font-size: 5.5px; }
  .footer--links .footer__sep { display: none; }
  .footer__nav { font-size: 13px; gap: 6px 16px; }
  .footer__where { font-size: 12.5px; }

  .lightbox { padding: 60px 12px; }
  .lightbox__nav { top: auto; bottom: 10px; margin: 0; }
  .lightbox__nav--prev { left: 16px; }
  .lightbox__nav--next { right: 16px; }
}

@media (max-width: 380px) {
  .vform__row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pd-stat { padding-left: 14px; gap: 14px; }
}
