@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Libre+Caslon+Text:ital,wght@0,400;0,700;1,400&display=swap');

/* ═══════════════════════════════════════════════
   DESIGN TOKENS
   ═══════════════════════════════════════════════ */
:root {
  --clr-primary: #2c3e50;
  --clr-primary-l: #3d566e;
  --clr-surface: #ffffff;
  --clr-surface-alt: #f3f2ef;
  --clr-border: #e4e2dc;
  --clr-text: #1c1c2e;
  --clr-text-2: #55556a;
  --clr-text-3: #8a8a9a;
  --clr-accent: #bf8f4e;
  --topbar-h: 60px;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--clr-text);
  background-color: var(--clr-surface-alt);
  line-height: 1.6;
  font-size: 1rem;
}

html {
  scroll-padding-top: calc(var(--topbar-h) + 10px);
}

a {
  text-decoration: none;
}

/* ═══════════════════════════════════════════════
   TOPBAR (mobile only — hidden on desktop)
   ═══════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background-color: var(--clr-primary);
  color: white;
  display: grid;
  grid-template-columns: 50px 1fr 50px;
  align-items: center;
  padding: 0 1rem;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.topbar h1 {
  font-family: 'Inter', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: white;
  text-align: center;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#menu-btn {
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: white;
  justify-self: start;
}

/* ═══════════════════════════════════════════════
   SIDENAV (hamburger menu / desktop sidebar)
   ═══════════════════════════════════════════════ */
.sidenav {
  height: 100%;
  width: 0;
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  background-color: var(--clr-surface);
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transition: width 0.35s ease;
}

.sidenav .closebtn {
  display: flex;
  justify-content: flex-end;
  padding: 16px 20px 10px 20px;
  font-size: 28px;
  color: var(--clr-text-3);
  cursor: pointer;
  position: sticky;
  top: 0;
  background: var(--clr-surface);
  z-index: 1;
}

.sidenav a {
  padding: 8px 8px 8px 32px;
  text-decoration: none;
  font-size: 15px;
  color: var(--clr-text-2);
  font-weight: 500;
  display: block;
  transition: color 0.2s;
}

.sidenav a:hover {
  color: var(--clr-accent);
}

.sidenav-back {
  color: var(--clr-accent) !important;
  font-weight: bold !important;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 10px;
  padding-bottom: 16px;
  white-space: nowrap;
}

.nav-divider {
  border-top: 1px solid var(--clr-border);
  margin: 10px 0;
  opacity: 0.5;
}

.nav-label {
  display: block;
  padding: 2px 32px 6px 32px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--clr-text-3);
  text-transform: uppercase;
  font-family: 'Inter', sans-serif;
}

.icon {
  margin-right: 10px;
  font-style: normal;
}

/* Submenus */
.submenu {
  display: none;
  margin-left: 2rem;
}
.submenu.open {
  display: block;
}
.subsubsection {
  margin-left: 1rem;
}
.subsection {
  font-weight: bold;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════
   MAIN CONTENT
   ═══════════════════════════════════════════════ */
#main {
  margin-top: calc(var(--topbar-h) + 0.5rem);
  padding: 1rem;
}

/* ═══════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════ */
h1, h2, h3 {
  font-family: 'Libre Caslon Text', Georgia, serif;
  font-weight: 700;
  color: var(--clr-primary);
}

h2 {
  font-size: 1.55rem;
  margin-bottom: 0.8rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--clr-accent);
}

h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--clr-border);
}

h4 {
  font-family: 'Inter', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--clr-text-2);
}

p {
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
  font-size: 1.1em;
  line-height: 1.7;
}

img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 20px;
}

hr {
  border: none;
  border-top: 1px solid var(--clr-border);
  margin: 2.5rem 0;
}

/* ═══════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════ */
section {
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  padding: 2rem 1rem;
  margin-bottom: 20px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

/* ═══════════════════════════════════════════════
   PROFILE
   ═══════════════════════════════════════════════ */
.profile-container {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid var(--clr-accent);
  object-fit: cover;
}

/* ═══════════════════════════════════════════════
   BUTTONS — Discrete Pill Style
   ═══════════════════════════════════════════════ */
.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-primary);
  background-color: #e8f0fe;
  border: 1px solid #c4d7f2;
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 8px 0;
}
.btn-maps:hover {
  background-color: var(--clr-primary);
  color: white;
  border-color: var(--clr-primary);
}

