/* =========================================================
   Cielo N Tierra Builders - Premium UI (Light/Dark)
   - SRK Honda style mobile dropdown
   - Sticky bottom actions on mobile
   - Premium header + cards + buttons
========================================================= */

:root{
  --max: 1120px;
  --r: 18px;

  --primary: #3b82f6;
  --primary2:#a78bfa;

  --shadow-lg: 0 30px 90px rgba(0,0,0,.28);
  --shadow-md: 0 14px 40px rgba(0,0,0,.18);
  --shadow-sm: 0 8px 18px rgba(0,0,0,.10);
}

/* ---------------------------
   Theme tokens
--------------------------- */
html[data-theme="dark"]{
  --bg:#0b0f14;
  --bg2:#0f1520;
  --text:#eef3fb;
  --muted:#a6b0c3;

  --card: rgba(255,255,255,.06);
  --line: rgba(255,255,255,.12);

  --btn: rgba(255,255,255,.10);
  --btn2: rgba(255,255,255,.06);
  --ring: rgba(125,211,252,.28);

  --menuCard: #0f1520;
}

html[data-theme="light"]{
  --bg:#f4f6fb;
  --bg2:#ffffff;
  --text:#0b1220;
  --muted:#4f5b6b;

  --card: rgba(0,0,0,.04);
  --line: rgba(0,0,0,.10);

  --btn: rgba(0,0,0,.06);
  --btn2: rgba(0,0,0,.03);
  --ring: rgba(59,130,246,.22);

  --menuCard: #ffffff;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 520px at 12% 0%, rgba(125,211,252,.12), transparent 60%),
    radial-gradient(900px 520px at 90% 10%, rgba(167,139,250,.10), transparent 60%),
    var(--bg);
  line-height:1.55;
}

img{ max-width:100%; display:block; height:auto; }
a{ color:inherit; text-decoration:none; }
.container{ max-width:var(--max); margin:0 auto; padding:0 18px; }
.muted{ color:var(--muted); }

html.nav-open{ overflow:hidden; }
.no-scroll{ overflow:hidden; }

/* Make hidden attribute always win */
[hidden]{ display:none !important; }

/* ---------------------------
   Skip link
--------------------------- */
.skip{
  position:absolute;
  left:-999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}
.skip:focus{
  left:12px;
  top:12px;
  width:auto;
  height:auto;
  padding:10px 12px;
  border-radius:12px;
  background:var(--bg2);
  border:1px solid var(--line);
  z-index:99999;
}

/* ---------------------------
   Header
--------------------------- */
.header{
  position: sticky;
  top:0;
  z-index:60;
  background: color-mix(in srgb, var(--bg2) 72%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow .18s ease, background .18s ease;
}
.header--scrolled{
  box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--bg2) 86%, transparent);
}
.header__inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 0;
}

/* Logo card */
.brand--image{
  border-radius: 18px;
  background: color-mix(in srgb, var(--bg2) 90%, transparent);
  border: 1px solid var(--line);
  padding: 8px 10px;
}
.brand--image img{
  width: min(520px, 78vw);
  max-height: 68px;
  object-fit: contain;
  border-radius: 12px;
}

/* Desktop nav */
.nav{
  display:none;
  gap:18px;
  align-items:center;
}
.nav__link{ color:var(--muted); font-weight:750; }
.nav__link:hover{ color:var(--text); }

/* Quickbar blocks */
.quickbar{
  display:flex;
  align-items:center;
}
.quickbar__inner{
  display:flex;
  align-items:center;
  gap:10px;
}
.quickbar--inHeader{ display:none; }

.quickbar--mobile{
  display:flex;
  position: sticky;
  top: calc(0px + 76px);
  z-index: 55;
  padding: 10px 0;
  background: color-mix(in srgb, var(--bg2) 72%, transparent);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* Desktop behavior */
@media (min-width: 860px){
  .nav{ display:flex; }
  .quickbar--inHeader{ display:flex; }
  .quickbar--mobile{ display:none; }
}

/* ---------------------------
   Buttons
--------------------------- */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:12px 16px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--btn);
  font-weight: 900;
  transition: transform .15s ease, background .15s ease;
}
.btn:hover{ transform: translateY(-1px); background: color-mix(in srgb, var(--btn) 70%, transparent); }
.btn--ghost{ background: transparent; }
.btn--small{ padding:10px 14px; font-size:.95rem; }
.btn--primary{
  color:#fff;
  background: linear-gradient(135deg, rgba(59,130,246,.96), rgba(167,139,250,.96));
  border-color: rgba(255,255,255,.18);
}
.btn--primary:hover{ transform: translateY(-1px) scale(1.01); }

