/* ===================================================================
   V-RealEstate — Shared Styles
   Design System: Heritage Trust Interface
   Bổ sung cho TailwindCSS CDN (config inline trong mỗi page)
   =================================================================== */

/* 1. Design Tokens / CSS Variables */
:root {
  --color-primary: #006241;
  --color-primary-dark: #00482f;
  --color-primary-container: #006241;
  --color-status-sale: #e03c31;
  --color-status-rent: #007aff;
  --color-background: #fcf9f8;
  --color-surface: #fcf9f8;
  --color-surface-lowest: #ffffff;
  --color-surface-container-low: #f6f3f2;
  --color-on-surface: #1b1c1c;
  --color-on-surface-variant: #3f4943;
  --color-outline: #6f7a72;
  --color-border: #e8eaeb;
  --color-error: #ba1a1a;

  --font-family:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --spacing-unit: 4px;
  --spacing-xs: 8px;
  --spacing-sm: 12px;
  --spacing-md: 16px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --header-height: 56px;
  --container-max: 1400px;
}

/* 2. Custom Logo Styles */
.custom-logo-link {
  display: flex;
  align-items: center;
  height: 100%;
}

.custom-logo {
  height: 32px;
  width: auto;
  max-width: 200px;
  object-fit: contain;
}

/* 3. Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-on-surface);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Main nav links: consistent bold color across all states (override UA :visited) */
[data-nav-menu] a,
[data-nav-menu] a:link,
[data-nav-menu] a:visited,
[data-nav-menu] a:hover,
[data-nav-menu] a:active {
  color: var(--color-on-surface-variant);
  font-weight: 600;
}

/* Footer links: inherit the muted-white color in all states; only highlight on hover */
#colophon a:link,
#colophon a:visited,
#colophon a:active {
  color: inherit;
}
#colophon a:hover {
  color: #a2f3c8; /* primary-fixed */
}

/* Contact action buttons: keep their text color in every link state
   (override UA :visited/:active which otherwise recolor tel:/zalo links). */
.btn-contact-call,
.btn-contact-call:link,
.btn-contact-call:visited,
.btn-contact-call:hover,
.btn-contact-call:focus,
.btn-contact-call:active {
  color: #fff;
}
.btn-contact-zalo,
.btn-contact-zalo:link,
.btn-contact-zalo:visited,
.btn-contact-zalo:hover,
.btn-contact-zalo:focus,
.btn-contact-zalo:active {
  color: var(--color-on-surface);
}

/* Saved-project button active state */
.save-project-btn.is-saved {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* Project description WYSIWYG content (restores typography stripped by Tailwind preflight) */
.project-prose {
  line-height: 1.75;
}
.project-prose > *:first-child {
  margin-top: 0;
}
.project-prose p {
  margin: 0 0 1rem;
}
.project-prose h2,
.project-prose h3,
.project-prose h4 {
  color: var(--color-on-surface);
  font-weight: 600;
  line-height: 1.4;
  margin: 1.75rem 0 0.75rem;
}
.project-prose h2 {
  font-size: 20px;
}
.project-prose h3 {
  font-size: 18px;
}
.project-prose h4 {
  font-size: 16px;
}
.project-prose ul,
.project-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}
.project-prose ul {
  list-style: disc;
}
.project-prose ol {
  list-style: decimal;
}
.project-prose li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}
.project-prose li::marker {
  color: var(--color-primary);
}
.project-prose a {
  color: var(--color-primary);
  text-decoration: underline;
}
.project-prose strong {
  font-weight: 600;
  color: var(--color-on-surface);
}
.project-prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--color-on-surface-variant);
}
.project-prose img {
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
  margin: 1rem 0;
}
.project-prose > *:last-child {
  margin-bottom: 0;
}
/* Collapsed description clamp height (JS overrides max-height inline for smooth animation) */
#project-desc-wrap.is-collapsed {
  max-height: 280px;
}

/* Quote form inputs on the green card — override @tailwindcss/forms base (padding,
   text color, blue focus ring) which otherwise wins via layer order. */
#project-contact-form input[type="text"],
#project-contact-form input[type="tel"],
#project-contact-form input[type="email"] {
  padding: 12px 16px;
  color: #fff;
  caret-color: #fff;
  font-size: 15px;
}
#project-contact-form input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}
#project-contact-form input:focus {
  outline: none;
  box-shadow: none;
  border-color: #fff;
  background-color: rgba(255, 255, 255, 0.18);
}