.btn-external {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--clr-primary);
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-primary);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 8px 0;
}
.btn-external:hover {
  background-color: var(--clr-primary);
  color: white;
}

/* Legacy button (kept for any remaining <button> elements) */
button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px 20px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  text-align: center;
  margin: 10px 0;
  box-sizing: border-box;
  text-decoration: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}
button .icon { margin-right: 10px; font-size: 1.3em; }
button.blue { background-color: var(--clr-primary); color: white; }
button.blue:hover { background-color: var(--clr-primary-l); }
button.green { background-color: #25D366; color: white; }

.wa-svg { width: 20px; height: 20px; fill: currentColor; flex-shrink: 0; margin-right: 8px; }

/* ═══════════════════════════════════════════════
   APARTMENT TABLEVIEW
   ═══════════════════════════════════════════════ */
.apt-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.apt-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  transition: background-color 0.15s, box-shadow 0.15s;
}
.apt-row:hover {
  background-color: var(--clr-surface-alt);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.apt-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  margin: 0;
}
.apt-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.apt-name {
  font-family: 'Inter', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--clr-text);
}
.apt-desc {
  font-size: 0.82rem;
  color: var(--clr-text-3);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
}
.apt-chevron {
  font-size: 1.4rem;
  color: var(--clr-text-3);
  flex-shrink: 0;
  font-weight: 300;
}

/* ═══════════════════════════════════════════════
   SOS / EMERGENCY TABLEVIEW
   ═══════════════════════════════════════════════ */
.sos-list {
  display: flex;
  flex-direction: column;
  margin: 12px 0 20px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
}
.sos-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid var(--clr-border);
  transition: background-color 0.2s ease;
}
.sos-row:last-child {
  border-bottom: none;
}
.sos-row:hover {
  background-color: var(--clr-primary);
}
.sos-row:hover strong {
  color: white;
}
.sos-row:hover .sos-detail {
  color: rgba(255, 255, 255, 0.8);
}
.sos-icon {
  font-size: 1.6rem;
  flex-shrink: 0;
  width: 36px;
  text-align: center;
}
.sos-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.sos-info strong {
  font-size: 0.95rem;
  color: var(--clr-text);
  transition: color 0.2s ease;
}
.sos-detail {
  font-size: 0.82rem;
  color: var(--clr-text-3);
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  transition: color 0.2s ease;
}
.sos-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-left: 10px;
}
.sos-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: #f0f4f8;
  border: 1px solid #d0dbe5;
  font-size: 1.15rem;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.sos-action-btn:hover {
  background-color: #e1ecf7;
  border-color: #b0c9e0;
  transform: scale(1.08);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ═══════════════════════════════════════════════
   CAROUSEL
   ═══════════════════════════════════════════════ */
.carousel-container {
  position: relative;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background-color: #f0f0f0;
}
.slides-wrapper {
  display: flex;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.slides-wrapper::-webkit-scrollbar {
  display: none;
}
.slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  text-align: center;
}
.slide img {
  width: 100%;
  aspect-ratio: 4 / 3;
  height: auto;
  object-fit: cover;
  border-radius: 0;
}
.prev-button,
.next-button {
  cursor: pointer;
  position: absolute;
  top: 50%;
  width: auto;
  padding: 16px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  font-size: 18px;
  transition: 0.3s ease;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
  z-index: 2;
  border-radius: 3px;
}
.next-button { right: 0; border-radius: 3px 0 0 3px; }
.prev-button { left: 0;  border-radius: 0 3px 3px 0; }
.prev-button:hover, .next-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}
.dots-container {
  text-align: center;
  padding: 10px 0;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(255, 255, 255, 0.7);
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}
.dot {
  cursor: pointer;
  height: 10px;
  width: 10px;
  margin: 0 4px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}
.dot.active, .dot:hover {
  background-color: #717171;
}

/* ═══════════════════════════════════════════════
   FAQ ACCORDION
   ═══════════════════════════════════════════════ */