/* Round icon button */
.iconbtn{
  width:40px;
  height:40px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--btn2);
  display:grid;
  place-items:center;
  cursor:pointer;
}
.iconbtn__dot{
  width:16px; height:16px; border-radius:999px;
  background: linear-gradient(135deg, rgba(125,211,252,.95), rgba(167,139,250,.95));
}

/* Hamburger */
.burger{
  display:inline-flex;
  flex-direction:column;
  gap:6px;
  padding:10px 12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: var(--btn2);
  cursor:pointer;
}
.burger span{
  width:22px;
  height:2px;
  border-radius:999px;
  background: color-mix(in srgb, var(--text) 82%, transparent);
}

/* ---------------------------
   HERO helper styles (used in index.php)
--------------------------- */
.hero__metaRow{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  margin: 0 0 10px;
}
.hero__metaLeft{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}
.hero__pill{
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--btn2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 900;
  white-space: nowrap;
}

/* ---------------------------
   Sections & cards
--------------------------- */
.section{ padding: 52px 0; }
.section--alt{
  background: color-mix(in srgb, var(--bg2) 60%, transparent);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.section__head{ margin-bottom: 18px; }
.section__head h2{ margin:0 0 8px; font-size:1.55rem; }

.cards{ display:grid; gap:14px; }
.card{
  padding:16px;
  border-radius: calc(var(--r) + 8px);
  background: var(--card);
  border: 1px solid var(--line);
}
@media (min-width: 860px){
  .cards{ grid-template-columns: 1fr 1fr 1fr; }
}

/* ---------------------------
   Forms
--------------------------- */
.form{
  padding:16px;
  border-radius: calc(var(--r) + 10px);
  background: var(--card);
  border: 1px solid var(--line);
}
label span{ display:block; margin-bottom:6px; color:var(--muted); font-size:.95rem; }
input,select,textarea{
  width:100%;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--line);
  background: color-mix(in srgb, var(--bg2) 78%, transparent);
  color:var(--text);
  outline:none;
}
input:focus,select:focus,textarea:focus{ box-shadow: 0 0 0 4px var(--ring); }

.flash{ padding:12px 14px; border-radius: var(--r); border:1px solid var(--line); margin: 12px 0 14px; }
.flash--success{ background: rgba(34,197,94,.10); }
.flash--error{ background: rgba(239,68,68,.10); }

/* ---------------------------
   Gallery
--------------------------- */
.galleryGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:12px;
}
.gItem{
  border-radius: 18px;
  overflow:hidden;
  border: 1px solid var(--line);
  background: var(--card);
}
.gItem img{
  width:100%;
  height:180px;
  object-fit: cover;
}
@media (min-width: 860px){
  .galleryGrid{ grid-template-columns: 1fr 1fr 1fr; }
  .gItem img{ height:220px; }
}

/* ---------------------------
   Footer
--------------------------- */
.footer{
  padding: 36px 0;
  padding-bottom: calc(36px + 74px);
  border-top: 1px solid var(--line);
  background: var(--bg2);
}
.connect{
  text-align:center;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:16px;
}
.connect__title{ margin:0; font-size:1.35rem; }
.footer__copy{ margin:0; color:var(--muted); font-size:.98rem; }

.social{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:14px;
  flex-wrap:wrap;
}
.social__btn{
  width:56px;
  height:56px;
  border-radius:999px;
  border:1px solid var(--line);
  background: var(--btn2);
  display:grid;
  place-items:center;
  transition: transform .15s ease, background .15s ease;
}
.social__btn:hover{ transform: translateY(-2px); background: var(--btn); }

.social__img{
  width:22px;
  height:22px;
  display:block;
  opacity:.92;
}

/* If SVGs are black, invert them on dark mode */
html[data-theme="dark"] .social__img{ filter: invert(1); opacity:.9; }
html[data-theme="light"] .social__img{ filter: none; }

