/* ==========================================================================
   Project detail — responsive layer + motion hooks
   Loaded AFTER the page's inline <style> so these rules win. Tested at
   320 · 360 (Vivo / Moto / Galaxy) · 375 (iPhone SE) · 393 (iPhone 15)
   · 412 (Galaxy A55) · 430 (iPhone Pro Max) · tablets · desktop.
   ========================================================================== */

/* ── Section quick-nav (built by project-motion.js) ───────────────────── */
.pd-nav {
  position: fixed; left: 0; right: 0; z-index: 990;
  top: var(--pd-header-h, 0px);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid #eef0f3;
  box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .35);
  transform: translateY(-110%); opacity: 0; visibility: hidden;
  transition: transform .45s cubic-bezier(.22, 1, .36, 1), opacity .3s, visibility 0s linear .45s;
}
.pd-nav.is-on { transform: none; opacity: 1; visibility: visible; transition-delay: 0s; }
.pd-nav__track {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  padding: 10px clamp(12px, 3vw, 48px); scroll-snap-type: x proximity;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 24px), transparent);
}
.pd-nav__track::-webkit-scrollbar { display: none; }
.pd-nav a {
  position: relative; flex: 0 0 auto; scroll-snap-align: start;
  padding: 8px 14px; border-radius: 999px; min-height: 36px;
  display: inline-flex; align-items: center;
  font: 600 .86rem/1 'Outfit', 'Inter', sans-serif; color: #475569; text-decoration: none; white-space: nowrap;
  transition: color .25s, background .25s;
}
.pd-nav a:hover { color: #0f172a; background: #f1f5f9; }
.pd-nav a.is-active { color: #111; background: var(--pr-primary, #f7cb46); }
.pd-nav a.is-cta { color: #fff; background: #0f172a; }
.pd-nav a.is-cta.is-active { background: #b08d55; }

/* Flex rows with long text must be allowed to shrink */
#pd-location .d-flex.align-items-start > div:last-child,
.lux-section .d-flex > div:not([class*="col"]):last-child { min-width: 0; overflow-wrap: anywhere; }

/* Section title accent (drawn by motion) */
.lux-section-title { isolation: isolate; }
.pd-title-line { display: block; height: 3px; width: 56px; margin: -18px 0 26px; border-radius: 3px; background: linear-gradient(90deg, var(--pr-primary, #f7cb46), #e5a93b); transform-origin: left center; }

/* Hero scroll cue */
.pd-cue { position: absolute; left: 50%; bottom: 22px; z-index: 3; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; color: rgba(255,255,255,.8); font: 700 .62rem/1 'Outfit', sans-serif; letter-spacing: .22em; text-transform: uppercase; pointer-events: none; }
.pd-cue span { width: 1.5px; height: 34px; background: linear-gradient(var(--pr-primary, #f7cb46), transparent); animation: pdCue 2s cubic-bezier(.22,1,.36,1) infinite; transform-origin: top; }
@keyframes pdCue { 0% { transform: scaleY(0); } 55% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* Horizontal-scroll hint for tab strips */
.conn-tabs, .gallery-tabs { scrollbar-width: none; scroll-snap-type: x proximity; }
.conn-tabs::-webkit-scrollbar, .gallery-tabs::-webkit-scrollbar { display: none; }
.conn-tabs .nav-link, .gallery-tabs .nav-link { scroll-snap-align: start; transition: background .25s, color .25s, border-color .25s, transform .25s; }

/* ══ Tablet & below (≤ 991px) ═══════════════════════════════════════════ */
@media (max-width: 991.98px) {
  .pd-main .row.g-5 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
  .pd-main { padding-top: 28px !important; padding-bottom: 28px !important; }
  .sticky-enquiry-wrapper { position: static; }
  .lux-section, .lux-section.pd-video { padding: 28px 22px !important; border-radius: 20px; margin-bottom: 20px; }
  .lux-section-title { font-size: 1.45rem !important; margin-bottom: 20px; gap: 10px; }
  .pd-title-line { margin: -10px 0 20px; }
  .lux-description { font-size: 1rem; line-height: 1.75; }
  .fp-master-img { max-height: 380px; }
  .fp-master-link { max-height: 380px; }
}

/* ══ Phones (≤ 767px) ═══════════════════════════════════════════════════ */
@media (max-width: 767.98px) {
  /* Header: compact logos, menu button only */
  .custom-proj-header { padding: 8px 0; }
  .custom-proj-header .cph-logo img { height: 42px !important; max-width: 46vw; }
  .custom-proj-header .cph-logo a + a img { padding-left: 10px !important; }
  .cph-actions .cph-btn { display: none !important; }
  .cph-hamburger { padding: 10px 2px 10px 12px; }

  /* Hero */
  .luxury-hero-gallery { height: 88svh; min-height: 540px; max-height: 760px; }
  .hero-swiper .swiper-button-next, .hero-swiper .swiper-button-prev { display: none; }
  .hero-content { padding-bottom: 64px; }
  .luxury-badge { font-size: .68rem; letter-spacing: 1.5px; padding: 5px 11px; margin-right: 6px; margin-bottom: 10px; }
  .luxury-title { font-size: clamp(1.75rem, 8.4vw, 2.3rem); line-height: 1.08; letter-spacing: -.5px; }
  .luxury-location { font-size: .92rem; gap: 6px; }
  .hero-stats-banner { padding: 12px !important; gap: 8px !important; border-radius: 14px; margin-top: 16px; }
  .hero-stat-label { font-size: .62rem; letter-spacing: 1px; }
  .hero-stat-val { font-size: clamp(.92rem, 4.2vw, 1.1rem) !important; line-height: 1.25; word-break: break-word; }

  /* Sections */
  .pd-main .container-fluid { padding-left: 14px !important; padding-right: 14px !important; }
  .lux-section, .lux-section.pd-video { padding: 22px 16px !important; border-radius: 18px; margin-bottom: 16px; }
  .lux-section-title { font-size: 1.25rem !important; line-height: 1.25; }
  .lux-section-title i { font-size: 1.15rem; }
  .lux-section .d-flex.justify-content-between.align-items-center { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
  .lux-section .d-flex.justify-content-between.align-items-center > .lux-section-title { margin-bottom: 0 !important; }
  .lux-section .d-flex.justify-content-between.align-items-center .btn { width: 100%; min-height: 44px; white-space: normal; display: inline-flex; align-items: center; justify-content: center; }

  /* Key facts: 2 × 2 instead of a tall single column */
  .bento-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; margin-bottom: 16px; }
  .bento-box { padding: 16px 10px; border-radius: 14px; text-align: center; }
  .bento-icon { font-size: 1.35rem; margin-bottom: 8px; }
  .bento-label { font-size: .64rem; letter-spacing: .8px; }
  .bento-value { font-size: clamp(.9rem, 4vw, 1.05rem); line-height: 1.3; word-break: break-word; }

  /* Connectivity: one clean column, tabs as a swipe strip */
  .conn-list { grid-template-columns: 1fr !important; column-gap: 0; }
  .conn-list li { padding: 12px 0; gap: 12px; }
  .conn-list li .pin-icon { font-size: 1.25rem; flex: 0 0 auto; color: var(--pr-primary, #f7cb46); }
  .conn-list li .conn-name { font-size: .95rem; line-height: 1.45; min-width: 0; overflow-wrap: anywhere; }
  .conn-tabs { margin-inline: -16px; padding-inline: 16px; }
  .conn-tabs .nav-link { padding: 9px 16px; font-size: .9rem; margin-right: 8px; border-radius: 999px; }

  /* Amenities: 2 columns, compact */
  .lux-amenities-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px !important; }
  .lux-amenity-card { padding: 14px 10px; gap: 10px; border-radius: 14px; }
  .lux-amenity-icon-box { width: 44px; height: 44px; font-size: 1.1rem; }
  .lux-amenity-card .fw-bold { font-size: .86rem !important; line-height: 1.35; overflow-wrap: anywhere; }

  /* Gallery: swipeable rail instead of a very long stack */
  .gallery-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding-inline: 16px; }
  .gallery-tabs .nav-link { font-size: .95rem; padding: 10px 12px; margin-right: 6px; white-space: nowrap; }
  #pd-gallery .fp-grid {
    display: flex !important; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: -16px; padding: 0 16px 6px; scroll-padding-inline: 16px;
  }
  #pd-gallery .fp-grid::-webkit-scrollbar { display: none; }
  #pd-gallery .fp-item { flex: 0 0 84%; scroll-snap-align: start; border-radius: 14px; }
  .fp-grid { grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }
  .pd-swipe-hint { display: flex; align-items: center; gap: 8px; margin-top: 10px; font: 600 .78rem 'Outfit', sans-serif; color: #94a3b8; }

  /* Floor plans */
  #floor-plans .card .btn, #floor-plans .card a.btn { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; }
  #floor-plans .row.g-4 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
  .fp-master-wrap { padding: 14px !important; }

  /* EMI */
  #emi-calculator-section .lux-section-title { font-size: 1.15rem !important; letter-spacing: .3px !important; }
  .emi-calc-box { padding: 16px !important; border-radius: 16px; }
  .emi-calc-box input[type="range"] { height: 28px; }
  .emi-result-card { padding: 22px 16px !important; }

  /* Video / tours */
  .vt-box { padding: 12px !important; }

  /* Sidebar enquiry & RERA */
  .glass-sidebar { padding: 22px 16px !important; border-radius: 20px; }
  .price-display { font-size: 1.6rem !important; margin-bottom: 18px; }
  .glass-sidebar img[alt="RERA QR Code"] { width: 130px !important; height: 130px !important; }

  .lux-section .badge, .glass-sidebar .badge { white-space: normal; max-width: 100%; overflow-wrap: anywhere; text-align: left; line-height: 1.35; }

  /* Touch-friendly tap targets */
  .lux-section .btn-sm { min-height: 40px; }
  .pd-nav a { min-height: 40px; }
}

/* ══ Small phones (≤ 380px: Galaxy A0x, older iPhones, 320 devices) ═════ */
@media (max-width: 380px) {
  .pd-main .row.g-5 { --bs-gutter-x: 1rem; }
  .lux-section, .lux-section.pd-video { padding: 18px 13px !important; }
  .pd-main .container-fluid { padding-left: 10px !important; padding-right: 10px !important; }
  .conn-tabs, .gallery-tabs, #pd-gallery .fp-grid { margin-inline: -13px; padding-inline: 13px; }
  .bento-grid, .lux-amenities-grid { gap: 8px !important; }
  .bento-box { padding: 14px 8px; }
  .hero-stats-banner { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .luxury-title { font-size: 1.65rem; }
  .custom-proj-header .cph-logo img { height: 36px !important; }
}

/* ══ Landscape phones ══════════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .luxury-hero-gallery { height: 560px; min-height: 0; max-height: none; }
  .hero-content { padding-bottom: 28px; }
  .pd-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-nav { transition: none; }
  .pd-cue span { animation: none; }
}
