@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Sacramento&family=Material+Icons+Round&family=Material+Symbols+Rounded:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  --bg-color: #ffffff;
  --text-main: #111111;
  --text-muted: #6f7477;
  --border-color: #e5e5e5;
  --card-bg: #ffffff;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.14);
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-logo: 'Sacramento', cursive;
  --sidebar-width: clamp(220px, 19vw, 350px);
  --gutter: clamp(24px, 4vw, 76px);
  --font-scale: clamp(14px, 1.05vw, 15.5px);
}

[data-theme="dark"] {
  --bg-color: #0c0c0e;
  --text-main: #f5f5f7;
  --text-muted: #9e9ea0;
  --border-color: #26262a;
  --card-bg: #161619;
  --card-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --card-shadow-hover: 0 18px 40px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: var(--font-scale);
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--text-main);
  color: var(--bg-color);
  padding: 8px;
  z-index: 1000;
}
.skip-link:focus {
  top: 0;
}

/* MOBILE HEADER */
.mobile-header {
  display: none;
}

@media (max-width: 900px) {
  .mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
  }
  .mobile-menu-button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
  }
  .mobile-wordmark {
    font-family: var(--font-logo);
    font-size: 2.2rem;
    color: var(--text-main);
    background: none;
    border: none;
    cursor: pointer;
  }
}

/* SHELL & SIDEBAR FIXA NA TELA */
.home-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  flex-shrink: 0;
  padding: clamp(32px, 4vw, 60px) clamp(20px, 2.5vw, 40px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  background: var(--bg-color);
  overflow-y: auto;
  z-index: 100;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.sidebar-mobile-head {
  display: none;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.home-link {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: clamp(1.4rem, 1.8vw, 2.1rem);
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  padding-bottom: 10px;
  border-bottom: 2px solid transparent;
}
.home-link.is-active {
  color: var(--text-main);
}

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.2vw, 1.35rem);
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-transform: lowercase;
}

.nav-chevron {
  transition: transform 0.2s ease;
}
.nav-group:not(.is-open) .nav-chevron {
  transform: rotate(180deg);
}
.nav-group:not(.is-open) .nav-group-links {
  display: none;
}

.nav-group-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 8px;
}

.nav-group-links button {
  background: none;
  border: none;
  text-align: left;
  font-family: var(--font-body);
  font-size: clamp(0.92rem, 1vw, 1.15rem);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  transition: color 0.15s ease;
}
.nav-group-links button:hover {
  color: var(--text-main);
}

.account-nav {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.account-nav span {
  font-size: clamp(0.9rem, 0.95vw, 1.1rem);
  font-weight: 700;
  color: var(--text-main);
}
.account-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: clamp(0.9rem, 0.95vw, 1.1rem);
}
.account-nav a:hover {
  color: var(--text-main);
}

/* MAIN CONTENT AREA (OFFSET PARA SIDEBAR FIXA) */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  padding: clamp(30px, 4vw, 60px) var(--gutter);
  display: flex;
  flex-direction: column;
  gap: clamp(40px, 5vw, 70px);
}

.desktop-wordmark {
  font-family: var(--font-logo);
  font-size: clamp(3.5rem, 5vw, 5.5rem);
  color: var(--text-main);
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  line-height: 1;
  margin-bottom: -10px;
}

/* SEARCH HERO */
.search-hero {
  width: 100%;
  max-width: clamp(550px, 55vw, 850px);
}

.search-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-pill {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--bg-color);
  border: 1.5px solid var(--text-main);
  border-radius: 999px;
  padding: 6px 20px;
}

#search-input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.1vw, 1.25rem);
  color: var(--text-main);
  padding: 10px 0;
}
#search-input::placeholder {
  color: var(--text-muted);
}