/* =========================================================
   SRK Honda style MOBILE DROPDOWN (Fixes your screenshot)
   HTML must be:
   #mobileNav (overlay)
     .hnav (panel)
       .hnav__close, .hnav__title
       .hnav__list
         a.hnav__item
========================================================= */

/* overlay */
#mobileNav{
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 92px 16px 16px;
  background: rgba(0,0,0,.22);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* show overlay only when not hidden */
#mobileNav:not([hidden]){
  display:flex !important;
  justify-content:center;
  align-items:flex-start;
}

/* panel */
#mobileNav .hnav{
  width: 100%;
  max-width: 440px;
  background: var(--menuCard);
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 26px 18px 18px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: menuDrop .22s ease;
}
@keyframes menuDrop{
  from{ transform: translateY(-10px); opacity:0; }
  to{ transform: translateY(0); opacity:1; }
}

/* close */
#mobileNav .hnav__close{
  position:absolute;
  right:16px;
  top:14px;
  width:44px;
  height:44px;
  border-radius: 14px;
  border:1px solid var(--line);
  background: var(--btn2);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  display:grid;
  place-items:center;
  cursor:pointer;
}

/* title */
#mobileNav .hnav__title{
  font-weight: 950;
  font-size: 1.10rem;
  margin: 0 0 12px;
  letter-spacing: .2px;
}

/* list */
#mobileNav .hnav__list{
  display:flex;
  flex-direction:column;
  gap:16px;
  margin: 8px 4px 0;
  padding:0;
}

/* buttons */
#mobileNav .hnav__item{
  display:block;
  width:100%;
  text-align:center;
  padding: 18px 16px;
  border-radius: 999px;
  border:1px solid transparent;
  font-weight: 950;
  font-size: 1.12rem;
  background: transparent;
  color: var(--text);
  transition: background .15s ease, transform .15s ease, border-color .15s ease;
}
#mobileNav .hnav__item:hover{
  background: var(--btn2);
  border-color: var(--line);
  transform: translateY(-1px);
}
#mobileNav .hnav__item--active{
  background: linear-gradient(135deg, rgba(59,130,246,.96), rgba(167,139,250,.96));
  color:#fff;
  border-color: rgba(255,255,255,.18);
}

/* footer text */
#mobileNav .hnav__foot{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align:center;
  color: var(--muted);
  font-weight: 750;
}

/* hide drawer on desktop */
@media (min-width: 860px){
  #mobileNav{ display:none !important; }
  .footer{ padding-bottom: 36px; }
}

/* ---------------------------
   Sticky bottom bar (mobile)
--------------------------- */
.bottombar{
  position: fixed;
  left:0; right:0;
  bottom:0;
  z-index: 900;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg2) 76%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display:flex;
  justify-content:center;
}

.bottombar__btn{
  flex:1;
  max-width: 240px;
  margin: 0 6px;
  padding: 12px 10px;
  border-radius: 999px;
  text-align:center;
  font-weight: 950;
  border: 1px solid var(--line);
  background: var(--btn2);
  display:flex;
  gap:8px;
  justify-content:center;
  align-items:center;
}

.bottombar__btn--primary{
  background: linear-gradient(135deg, rgba(59,130,246,.96), rgba(167,139,250,.96));
  color:#fff;
  border-color: rgba(255,255,255,.18);
}

.bottombar__ico{ font-size: 1.05rem; }

@media (min-width: 860px){
  .bottombar{ display:none; }
}

/* =========================================================
   Mobile: Center logo in header
========================================================= */
@media (max-width: 859px){
  .header__inner{
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 0;
  }

  .brand--image{
    margin: 0 auto;
    width: 100%;
    max-width: 520px;
    display: flex;
    justify-content: center;
  }

  .brand--image img{
    width: min(520px, 92vw);
    max-height: 70px;
    margin: 0 auto;
  }
}

/* center the mobile quickbar row */
@media (max-width: 859px){
  .quickbar--mobile .quickbar__inner{
    justify-content:center;
  }
}

/* =========================================================
   Light Theme: Install button text BLACK (force)
========================================================= */
html[data-theme="light"] #installBtn,
html[data-theme="light"] #installBtn_m,
html[data-theme="light"] #installBtn *,
html[data-theme="light"] #installBtn_m *{
  color:#000 !important;
  -webkit-text-fill-color:#000 !important;
}