/* Contact-request modal fields */
.quote-modal-input {
  padding: 12px 16px;
  color: var(--color-on-surface);
  font-size: 15px;
  background-color: #fff;
}
.quote-modal-input::placeholder {
  color: var(--color-outline);
}
.quote-modal-input:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--color-primary);
}

/* 3. Material Symbols Icon Base */
.material-symbols-outlined {
  font-variation-settings:
    "FILL" 0,
    "wght" 400,
    "GRAD" 0,
    "opsz" 24;
  display: inline-block;
  line-height: 1;
  text-transform: none;
  letter-spacing: normal;
  word-wrap: normal;
  white-space: nowrap;
  direction: ltr;
}

/* 4. Scrollbar Utilities */
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}

.hide-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* 5. Typography Utilities (fallback nếu Tailwind config chưa load) */
.headline-lg {
  font-size: 22px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.02em;
}
.headline-lg-mobile {
  font-size: 18px;
  font-weight: 700;
  line-height: 26px;
  letter-spacing: -0.01em;
}
.headline-md {
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
}
.body-lg {
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}
.body-md {
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
}
.label-bold {
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
}
.label-sm {
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}
.price-display {
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
}

/* 6. Line clamp helpers */
.line-clamp-1,
.line-clamp-2,
.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-1 {
  -webkit-line-clamp: 1;
}
.line-clamp-2 {
  -webkit-line-clamp: 2;
}
.line-clamp-3 {
  -webkit-line-clamp: 3;
}

/* 7. Component: Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary {
  background-color: var(--color-primary);
  color: #fff;
}
.btn-primary:link,
.btn-primary:visited,
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus {
  background-color: var(--color-primary-dark);
}

/* Submit bar — top border separates action from fields (/ky-gui/, /dang-tin/) */
.real-form-submit-bar {
  margin-top: 0.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border, #e8eaeb);
  text-align: left;
}

/* Compact red submit — matches /dang-tin/ "Gửi tin đăng" */
.real-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: 36px;
  min-height: 36px;
  padding: 0 18px;
  margin: 0;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: #fff;
  background: #e35248;
  border: 1px solid #e35248;
  border-radius: 4px;
  box-shadow: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.real-btn-submit:hover {
  background: #d4453c;
  border-color: #d4453c;
  color: #fff;
}
.real-btn-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-outline {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline:hover {
  background-color: var(--color-surface-container-low);
}

/* 8. Component: Status badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}
.badge--sale {
  background-color: var(--color-status-sale);
}
.badge--rent {
  background-color: var(--color-status-rent);
}
.badge--primary {
  background-color: var(--color-primary);
}
.badge--property-icon {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-transform: uppercase;
}

/* 8b. Home projects carousel */
.projects-carousel {
  position: relative;
  padding: 0 2.25rem;
}
.projects-carousel__viewport {
  overflow: hidden;
}
.projects-carousel__track {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.projects-carousel__track::-webkit-scrollbar {
  display: none;
}
.projects-carousel__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}
@media (min-width: 640px) {
  .projects-carousel__slide {
    flex: 0 0 calc(50% - 0.5rem);
  }
}
@media (min-width: 1024px) {
  .projects-carousel__slide {
    flex: 0 0 calc(25% - 0.75rem);
  }
}
.projects-carousel__nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  color: var(--color-outline);
  background: transparent;
  border: none;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 0.2s ease;
}
.projects-carousel__nav:hover {
  color: var(--color-primary);
}
.projects-carousel__nav--prev {
  left: 0;
}
.projects-carousel__nav--next {
  right: 0;
}
.projects-carousel__nav.hidden {
  display: none;
}

/* News carousel: 3 cards on desktop */
.news-carousel__slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  min-width: 0;
}
@media (min-width: 768px) {
  .news-carousel__slide {
    flex: 0 0 calc(50% - 0.75rem);
  }
}
@media (min-width: 1024px) {
  .news-carousel__slide {
    flex: 0 0 calc(33.333% - 1rem);
  }
}