.search-submit {
  width: clamp(48px, 4vw, 58px);
  height: clamp(48px, 4vw, 58px);
  border-radius: 50%;
  background: var(--text-main);
  color: var(--bg-color);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.search-submit:hover {
  transform: scale(1.05);
}

.search-feedback {
  margin-top: 10px;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* DIRECTORY SECTIONS & CAROUSELS */
.directory-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.section-heading h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.section-heading p {
  font-size: clamp(0.95rem, 1.1vw, 1.2rem);
  color: var(--text-muted);
  max-width: 680px;
}

.carousel {
  position: relative;
  width: 100%;
  background: transparent;
  overflow: visible;
}

.card-track {
  display: flex;
  gap: clamp(20px, 2.4vw, 36px);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding: 24px 30px 80px 30px;
  margin: 0;
  scroll-padding-inline: 30px;
}
.card-track::-webkit-scrollbar {
  display: none;
}

.carousel-next {
  position: absolute;
  right: -10px;
  top: 42%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease, background 0.2s ease;
}
.carousel-next:hover {
  transform: translateY(-50%) scale(1.08);
}

/* DIRECTORY CARDS — SOMBRAS PROJETADAS ESCURAS, VISÍVEIS E SEM CORTE DE OVERFLOW */
.directory-card {
  flex: 0 0 clamp(280px, 24vw, 320px);
  height: clamp(360px, 32vw, 400px);
  scroll-snap-align: start;
  background: #b8b8b8;
  border-radius: 26px;
  overflow: hidden;
  position: relative;
  border: none;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.directory-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 36px 70px rgba(0, 0, 0, 0.32), 0 12px 28px rgba(0, 0, 0, 0.16);
}

.directory-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #b8b8b8;
  z-index: 1;
}

/* CAIXA BRANCA FLUTUANTE NO RODA PÉ DO CARD (RÉPLICA FIEL DO MOCKUP) */
.directory-card-info,
.directory-card-content {
  position: relative;
  z-index: 2;
  margin: 10px;
  background: #ffffff;
  border-radius: 20px;
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 3px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
  width: calc(100% - 20px);
  box-sizing: border-box;
}

/* TÍTULO DO CARD (H3) — PRETO PROEMINENTE */
.directory-card-info h3,
.directory-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111111;
  opacity: 1;
  text-align: left;
  letter-spacing: -0.015em;
  margin: 0 0 2px 0;
}

/* LEGENDA / SUBTÍTULO DO CARD (P) — CINZA SUTIL */
.directory-card-info p,
.directory-card-description {
  font-size: 0.78rem;
  font-weight: 500;
  color: #8e8e93;
  opacity: 0.9;
  line-height: 1.35;
  text-align: left;
  margin: 0 0 2px 0;
}

/* ENDEREÇO DO CARD — CINZA COMPACTO */
.directory-card-info .card-address,
.directory-card-footer {
  font-size: 0.78rem;
  font-weight: 500;
  color: #8e8e93;
  opacity: 0.9;
  text-align: left;
  margin: 0 0 8px 0;
}

/* AVALIAÇÃO / ESTRELAS DOURADAS IGUAIS AO MOCKUP */
.rating {
  display: flex;
  align-items: center;
  gap: 2px;
  color: #ffb400;
}

.rating .material-icons-round {
  font-size: 1.2rem;
  color: #ffb400;
}

.rating-muted {
  color: #d1d1d6 !important;
  opacity: 0.7;
}

/* LINHA INFERIOR DO CARD COM AVALIAÇÃO E BOTAO VER PERFIL */
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid #f2f2f4;
  width: 100%;
}

.card-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #111111;
  background: #f4f4f6;
  padding: 4px 10px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.card-profile-link span.material-symbols-rounded {
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.directory-card:hover .card-profile-link {
  background: #111111;
  color: #ffffff;
}

.directory-card:hover .card-profile-link span.material-symbols-rounded {
  transform: translateX(3px);
}

/* SEÇÃO CENTRALIZADA IGUAL AO MOCKUP */
.architecture-section {
  margin-top: 30px;
}

.architecture-section .section-heading {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
}

.architecture-section .section-heading h2 {
  font-size: clamp(1.8rem, 2.5vw, 2.4rem);
  font-weight: 700;
  color: #111111;
  text-align: center;
}

.architecture-section .section-heading p {
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  color: #8e8e93;
  max-width: 680px;
  text-align: center;
  line-height: 1.5;
}

/* MODAL DIALOG & TOAST */
.profile-dialog {
  margin: auto;
  border: none;
  border-radius: 24px;
  background: var(--card-bg);
  color: var(--text-main);
  padding: 0;
  width: min(500px, 92vw);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
.profile-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.dialog-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--bg-color);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#dialog-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.dialog-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dialog-type {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

#profile-dialog-title {
  font-size: 1.6rem;
  font-weight: 700;
}

#dialog-description {
  font-size: 1rem;
  color: var(--text-muted);
}

.dialog-address {
  font-size: 0.9rem;
  font-weight: 600;
}

.dialog-action {
  margin-top: 10px;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  background: var(--text-main);
  color: var(--bg-color);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.dialog-action:hover {
  opacity: 0.9;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-main);
  color: var(--bg-color);
  padding: 14px 24px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  z-index: 300;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* RESPONSIVE LAYOUT FOR TABLETS & MOBILES */
@media (max-width: 900px) {
  .home-shell {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    height: 100vh;
    width: 280px;
    z-index: 200;
    transition: left 0.3s ease;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
  }
  .sidebar.is-open {
    left: 0;
  }

  .sidebar-mobile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.2rem;
    font-weight: 700;
  }
  #sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-main);
  }

  .sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 150;
    border: none;
  }

  .desktop-wordmark {
    display: none;
  }

  .main-content {
    margin-left: 0;
    padding: 24px 20px 60px;
    gap: 40px;
  }

  .directory-card {
    flex: 0 0 280px;
  }
}
