:root{
  --text:#0f172a;
  --muted:#64748b;
  --bg:#ffffff;
  --soft:#f8fafc;
  --border:#e2e8f0;
  --primary:#2563eb;
  --radius:16px;
  --radius-sm:12px;
  --shadow: 0 10px 30px rgba(0,0,0,.08);
  --shadow2: 0 6px 16px rgba(0,0,0,.10);
  --max: 1120px;
}

*{ box-sizing: border-box; }

html, body{
  margin:0;
  padding:0;
  font-family: Roboto, system-ui, -apple-system, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Card buscador (tu HTML usa .revalia-search-card) */
.revalia-search-card{
  background:#fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow2);
  padding: 12px;
}

.revalia-search-card p{
  margin: 0 0 8px 0;
  font-weight: 800;
}

#place-autocomplete-card gmp-place-autocomplete{
  width: 100%;
}

/* Mapa */
.revalia-map-wrap{
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #fff;
}

#confirma-ficha{
  scroll-margin-top: 84px;
}

#map{
  width: 100%;
  height: 420px; /* mobile-first */
}

/* =========================================
   Sidebar Revalia
   HTML: <div class="revalia-sidebar" id="sidebar">
   ========================================= */

/* mobile-first: bottom sheet */
.revalia-sidebar{
  position: fixed;
  top: auto;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: auto;
  max-height: 85%;
  background-color: #fff;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transform: translateY(100%);
  transition: transform 0.3s ease-in-out;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  overflow-y: auto;
}

.revalia-sidebar.visible{
  transform: translateY(0);
}

.revalia-sidebar .close{
  position: absolute;
  top: 10px;
  right: 18px;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.revalia-sidebar button:disabled{
  background-color: #a8c7ff !important;
  cursor: not-allowed;
}

@media (min-width: 900px){
  #map{ height: 560px; }

  /* Desktop: sidebar lateral */
  .revalia-sidebar{
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    height: 100vh;
    width: 420px;
    max-width: 90%;
    transform: translateX(100%);
    border-radius: 0;
    box-shadow: -2px 0 18px rgba(0,0,0,.18);
    overflow-y: auto;
    padding: 28px;
  }

  .revalia-sidebar.visible{
    transform: translateX(0);
  }

  .revalia-sidebar .close{
    position: sticky;
    top: 8px;
    align-self: flex-end;
    z-index: 1;
    background: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
  }
}

/* =========================================================
   NAVBAR: siempre visible + FIX layout (CTA + hamburger)
   - Desktop: menú + CTA a la derecha
   - Mobile: CTA antes del hamburger, hamburger al extremo derecho
   - Logo: tamaños distintos en mobile/desktop (override height="80")
   ========================================================= */

/* Header siempre fijo */
#topnav{
  position: fixed !important;
  top: 0 !important;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 9998; /* debajo de sidebar */
  background: #ffffff !important;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08) !important;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8) !important;
}

/* Asegura que el menú no se "oculte" por clases internas de Landrick */
#topnav.defaultscroll{
  top: 0 !important;
}

/* Mantén links legibles */
#topnav .navigation-menu > li > a{
  opacity: 1 !important;
}

/* Compensa espacio del navbar fijo */
body{
  padding-top: 84px;
}
@media (max-width: 991px){
  body{ padding-top: 90px; }
}

/* ====== Layout base del navbar (flex controlado) ====== */
#topnav .container{
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 12px !important;
}

/* Logo */
#topnav .logo{
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  line-height: 1 !important;
}

/* Override size logo (desktop default) */
#topnav .logo img{
  height: 56px !important;
  width: auto !important;
  max-width: 220px !important;
  object-fit: contain !important;
}

/* Menú (navigation) */
#topnav #navigation{
  flex: 0 0 auto !important;
}

/* CTA */
#topnav .buy-button{
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Hamburger (menu-extras) SIEMPRE al extremo derecho */
#topnav .menu-extras{
  flex: 0 0 auto !important;
  margin-left: auto !important;
  display: flex !important;
  align-items: center !important;
}

/* ====== MOBILE (≤991px) ======
   Orden: Logo | CTA | Hamburger (derecha)
*/
@media (max-width: 991px){
  /* Logo más pequeño */
  #topnav .logo img{
    height: 70px !important;
    max-width: 140px !important;
  }

  /* Compacta altura del header */
  #topnav{
    padding-top: 8px !important;
    padding-bottom: 8px !important;
  }

  /* CTA va antes del hamburger, pegado a la derecha */
  #topnav .buy-button{
    order: 2 !important;
    margin-left: auto !important;      /* empuja CTA hacia derecha */
    margin-right: 10px !important;     /* aire antes del hamburger */
  }

  /* Hamburger al extremo derecho */
  #topnav .menu-extras{
    order: 3 !important;
    margin-left: 0 !important;
  }

  /* CTA compacto */
  #topnav .buy-button .btn{
    padding: 10px 12px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    border-radius: 10px !important;
    white-space: nowrap !important;
  }

  /* Evita saltos raros */
  #topnav .container{
    flex-wrap: nowrap !important;
  }
}

/* ====== DESKTOP (≥992px) ======
   Menú a la derecha, CTA al extremo derecho
*/
@media (min-width: 992px){
  /* Empuja menú a la derecha */
  #topnav #navigation{
    margin-left: auto !important;
    order: 2 !important;
  }

  /* CTA después del menú */
  #topnav .buy-button{
    order: 3 !important;
    margin-left: 18px !important;
  }

  /* En desktop el hamburger no debe mostrarse */
  #topnav .menu-extras{
    display: none !important;
  }

  /* Logo más grande en desktop */
  #topnav .logo img{
    height: 64px !important;
    max-width: 260px !important;
  }

  /* CTA más “desktop” */
  #topnav .buy-button .btn{
    padding: 10px 18px !important;
    font-size: 15px !important;
    white-space: nowrap !important;
  }
}

/* Desktop grande */
@media (min-width: 1200px){
  #topnav .logo img{
    height: 72px !important;
    max-width: 300px !important;
  }
}

/* =========================================================
   FIX: “barra azul” en mobile (shape del hero Landrick)
   Causa típica: pseudo-elementos de .bg-saas-shape que
   se posicionan absolute y se desbordan en pantallas chicas.
   ========================================================= */

/* Evita cualquier scroll/artefacto horizontal */
html, body{
  overflow-x: hidden;
}

/* Mobile: apaga el shape del hero y evita overflow */
@media (max-width: 991px){

  /* Contenedor de la imagen del hero: que no genere overflow */
  .classic-saas-image,
  .classic-saas-image *{
    max-width: 100% !important;
  }

  /* El “shape” azul suele vivir en pseudo-elementos */
  .bg-saas-shape::before,
  .bg-saas-shape::after{
    display: none !important;
    content: none !important;
  }

  /* Por si el shape no es pseudo-elemento sino background directo */
  .bg-saas-shape{
    background: transparent !important;
    box-shadow: none !important;
    overflow: hidden !important;
  }

  /* Si aún aparece, normalmente es por posicionamiento absoluto dentro */
  .classic-saas-image{
    overflow: hidden !important;
  }
}