/* 8b. Home hero — mobile search above banner */
.hero-section {
  background-color: var(--color-surface-lowest);
}
.hero-section__mobile-search {
  padding: 12px var(--spacing-md) 10px;
  background-color: var(--color-surface-lowest);
}
.hero-section__mobile-search-form {
  display: flex;
  align-items: center;
  gap: 0;
  height: 44px;
  padding: 3px 3px 3px 14px;
  background-color: var(--color-surface-lowest);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 2px rgba(27, 28, 28, 0.04);
}
.hero-section__mobile-search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--color-on-surface);
  background: transparent;
}
.hero-section__mobile-search-input::placeholder {
  color: var(--color-outline);
}
.hero-section__mobile-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  padding: 0;
  color: #fff;
  background-color: var(--color-status-sale);
  border: 0;
  border-radius: calc(var(--radius-lg) - 2px);
  cursor: pointer;
}
.hero-section__mobile-search-btn .material-symbols-outlined {
  font-size: 22px;
}
.hero-section__quick-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 12px var(--spacing-md) 16px;
  background-color: var(--color-surface-lowest);
  border-bottom: 1px solid var(--color-border);
}
.hero-section__quick-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 10px 6px;
  color: var(--color-on-surface);
  text-decoration: none;
  background-color: var(--color-surface-lowest);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
}
.hero-section__quick-link-icon {
  font-size: 30px;
  color: var(--color-primary);
}
.hero-section__quick-link-label {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

/* 8c. Home news tabs */
.home-news-section {
  background-color: var(--color-surface-lowest);
  border-bottom: 1px solid var(--color-border);
  padding: 24px 0 20px;
}
.home-featured-section {
  background-color: var(--color-surface-container-low);
  padding: 20px 0 24px;
}
@media (min-width: 768px) {
  .home-news-section {
    padding: 48px 0;
  }
  .home-featured-section {
    padding: 48px 0;
  }
  .home-featured-section__header {
    margin-bottom: 24px;
  }
}
.home-news-section__grid {
  align-items: stretch;
}
.home-news-tabs__header {
  border-bottom: 1px solid var(--color-border);
}
.home-news-tabs__nav {
  margin-bottom: -1px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.home-news-tabs__nav::-webkit-scrollbar {
  display: none;
}
.home-news-tabs__tab {
  position: relative;
  padding: 0 0 12px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--color-outline);
  white-space: nowrap;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.home-news-tabs__tab:hover {
  color: var(--color-on-surface);
}
.home-news-tabs__tab--active {
  font-weight: 700;
  color: var(--color-on-surface);
  border-bottom-color: var(--color-status-sale);
}
.home-news-tabs__tab:focus,
.home-news-tabs__tab:focus-visible {
  outline: none;
}
.home-news-tabs__more {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-status-sale);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
.home-news-tabs__more:hover,
.home-news-tabs__more:focus,
.home-news-tabs__more:active {
  text-decoration: none;
  opacity: 0.85;
}
.home-news-tabs__list {
  display: flex;
  flex-direction: column;
}
@media (min-width: 768px) {
  .home-news-tabs__list {
    min-height: 100%;
    justify-content: space-between;
  }
}
.home-news-tabs__list-item:first-child .home-news-tabs__list-link {
  padding-top: 0;
}
.home-news-tabs__list-item:last-child .home-news-tabs__list-link {
  padding-bottom: 0;
}
.home-news-tabs__list-link {
  display: block;
  padding: 14px 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--color-on-surface);
  transition: color 0.2s ease;
}
.home-news-tabs__list-link:hover {
  color: var(--color-primary);
}
.home-news-ads {
  align-self: start;
  max-width: 250px;
  width: 100%;
}
.home-news-ads__stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.home-news-ads__item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-lg);
  line-height: 0;
}
.home-news-ads__image {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

/* 8d. Home page — mobile compact layout */
@media screen and (max-width: 767px) {
  .home-news-tabs__tab {
    padding-bottom: 10px;
    font-size: 14px;
  }

  .home-news-tabs__mobile-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .home-news-tabs__mobile-item {
    border-bottom: 1px solid var(--color-border);
  }

  .home-news-tabs__mobile-item:last-child {
    border-bottom: 0;
  }

  .home-news-tabs__mobile-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    color: inherit;
    text-decoration: none;
  }

  .home-news-tabs__mobile-thumb {
    flex: none;
    width: 112px;
    height: 76px;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: var(--color-surface-container-low);
  }

  .home-news-tabs__mobile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }

  .home-news-tabs__mobile-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-outline);
    font-size: 28px;
  }

  .home-news-tabs__mobile-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    flex: 1;
  }

  .home-news-tabs__mobile-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--color-on-surface);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .home-news-tabs__mobile-time {
    font-size: 12px;
    line-height: 1.4;
    color: var(--color-outline);
  }

  .home-news-tabs__mobile-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 8px;
  }

  .home-news-tabs__mobile-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-status-sale);
    text-decoration: none;
  }

  .home-featured-section__header {
    margin-top: 0;
    margin-bottom: 16px;
  }

  .home-featured-section {
    padding-top: 20px;
    padding-bottom: 24px;
  }

  .home-news-section {
    padding-bottom: 16px;
  }

  .home-featured-section__expand .material-symbols-outlined {
    display: none;
  }

  .home-projects-section__more {
    color: var(--color-status-sale);
    text-decoration: none;
  }

  .home-projects-section .home-projects-carousel {
    padding: 0;
  }

  .home-projects-section .home-projects-carousel .projects-carousel__slide {
    flex: 0 0 78%;
  }

  .home-projects-section .home-projects-carousel .projects-carousel__nav {
    display: none;
  }

  .home-projects-section .home-projects-carousel .projects-carousel__track {
    gap: 12px;
    padding-right: 16px;
  }

  .home-projects-section .home-projects-carousel .projects-carousel__slide .p-4 {
    padding: 12px;
  }

  .home-projects-section .home-projects-carousel .projects-carousel__slide h3 {
    font-size: 15px;
  }
}