.faq-container {
  margin-top: 25px;
}
.faq-item {
  background-color: #f8f8f8;
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}
.faq-item:hover {
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}
.faq-question {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1.15em;
  background-color: #f2f2f2;
  border-bottom: 1px solid #e9e9e9;
  position: relative;
  transition: background-color 0.3s ease;
  color: #333;
}
.faq-question:hover { background-color: #e5e5e5; }
.faq-question::before { content: '❔'; margin-right: 12px; font-size: 1.2em; }
.faq-question::after { content: '▼'; font-size: 0.8em; margin-left: auto; transition: transform 0.3s ease; }
.faq-item[open] .faq-question { background-color: var(--clr-surface); color: #0056b3; }
.faq-item[open] .faq-question::before { content: '💡'; }
.faq-item[open] .faq-question::after { content: '▲'; }
.faq-answer {
  padding: 15px 25px;
  background-color: #ffffff;
  border-top: 1px solid #f0f0f0;
  font-size: 1em;
  line-height: 1.6;
  color: #555;
}

/* ═══════════════════════════════════════════════
   WHATSAPP FAB
   ═══════════════════════════════════════════════ */
.fab-whatsapp {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25D366;
  color: white;
  height: 55px;
  padding: 0 18px;
  border-radius: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4);
  z-index: 1000;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.2s ease, opacity 0.3s ease, visibility 0.3s ease;
  opacity: 1;
  visibility: visible;
}
.fab-whatsapp.fab-hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  visibility: hidden;
  pointer-events: none;
}
.fab-whatsapp:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}
.fab-whatsapp svg {
  width: 28px;
  height: 28px;
  fill: white;
  flex-shrink: 0;
}
.fab-label {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   GUIDE FOOTER
   ═══════════════════════════════════════════════ */
.guide-footer {
  background-color: var(--clr-primary);
  color: white;
  padding: 2rem 1.5rem 1rem;
  margin-top: 2rem;
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin: 0 auto;
}
.footer-photo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--clr-accent);
  flex-shrink: 0;
  margin: 0;
}
.footer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.footer-name {
  font-size: 1.1rem;
  color: white;
}
.footer-role {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
}
.footer-text {
  font-size: 0.9rem;
  line-height: 1.5;
  color: rgba(255,255,255,0.85);
  margin-top: 6px;
  /* Reset global p styles */
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}
.footer-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.footer-actions .btn-maps {
  color: white;
  background-color: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
}
.footer-actions .btn-maps:hover {
  background-color: white;
  color: var(--clr-primary);
  border-color: white;
}
.footer-copy {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255,255,255,0.15);
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
}
.footer-copy .footer-domain {
  color: var(--clr-accent);
  font-weight: 600;
}

@media (max-width: 480px) {
  .footer-inner {
    flex-direction: column;
    text-align: center;
  }
  .footer-actions {
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════
   RESPONSIVE — Mobile ≤600px
   ═══════════════════════════════════════════════ */
@media (max-width: 600px) {
  .fab-whatsapp {
    width: 55px;
    height: 55px;
    padding: 0;
    border-radius: 50%;
    justify-content: center;
  }
  .fab-label { display: none; }
  .fab-whatsapp svg { width: 30px; height: 30px; }
}

/* ═══════════════════════════════════════════════
   DESKTOP SIDEBAR LAYOUT (≥900px)
   ═══════════════════════════════════════════════ */
@media (min-width: 900px) {
  .topbar {
    display: none;
  }

  .sidenav {
    width: 260px !important;
    transform: none !important;
    padding-top: 20px;
    margin: 20px;
    height: calc(100vh - 40px);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    border-right: none;
    background-color: white;
  }

  .sidenav .closebtn {
    display: none;
  }

  #main {
    margin-top: 0;
    margin-left: 310px;
    padding: 40px;
    max-width: 850px;
  }

  .sidenav::before {
    content: "📖 GUÍA DE MUROS";
    display: block;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--clr-primary);
    padding: 0 20px 20px 20px;
    border-bottom: 1px solid var(--clr-border);
    margin-bottom: 15px;
  }

  .guide-footer {
    margin-left: 310px;
    margin-right: 40px;
    margin-bottom: 40px;
    max-width: 850px;
    border-radius: 12px;
    padding: 2rem;
  }
}
