/* ============================================================
   KPGC FINISH LAYER — loads last, overrides everything
   Desktop/laptop styles are untouched.
   All mobile fixes are inside @media blocks only.
   ============================================================ */

/* ── Global navbar fix (all screen sizes) ── */
:root { --navbar-height: 80px }

.main-header,
.main-header.transparent,
.main-header.scrolled {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  width: 100%;
  height: var(--navbar-height, 80px);
  z-index: 9999 !important;
  background: #fff !important;
  backdrop-filter: none;
  border-bottom: 1px solid #e7e1d6;
  box-shadow: 0 2px 16px rgba(40,30,10,.07);
}

.main-header .logo-text   { color: #23201b !important }
.main-header .logo-subtext{ color: #8a6a2f !important }
.main-header .nav-link    { color: #23201b !important; font-weight: 500; visibility: visible; opacity: 1 }
.main-header .nav-link:hover { color: #8a6a2f !important }
.main-header .hamburger-line { background-color: #23201b !important }

.nav-menu .nav-item:last-child .nav-link[href^="/portal/"] {
  height: auto; padding: 10px 20px;
  border: 1.5px solid #8a6a2f; border-radius: 999px;
  color: #8a6a2f !important; letter-spacing: .12em;
}
.nav-menu .nav-item:last-child .nav-link[href^="/portal/"]::after { display: none }
.nav-menu .nav-item:last-child .nav-link[href^="/portal/"]:hover  { background: #8a6a2f; color: #fff !important }

.projects-dropdown,
.mega-menu {
  background: #fff;
  border: 1px solid #e7e1d6;
  box-shadow: 0 14px 30px -16px rgba(40,30,10,.3);
}
.projects-dropdown a       { color: #4a453c }
.projects-dropdown a:hover { color: #8a6a2f; background: #f7f4ee }

/* Hero fallback if video is slow */
.hero { background: #ece6da url(../images/royal-woods/hero_day_building.png) center/cover no-repeat }
.hero-video.failed { display: none }

/* Badge pulse */
.project-card-badge[data-status="proposed"],
.project-card[data-status="proposed"] .project-card-badge {
  background: linear-gradient(135deg,#8a6a2f 0%,#c5a059 100%);
  box-shadow: 0 4px 12px rgba(197,160,89,.4);
  animation: pulse-gold 2s ease-in-out infinite;
}
@keyframes pulse-gold {
  0%,100% { box-shadow: 0 4px 12px rgba(197,160,89,.4) }
  50%      { box-shadow: 0 4px 20px rgba(197,160,89,.7) }
}


/* ============================================================
   TABLET  ≤ 1024px
   ============================================================ */
@media (max-width: 1024px) {
  .projects-grid          { grid-template-columns: repeat(2,1fr) !important }
  .amenities-grid         { grid-template-columns: repeat(2,1fr) !important }
  .proposed-amenities-grid{ grid-template-columns: repeat(2,1fr) !important }
  .specs-grid             { grid-template-columns: repeat(2,1fr) !important }
  .location-advantage-grid{ grid-template-columns: 1fr !important }
  .map-mockup             { height: 300px !important }
}


/* ============================================================
   MOBILE  ≤ 768px
   ============================================================ */
@media (max-width: 768px) {

  /* ── Root ── */
  :root { --navbar-height: 64px }
  body  {
    padding-top: var(--navbar-height);
    padding-bottom: 64px;
  }

  /* ── Navbar mobile menu ── */
  .main-header .nav-menu {
    background: #fff !important;
    border-top: 1px solid #e7e1d6;
    box-shadow: 0 20px 30px -20px rgba(40,30,10,.3);
    padding: 20px 22px 40px;
    gap: 0;
  }
  .main-header .nav-menu .nav-item  { border-bottom: 1px solid #f0ebe0 }
  .main-header .nav-menu .nav-link  { font-size: 15px; padding: 15px 0 !important; color: #23201b !important }
  .nav-menu .nav-item:last-child    { border: 0; padding-top: 16px }
  .nav-menu .nav-item:last-child .nav-link[href^="/portal/"] { width: 100%; justify-content: center; padding: 13px 20px !important }
  .logo-text { font-size: 20px }
  .main-header img[alt="KPGC VENTURES PVT LTD"] { height: 46px !important }

  /* ── Floating action bar ── */
  .floating-actions-bar {
    position: fixed; left: 0; bottom: 0; right: 0; top: auto;
    transform: none; flex-direction: row;
    width: 100%; height: 64px;
    border-left: none; border-top: 2px solid #c5a059;
  }
  .floating-action { flex: 1; height: 100%; width: auto; border-bottom: none; border-right: 1px solid rgba(255,255,255,.1) }
  .floating-action:last-child { border-right: none }
  .floating-action svg  { width: 18px; height: 18px; margin-bottom: 2px }
  .floating-action span { font-size: 8px }

  /* ── General layout ── */
  .container      { width: 94% !important }
  .section-padding{ padding: 44px 0 !important }
  h2 { font-size: 26px !important; line-height: 1.2 }
  h3 { font-size: 20px !important }
  h4 { font-size: 16px !important }
  p  { font-size: 14px }

  /* ── INDEX — Hero video ── */
  .hero {
    height: 100vh;
    height: 100svh;
  }
  .hero-video {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center center;
    transform: none;
    min-width: unset; min-height: unset;
  }

  /* ── INDEX — Iconic developments carousel ── */
  .slider-slide {
    flex: 0 0 88% !important;
    min-width: 88% !important;
    padding: 0 8px !important;
  }
  .luxury-slider { padding: 10px 0 !important }
  .slider-controls { justify-content: center }

  /* ── INDEX — Philosophy section ── */
  .philosophy-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }
  .philosophy-content h2 { font-size: 26px !important }
  .philosophy-img {
    height: 240px !important;
    border-left: none !important;
    border-top: 3px solid #c5a059;
  }
  .philosophy-links {
    flex-direction: column !important;
    gap: 12px !important;
  }
  .philosophy-links .btn { width: 100%; justify-content: center }

  /* ── INDEX — Hospitality banner ── */
  .hospitality-banner {
    height: auto !important;
    min-height: 300px;
    padding: 60px 0 !important;
    background-attachment: scroll !important;
  }
  .hospitality-content h2 { font-size: 24px !important }

  /* ── PROJECTS PAGE — Hero banner ── */
  .projects-hero        { height: 30vh !important; min-height: 180px }
  .projects-hero-title  { font-size: 24px !important }

  /* ── PROJECTS PAGE — Filter bar ── */
  .filter-panel         { position: static !important }
  .filter-bar-container { flex-direction: column; gap: 10px }
  .filter-group-buttons { flex-wrap: wrap; gap: 6px }
  .filter-btn           { padding: 7px 12px; font-size: 10px }
  .filter-group-selects { flex-direction: column; width: 100% }
  .filter-select        { width: 100% }
  .search-catalog-wrap  { width: 100% }

  /* ── PROJECTS PAGE — Grid ── */
  .projects-grid { grid-template-columns: 1fr !important; gap: 20px !important }

  /* ── PROJECT DETAIL — Hero carousel ── */
  .detail-hero-carousel {
    height: 56vh !important;
    min-height: 300px;
  }
  .hero-slider-slide img,
  .hero-slider-slide video {
    object-fit: cover !important;
    object-position: center center !important;
  }
  .hero-slider-slide img[src*="kpgc_avenue_building"],
  .hero-slider-slide img[src*="rw_building"] {
    background-color: transparent !important;
  }
  /* Keep contain for avenue building */
  .hero-slider-slide img[src*="kpgc_avenue_building"] {
    object-fit: contain !important;
    background-color: #0a1628;
  }
  /* Keep contain for rw_building */
  .hero-slider-slide img[src*="rw_building"] {
    object-fit: contain !important;
    background-color: #0a1628;
  }
  .detail-title         { font-size: 24px !important; line-height: 1.2 }
  .detail-location      { font-size: 10px !important }
  .detail-hero-content  { bottom: 75px !important; padding: 0 16px }
  .detail-rera-badge-container { display: none !important }
  .hero-slider-arrows-horizontal { bottom: 8px; gap: 8px }
  .hero-slider-arrow    { width: 34px !important; height: 34px !important }
  .hero-slider-dots     { right: auto; left: 50%; transform: translateX(-50%); bottom: 48px }

  /* ── PROJECT DETAIL — Overview ── */
  .detail-main-grid     { padding: 0 !important }
  #detailHeading        { font-size: 22px !important }
  #detailMainDesc       { font-size: 14px !important }
  #privateTourWrap .btn { width: 100%; justify-content: center }
  #detailDesignTeam     { font-size: 11px !important; text-align: center }

  /* ── PROJECT DETAIL — Specs ── */
  .specs-grid {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 12px 0 !important;
  }
  .specs-grid > div {
    padding: 12px 0;
    border-bottom: 1px solid #e7e1d6;
  }
  .spec-box-title { font-size: 10px !important }
  .spec-box-val   { font-size: 14px !important }

  /* ── PROJECT DETAIL — Floor plan tabs ── */
  .tabs-navigation {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
    padding-bottom: 2px;
    gap: 0;
  }
  .tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    padding: 10px 14px !important;
    font-size: 10px !important;
    letter-spacing: .04em !important;
  }
  .floor-plan-image-wrap        { padding: 8px !important }
  .floor-plan-image-wrap img    { max-height: 260px !important; width: 100% }

  /* ── PROJECT DETAIL — Amenities ── */
  .amenities-grid          { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important }
  .proposed-amenities-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important }
  .amenity-card            { padding: 14px 10px !important }
  .amenity-card h4         { font-size: 12px !important }
  .amenity-icon svg        { width: 20px !important; height: 20px !important }

  /* ── PROJECT DETAIL — Location ── */
  .location-advantage-grid { grid-template-columns: 1fr !important; gap: 16px }
  .advantage-tabs          { gap: 6px }
  .advantage-tab-item      { font-size: 12px !important; padding: 10px 12px !important }
  .map-mockup              { height: 220px !important }

  /* ── CONTACT PAGE ── */
  .contact-grid { grid-template-columns: 1fr !important; gap: 32px }
  .contact-item { margin-bottom: 16px }

  /* ── OUR STORY / IMPACT / CAREERS banners ── */
  [class*="-hero"][class*="section"],
  .page-hero,
  .story-hero,
  .impact-hero,
  .careers-hero,
  .contact-hero { height: 55vh !important; min-height: 260px !important; background-size: cover !important; background-position: center center !important; background-attachment: scroll !important; }

  /* ── Any 2-col grids on inner pages ── */
  .story-grid,
  .impact-grid,
  .team-grid,
  .values-grid,
  .careers-grid,
  .job-listings { grid-template-columns: 1fr !important }

  /* ── Drawer ── */
  .drawer-container { max-width: 100% !important; padding: 20px 16px !important }
  .form-row         { grid-template-columns: 1fr !important }

  /* ── Search ── */
  .search-input { font-size: 20px !important }
  .search-form  { width: 92% !important }

  /* ── Footer ── */
  .footer-top    { grid-template-columns: 1fr !important; gap: 24px !important }
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center }
  .footer-col h5 { font-size: 15px !important; margin-bottom: 10px !important }
}


/* ============================================================
   SMALL PHONES  ≤ 480px
   ============================================================ */
@media (max-width: 480px) {

  /* Hero carousel tighter */
  .detail-hero-carousel { height: 50vh !important; min-height: 260px }
  .detail-title         { font-size: 20px !important }
  .detail-hero-content  { bottom: 65px !important }

  /* Slider full width */
  .slider-slide { flex: 0 0 100% !important; min-width: 100% !important; padding: 0 4px !important }

  /* Amenities single col */
  .amenities-grid          { grid-template-columns: 1fr !important }
  .proposed-amenities-grid { grid-template-columns: 1fr !important }

  /* Floor plan */
  .floor-plan-image-wrap img { max-height: 200px !important }

  /* Map */
  .map-mockup { height: 180px !important }

  /* Cards */
  .project-card-image-wrap { height: 210px !important }
  .project-card-title      { font-size: 17px !important }
  .project-card-content    { padding: 14px !important }

  /* Headings */
  h2 { font-size: 22px !important }
  h3 { font-size: 17px !important }

  /* Buttons full width */
  .btn { width: 100%; justify-content: center }

  /* Floating bar smaller */
  .floating-actions-bar { height: 56px }
  body { padding-bottom: 56px }
}

/* ============================================================
   MOBILE MEDIA FIT — preserve complete hero and carousel media
   Desktop styles deliberately remain untouched.
   ============================================================ */
@media (max-width: 768px) {
  /* Never allow an image, video, embed, or floor-plan image to overflow. */
  img, video, iframe { max-width: 100%; }

  /* Size each media stage to its source ratio: no crop and no letterbox. */
  .hero {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: var(--mobile-hero-ratio, 16 / 9);
    background: transparent !important;
  }
  .hero-video {
    object-fit: contain !important;
    background: transparent !important;
  }
  .hero-content { z-index: 3; }

  /* Project detail pages: display the complete slide, including portrait,
     landscape, plans, and videos, inside a responsive media stage. */
  .detail-hero-carousel {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: var(--mobile-hero-ratio, 16 / 9);
    background: transparent !important;
  }
  .hero-slider-slide,
  .hero-slider-slide img,
  .hero-slider-slide video {
    background: transparent !important;
  }
  .hero-slider-slide img,
  .hero-slider-slide video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
  }

  /* Background-image hero banners — always cover on mobile */
  .projects-hero,
  .story-hero,
  .impact-hero,
  .careers-hero,
  .contact-hero {
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-position: center center !important;
    background-attachment: scroll !important;
    background-color: transparent !important;
  }

  /* Guard common horizontal layouts on narrow phones. */
  .contact-grid,
  .philosophy-grid,
  .pillar-grid,
  .commitments-grid,
  .stats-grid,
  .job-row { min-width: 0; }
  .pillar-grid,
  .commitments-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .job-row { padding: 20px !important; }
  .contact-form-col { padding: 20px !important; }
}

@media (max-width: 480px) {
  .hero,
  .detail-hero-carousel { min-height: 0 !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
}