@media screen and (min-width: 768px) {
  .home-projects-section__more {
    color: var(--color-on-surface-variant);
    text-decoration: none;
  }

  .home-projects-section__more:hover {
    color: var(--color-primary);
  }
}

/* 9. Form fields — input.form-input beats style.css input[type=...] specificity */
input.form-input,
select.form-input,
textarea.form-input {
  width: 100%;
  height: 40px;
  padding: 0 var(--spacing-md);
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background-color: #fff;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

/*
 * Archive filter bars (property / project / job):
 * Mobile keeps full-width stacked controls (default .form-input width:100%).
 * Desktop: allow compact fixed widths so the toolbar sits in one sensible row.
 */
@media (min-width: 768px) {
  .archive-filter-bar select.form-input,
  .archive-filter-bar button.form-input {
    width: auto;
    flex: 0 1 auto;
    max-width: 100%;
  }

  .archive-filter-bar--grid select.form-input,
  .archive-filter-bar--grid button.form-input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  /* Property archive: allow location cascade selects to wrap onto a 2nd row */
  .archive-filter-bar {
    flex-wrap: wrap;
  }
}

/* Grid filter cells must shrink; native <select> min-content width causes overflow. */
.archive-filter-bar--grid > * {
  min-width: 0;
  max-width: 100%;
}
.archive-filter-bar--grid select.form-input {
  min-width: 0;
  max-width: 100%;
}

.archive-filter-bar--grid .real-searchable-select {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.archive-filter-bar--grid .real-searchable-select__trigger {
  width: 100% !important;
}

/* Searchable select (archive Khu vực filter) */
.real-searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
}

.real-searchable-select__native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.real-searchable-select__trigger {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  height: 44px !important;
  padding-right: 10px !important;
  text-align: left;
  cursor: pointer;
  background-color: #fff;
}

.real-searchable-select__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  color: var(--color-on-surface, #1a1c1e);
}

.real-searchable-select__chevron {
  flex-shrink: 0;
  font-size: 20px;
  color: var(--color-on-surface-variant, #5c6b66);
  transition: transform 0.15s ease;
}

.real-searchable-select.is-open .real-searchable-select__chevron {
  transform: rotate(180deg);
}

.real-searchable-select__panel {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  min-width: 220px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--color-border, #e8eaeb);
  border-radius: var(--radius-md, 8px);
  box-shadow: 0 8px 24px rgba(26, 28, 30, 0.12);
  overflow: hidden;
}

.real-searchable-select__search {
  padding: 8px;
  border-bottom: 1px solid var(--color-border, #e8eaeb);
  flex-shrink: 0;
}

.real-searchable-select__search-input {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  font-family: inherit;
  font-size: 14px;
  border: 1px solid var(--color-border, #e8eaeb);
  border-radius: 6px;
  background: #fff;
  box-sizing: border-box;
}

.real-searchable-select__search-input:focus {
  outline: none;
  border-color: var(--color-primary, #006241);
}

.real-searchable-select__list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  overflow-y: auto;
  max-height: 260px;
}

.real-searchable-select__option {
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--color-on-surface, #1a1c1e);
  cursor: pointer;
}

.real-searchable-select__option:hover {
  background: rgba(0, 98, 65, 0.08);
}

.real-searchable-select__option.is-selected {
  background: rgba(0, 98, 65, 0.12);
  color: var(--color-primary, #006241);
  font-weight: 600;
}

.real-searchable-select__option.is-disabled {
  opacity: 0.5;
  cursor: default;
}

.real-searchable-select__empty {
  padding: 12px;
  font-size: 13px;
  color: var(--color-on-surface-variant, #5c6b66);
  text-align: center;
}

@media (min-width: 768px) {
  .archive-filter-bar .real-searchable-select {
    width: auto;
    flex: 1 1 200px;
    min-width: 180px;
    max-width: 100%;
  }
}

/* Project archive: compact sort + view toggle (equal 36px height). */
#project-orderby.form-input {
  height: 36px;
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
  line-height: 1;
}
#view-grid,
#view-list {
  width: 36px;
  height: 36px;
  padding: 0;
  line-height: 1;
}
input.form-input:focus,
select.form-input:focus,
textarea.form-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(0, 98, 65, 0.1);
}
.form-error {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--color-error);
}

/* 10. Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  padding: var(--spacing-md);
}
.modal.hidden {
  display: none;
}
.modal__content {
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

/* 11. Notification toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 200;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transition: all 0.3s ease;
}
.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}
.toast--success {
  background-color: var(--color-primary);
}
.toast--error {
  background-color: var(--color-error);
}
.toast--info {
  background-color: var(--color-status-rent);
}

/* 12. Animation */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

/* 13. Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 15. Pagination */
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  color: var(--color-on-surface);
  background: #fff;
  text-decoration: none;
  transition: all 0.2s ease;
  margin: 0 2px;
}

.page-numbers:hover {
  background: var(--color-surface-container-low);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.page-numbers.current {
  background: var(--color-on-surface);
  border-color: var(--color-on-surface);
  color: #fff;
  font-weight: 700;
}

.page-numbers.dots {
  border-color: transparent;
  background: transparent;
  pointer-events: none;
}

.page-numbers.prev,
.page-numbers.next {
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

/* Mobile nav: dropdown panel that slides down smoothly under the header.
   On desktop (>=768px) the md:flex utility takes over for the inline menu. */
@media screen and (max-width: 767px) {
  [data-nav-menu] {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    background: var(--color-surface);
    /* Collapsed by default — animate open via .is-open */
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding: 0 16px;
    pointer-events: none;
    transition: max-height 0.32s ease, opacity 0.25s ease, padding 0.32s ease;
  }
  [data-nav-menu].is-open {
    max-height: 80vh;
    opacity: 1;
    padding: 8px 16px 16px;
    pointer-events: auto;
    overflow-y: auto;
    border-bottom: 1px solid #e8eaeb;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
  }
  /* Make the menu list and links full-width, comfortable tap targets. */
  [data-nav-menu] ul {
    width: 100%;
  }
  [data-nav-menu] a {
    display: block;
    width: 100%;
    padding: 12px 12px;
    border-radius: var(--radius-md);
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
  }
  /* Mobile action links (Ký gửi / Tài khoản / Đăng tin) — same left-aligned style as menu items */
  [data-nav-menu] > div {
    width: 100%;
    align-items: stretch;
  }
}

/* Header: roomy padding at the top of the page, compact once scrolled (smooth). */
#masthead {
  transition: padding 0.3s ease-out;
}
body.header-scrolled #masthead {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}
@media (prefers-reduced-motion: reduce) {
  #masthead {
    transition: none;
  }
}

/* When logged in, WP adds .admin-bar class to <body> and shows 32px admin bar on desktop, 46px on mobile */
.admin-bar #masthead {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar #masthead {
    top: 46px;
  }
}

/*
 * Fixed masthead is py-5 + logo h-8 ≈ 72–80px (not the old h-14 / 56px).
 * Tailwind pt-14 / pt-20 alone leaves breadcrumbs & titles flush under the header.
 * Desktop: clear gap under header. Home keeps a smaller offset for the hero.
 */
@media (min-width: 768px) {
  main#primary {
    padding-top: 104px !important; /* ~80px header + 24px gap */
  }

  body.home main#primary,
  body.front-page main#primary {
    padding-top: 56px !important; /* hero sits under fixed header */
  }

  body.admin-bar main#primary {
    padding-top: 136px !important; /* +32px admin bar */
  }

  body.admin-bar.home main#primary,
  body.admin-bar.front-page main#primary {
    padding-top: 88px !important;
  }

  /* Tin của tôi — extra breathing room */
  main#primary.real-page-my-listings {
    padding-top: 120px !important;
  }
  body.admin-bar main#primary.real-page-my-listings {
    padding-top: 152px !important;
  }
}

/* Mobile + admin bar: keep content below WP toolbar */
@media screen and (max-width: 767px) {
  body.admin-bar main#primary {
    padding-top: calc(3.5rem + 46px) !important; /* pt-14 + admin bar */
  }

  body.admin-bar.home main#primary,
  body.admin-bar.front-page main#primary {
    padding-top: calc(3.5rem + 46px) !important;
  }

  main#primary.real-page-my-listings {
    padding-top: 120px !important;
  }
  body.admin-bar main#primary.real-page-my-listings {
    padding-top: 166px !important;
  }
}


/* Admin bar offset for fullscreen gallery modal */
.admin-bar #gallery-modal {
  top: 32px;
  height: calc(100vh - 32px);
}

@media screen and (max-width: 782px) {
  .admin-bar #gallery-modal {
    top: 46px;
    height: calc(100vh - 46px);
  }
}

.admin-bar #gallery-modal .absolute.left-4,
.admin-bar #gallery-modal .absolute.right-4 {
  top: 50%;
  transform: translateY(-50%);
}

.admin-bar #gallery-modal .px-6.py-4 {
  flex-shrink: 0;
}

.admin-bar #gallery-modal #gallery-modal-thumbs {
  scrollbar-gutter: stable;
}

/* Related properties — compact 2-column cards on mobile */
.related-property-card {
  display: flex;
  flex-direction: column;
  background-color: var(--color-surface-lowest);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.related-property-card__link {
  display: block;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.related-property-card__image-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--color-surface-container-low);
}

.related-property-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
}

.related-property-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.related-property-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-outline);
  font-size: 32px;
}

.related-property-card__body {
  padding: 10px 10px 8px;
}

.related-property-card__title {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--color-on-surface);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.related-property-card__price {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--color-status-sale);
}

.related-property-card--vip .related-property-card__price,
.related-property-card--vip .related-property-card__title {
  color: var(--vip-text-color, var(--color-status-sale)) !important;
}

.related-property-card__location {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  min-width: 0;
  font-size: 12px;
  line-height: 1.35;
  color: var(--color-on-surface-variant);
}

.related-property-card__location .material-symbols-outlined {
  flex: none;
  font-size: 14px;
}

.related-property-card__location-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.related-property-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 10px 10px;
}

.related-property-card__date {
  font-size: 11px;
  line-height: 1.35;
  color: var(--color-outline);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-property-card__favorite {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface-lowest);
  color: var(--color-on-surface-variant);
  cursor: pointer;
}

.related-property-card__favorite .material-symbols-outlined {
  font-size: 16px;
}

.related-property-card__favorite.is-saved {
  border-color: var(--color-status-sale);
  color: var(--color-status-sale);
}

.related-property-card__favorite.is-saved .material-symbols-outlined {
  font-variation-settings: 'FILL' 1;
}

@media screen and (min-width: 1024px) {
  .related-property-card__body {
    padding: 12px 12px 8px;
  }

  .related-property-card__title {
    font-size: 15px;
  }

  .related-property-card__price {
    font-size: 16px;
  }

  .related-property-card__location {
    font-size: 13px;
  }

  .related-property-card__footer {
    padding: 0 12px 12px;
  }

  .related-property-card__date {
    font-size: 12px;
  }
}

