/* ==========================================================================
   ARCHI.VN — EDITORIAL ARCHITECTURAL DIRECTORY DESIGN SYSTEM
   Inspired by ArchDaily, Kinfolk & Cereal Magazine
   Palette: Warm Alabaster Cream, Obsidian Ink, Walnut Wood & Sage
   ========================================================================== */

:root {
  --bg-primary: #FAF7F2;
  --bg-secondary: #F2ECE4;
  --bg-tertiary: #EAE2D7;
  --bg-surface: #FFFFFF;
  --bg-dark: #161513;
  --bg-dark-elevated: #22201D;

  --text-primary: #181715;
  --text-secondary: #57524C;
  --text-muted: #878077;
  --text-on-dark: #F7F4EF;

  --accent-wood: #8C5E3C;
  --accent-wood-dark: #6E472B;
  --accent-wood-light: #F5ECE4;

  --accent-sage: #294B3C;
  --accent-sage-light: #E6F0EC;

  --accent-bronze: #A87C44;
  --accent-bronze-light: #F9F2E7;

  --accent-zalo: #0068FF;
  --danger: #B93829;

  --border-light: #E6DFD5;
  --border-medium: #D3C9BB;
  --border-dark: #2E2B27;

  --font-serif: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --shadow-sm: 0 2px 8px rgba(24, 23, 21, 0.04);
  --shadow-md: 0 10px 30px -5px rgba(24, 23, 21, 0.07);
  --shadow-lg: 0 24px 48px -12px rgba(24, 23, 21, 0.14);
  --shadow-floating: 0 20px 50px rgba(15, 14, 12, 0.28);

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-wood);
}

/* ==========================================================================
   TOP EDITORIAL BAR & HEADER
   ========================================================================== */
.editorial-topbar {
  background-color: var(--bg-dark);
  color: #D6CFC7;
  font-size: 0.78rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-dark);
  letter-spacing: 0.02em;
}

.container {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #C89B65;
  margin-right: 0.4rem;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.topbar-link {
  color: #EAE4DC;
  text-decoration: none;
  background: none;
  border: none;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: var(--transition);
}
.topbar-link:hover {
  color: #C89B65;
}

/* Main Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(250, 247, 242, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-light);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 78px;
  gap: 1.5rem;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  color: var(--text-primary);
}

.brand-mark {
  width: 42px;
  height: 42px;
  background: var(--bg-dark);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  border-radius: 6px;
  border: 1px solid var(--accent-wood);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-sans);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

.brand-subtitle {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #EFEAE2;
  border: 1px solid #DFD6C9;
  padding: 0.28rem;
  border-radius: 10px;
}

.nav-item {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  transition: var(--transition);
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 7px;
}
.nav-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.55);
}
.nav-item.active {
  background: var(--bg-dark);
  color: #FFF;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(22, 21, 19, 0.18);
}
.nav-tab-count {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  background: rgba(22, 21, 19, 0.08);
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-item.active .nav-tab-count {
  background: rgba(255, 255, 255, 0.16);
  color: #E5C185;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.62rem 1.15rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}

.btn-outline {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.btn-outline:hover {
  border-color: var(--text-primary);
  background: var(--bg-secondary);
}

.btn-primary {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-color: var(--bg-dark);
}
.btn-primary:hover {
  background: var(--accent-wood);
  border-color: var(--accent-wood);
}

.btn-wood {
  background: var(--accent-wood);
  color: #FFF;
  border-color: var(--accent-wood);
}
.btn-wood:hover {
  background: var(--accent-wood-dark);
  border-color: var(--accent-wood-dark);
}

.btn-zalo {
  background: #0068FF;
  color: #FFF;
  border-color: #0068FF;
}
.btn-zalo:hover {
  background: #0052CC;
}

.badge-counter {
  background: var(--accent-wood);
  color: #FFF;
  font-size: 0.7rem;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   HERO EDITORIAL SECTION & QUICK SEARCH
   ========================================================================== */
.hero-section {
  position: relative;
  padding: 1.45rem 0 1.75rem;
  border-bottom: 1px solid var(--border-light);
  background:
    radial-gradient(circle at 85% 15%, rgba(140, 94, 60, 0.08), transparent 45%),
    linear-gradient(180deg, #FAF7F2 0%, #F4EFE6 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.12fr;
  gap: 1.75rem;
  align-items: stretch;
  margin-bottom: 1.25rem;
}

.hero-left {
  display: flex;
  flex-direction: column;
}

.hero-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  flex: 1;
  height: 100%;
}

.hero-mode-tab {
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  border: 1.5px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 1.15rem 1.2rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.hero-mode-tab:hover {
  border-color: var(--accent-wood);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.hero-mode-tab.active {
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: #FFF;
  box-shadow: 0 8px 20px rgba(22, 21, 19, 0.16);
}

.hero-mode-tab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}

.hero-mode-tab-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.hero-mode-tab-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.hero-mode-tab.active .hero-mode-tab-title {
  color: #FFF;
}

.hero-mode-tab-sub {
  font-size: 0.76rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.hero-mode-tab.active .hero-mode-tab-sub {
  color: #D2C8BC;
}

.hero-mode-tab.active .nav-tab-count {
  background: rgba(255, 255, 255, 0.16);
  color: #E5C185;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent-wood);
  font-weight: 700;
  margin-bottom: 0.85rem;
}

.hero-eyebrow::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  background-color: var(--accent-wood);
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(1.42rem, 2.15vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.hero-title em {
  font-style: normal;
  color: var(--accent-wood);
  font-weight: 700;
}

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.25rem 0;
}

.hero-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  max-width: 680px;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.15rem;
  padding: 1.25rem 1.35rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.stat-item {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1.15;
}

.stat-label {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* Primary Search Command Bar */
.search-command-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  box-shadow: var(--shadow-md);
}

.search-bar-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr auto;
  gap: 0.65rem;
  align-items: center;
}

.search-field {
  display: flex;
  flex-direction: column;
  padding: 0.35rem 0.85rem;
  border-right: 1px solid var(--border-light);
}
.search-field:last-of-type {
  border-right: none;
}

.search-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.search-input,
.search-select {
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-primary);
  width: 100%;
  outline: none;
  padding: 0.15rem 0;
}

.search-input::placeholder {
  color: #A29B91;
  font-weight: 400;
}

.search-submit-btn {
  height: 52px;
  padding: 0 1.5rem;
}

/* Quick Preset Scenarios Bar */
.quick-presets {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.preset-label {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.25rem;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 0.34rem 0.78rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.preset-chip:hover,
.preset-chip.active {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-color: var(--bg-dark);
}

/* ==========================================================================
   MAIN DIRECTORY LAYOUT (SIDEBAR FILTERS + RESULTS)
   ========================================================================== */
.directory-main {
  padding: 2.5rem 0 5rem;
}

.directory-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: start;
}

.filter-sidebar,
.mobile-filter-trigger-btn {
  display: none !important;
}

/* Top Collapsible Filter Panel (Desktop) */
.filter-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
  display: none;
}

.filter-sidebar.desktop-open {
  display: block;
}

.filter-groups-horizontal {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.85rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.filter-header-title {
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-reset-filters {
  background: none;
  border: none;
  color: var(--accent-wood);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-family: var(--font-sans);
}
.btn-reset-filters:hover {
  color: var(--text-primary);
}

.filter-group {
  padding-bottom: 0;
  margin-bottom: 0;
  border-bottom: none;
}

.filter-group-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group-hint {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  line-height: 1.4;
}

/* Toggle Switches for Special Attributes */
.toggle-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: var(--transition);
}
.toggle-option:hover {
  border-color: var(--accent-wood);
}
.toggle-option input {
  accent-color: var(--accent-wood);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.toggle-option-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Checkbox list */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 4px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.2rem 0;
  transition: var(--transition);
}
.checkbox-item:hover {
  color: var(--text-primary);
}
.checkbox-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.checkbox-item input[type="checkbox"] {
  accent-color: var(--accent-wood);
  width: 15px;
  height: 15px;
  cursor: pointer;
  flex-shrink: 0;
}
.checkbox-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 1px 6px;
  border-radius: 99px;
}

/* Pill Selector in Sidebar */
.pill-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-pill {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  padding: 0.32rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}
.filter-pill:hover {
  border-color: var(--accent-wood);
  color: var(--text-primary);
}
.filter-pill.selected {
  background: var(--bg-dark);
  color: #FFF;
  border-color: var(--bg-dark);
}

/* Budget Range Slider */
.budget-slider-wrap {
  padding: 0.25rem 0;
}
.budget-range-input {
  width: 100%;
  accent-color: var(--accent-wood);
  cursor: pointer;
}
.budget-range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  font-weight: 600;
}

/* ==========================================================================
   RESULTS HEADER, ACTIVE FILTERS & TOOLBAR
   ========================================================================== */
.results-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.results-count-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}

.results-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.results-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sort-select {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  color: var(--text-primary);
  font-weight: 500;
  cursor: pointer;
}

.view-switcher {
  display: inline-flex;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-surface);
}

.view-btn {
  background: transparent;
  border: none;
  padding: 0.46rem 0.7rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  display: flex;
  align-items: center;
}
.view-btn.active {
  background: var(--bg-dark);
  color: #FFF;
}

/* Active Filter Tags Bar */
.active-filters-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.35rem;
}
.active-filters-bar:empty {
  display: none;
}

.active-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent-wood-light);
  border: 1px solid rgba(140, 94, 60, 0.3);
  color: var(--accent-wood-dark);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.65rem;
  border-radius: var(--radius-xs);
}

.active-tag button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}

/* ==========================================================================
   COMPANY DIRECTORY CARDS (GRID & LIST VIEWS)
   ========================================================================== */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.companies-grid.list-view {
  grid-template-columns: 1fr;
}

.company-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
}

.company-card:hover {
  border-color: var(--border-medium);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.company-card.featured-card {
  border-color: rgba(168, 124, 68, 0.55);
}

/* Card Media Header */
.card-media {
  position: relative;
  height: 205px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.card-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.company-card:hover .card-cover-img {
  transform: scale(1.04);
}

.card-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16,15,13,0.45) 0%, rgba(16,15,13,0.05) 45%, rgba(16,15,13,0.75) 100%);
  pointer-events: none;
}

.card-top-badges {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 2;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.badge-featured {
  background: rgba(22, 21, 19, 0.88);
  color: #E5C185;
  border: 1px solid rgba(229, 193, 133, 0.4);
}

.badge-verified {
  background: rgba(41, 75, 60, 0.9);
  color: #FFF;
}

.badge-factory {
  background: rgba(140, 94, 60, 0.92);
  color: #FFF;
}

.card-Quick-actions {
  display: flex;
  gap: 0.4rem;
}

.icon-action-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(24, 23, 21, 0.12);
  color: var(--text-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.icon-action-btn:hover {
  background: #FFF;
  transform: scale(1.06);
}
.icon-action-btn.saved {
  background: #FEF2F2;
  color: #DC2626;
  border-color: #FCA5A5;
}

.card-bottom-caption {
  position: absolute;
  bottom: 0.75rem;
  left: 0.85rem;
  right: 0.85rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: #FFF;
  z-index: 2;
}

.hq-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(22, 21, 19, 0.75);
  padding: 0.24rem 0.65rem;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}

.rating-pill {
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(22, 21, 19, 0.75);
  padding: 0.22rem 0.55rem;
  border-radius: var(--radius-xs);
  color: #FCD34D;
}

/* Card Body */
.card-body {
  padding: 1.05rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.company-name {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.32;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.company-name:hover {
  color: var(--accent-wood);
}

.company-tagline {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Info Matrix inside Card */
.card-info-matrix {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.8rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
}

.matrix-cell {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}

.matrix-cell.full-span {
  grid-column: 1 / -1;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border-medium);
}

.matrix-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 700;
}

.matrix-val {
  color: var(--text-primary);
  font-weight: 600;
  line-height: 1.35;
}

.matrix-val.highlight-wood {
  color: var(--accent-wood-dark);
}

/* Tags Group on Card */
.card-tags-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tag-row-title {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 0.2rem;
}

.mini-tag {
  font-size: 0.72rem;
  padding: 0.16rem 0.5rem;
  border-radius: 3px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 500;
}

.mini-tag.area-tag {
  background: #EEF2F0;
  color: var(--accent-sage);
  border: 1px solid rgba(41, 75, 60, 0.15);
}

.mini-tag.style-tag {
  background: var(--accent-wood-light);
  color: var(--accent-wood-dark);
}

/* Card Footer Actions */
.card-footer {
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compare-check-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-medium);
  background: var(--bg-primary);
  transition: var(--transition);
}
.compare-check-label:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}
.compare-check-label.active {
  background: var(--accent-wood-light);
  border-color: var(--accent-wood);
  color: var(--accent-wood-dark);
}
.compare-check-label input {
  accent-color: var(--accent-wood);
  cursor: pointer;
}

.card-cta-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.79rem;
}

/* List View Adaptation */
.companies-grid.list-view .company-card {
  flex-direction: row;
}
.companies-grid.list-view .card-media {
  width: 300px;
  height: auto;
  min-height: 175px;
  flex-shrink: 0;
}

/* ==========================================================================
   FLOATING COMPARISON DOCK (BOTTOM BAR)
   ========================================================================== */
.compare-dock {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(150%);
  z-index: 95;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border: 1px solid #3A352F;
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  box-shadow: var(--shadow-floating);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 95vw;
  width: 920px;
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1);
}

.compare-dock.visible {
  transform: translateX(-50%) translateY(0);
}

.dock-info {
  display: flex;
  flex-direction: column;
  min-width: 170px;
}

.dock-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: #E5C185;
}

.dock-subtitle {
  font-size: 0.75rem;
  color: #A8A096;
}

.dock-slots {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex: 1;
  overflow-x: auto;
}

.dock-slot-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-dark-elevated);
  border: 1px solid #3E3A34;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  white-space: nowrap;
}

.dock-slot-remove {
  background: none;
  border: none;
  color: #A8A096;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1;
}
.dock-slot-remove:hover {
  color: #FFF;
}

.dock-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ==========================================================================
   MODALS & DRAWERS (PROFILE, COMPARE TABLE, SAVED, PARTNER ZALO, GOOGLE SHEET)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(16, 15, 13, 0.68);
  backdrop-filter: blur(5px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-backdrop.open {
  display: flex;
}

.modal-container {
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  width: 100%;
  max-width: 1020px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-floating);
  position: relative;
  animation: modalSlideUp 0.25s ease-out;
}

.modal-container.modal-xl {
  max-width: 1240px;
}

.modal-container.modal-md {
  max-width: 680px;
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-sticky-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(250, 247, 242, 0.96);
  backdrop-filter: blur(10px);
  padding: 1.15rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  cursor: pointer;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.modal-close-btn:hover {
  background: var(--bg-dark);
  color: #FFF;
}

.modal-body {
  padding: 1.65rem;
}

/* Company Profile Modal Specifics */
.profile-hero {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 1.5rem;
  margin-bottom: 1.35rem;
  background: var(--bg-surface);
  padding: 1.25rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  align-items: start;
}

.profile-hero-left {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profile-cover {
  width: 100%;
  height: 215px;
  object-fit: cover;
  border-radius: var(--radius-xs);
}

.profile-left-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.5rem;
  text-align: center;
}

.profile-left-stat-val {
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.profile-left-stat-lbl {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 0.15rem;
}

.profile-left-contact-card {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-xs);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.profile-left-contact-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: #FFF;
  line-height: 1.25;
}

.profile-left-contact-meta {
  font-size: 0.77rem;
  color: #B8B0A6;
  line-height: 1.45;
  word-break: break-word;
}

.profile-left-contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.profile-left-contact-actions .btn-full-span {
  grid-column: 1 / -1;
}

.profile-specs-box {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  padding: 0.35rem 0.9rem;
}

.profile-spec-row {
  display: grid;
  grid-template-columns: 108px 1fr;
  gap: 0.65rem;
  align-items: start;
  padding: 0.55rem 0;
  border-bottom: 1px dashed var(--border-medium);
}

.profile-spec-row:last-child {
  border-bottom: none;
}

.profile-spec-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  font-weight: 700;
  padding-top: 0.22rem;
}

.profile-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
}

.profile-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.35rem;
  margin-bottom: 1.25rem;
}

.profile-section-title {
  font-family: var(--font-sans);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.portfolio-card {
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xs);
  overflow: hidden;
  background: var(--bg-primary);
}

.portfolio-card img {
  width: 100%;
  height: 175px;
  object-fit: cover;
}

.portfolio-card-info {
  padding: 0.75rem;
}

/* Comparison Matrix Table */
.compare-table-wrapper {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-surface);
  font-size: 0.85rem;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--border-light);
  padding: 0.9rem 1rem;
  vertical-align: top;
  text-align: left;
}

.compare-table th {
  background: var(--bg-secondary);
  width: 210px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.79rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.compare-col-header {
  min-width: 235px;
}

/* Form Elements (Partner Registration & Sheet Config) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.form-control {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  color: var(--text-primary);
}
.form-control:focus {
  outline: none;
  border-color: var(--accent-wood);
}

/* Partner Callout Banner */
.partner-banner {
  margin-top: 4rem;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  border-radius: var(--radius-md);
  padding: 2.75rem;
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 2rem;
  align-items: center;
  border: 1px solid #332E29;
}

.partner-banner-title {
  font-family: var(--font-sans);
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #FFF;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

/* Footer */
.site-footer {
  background: #121110;
  color: #A8A096;
  padding: 3rem 0 2rem;
  font-size: 0.84rem;
  border-top: 1px solid #2A2622;
}

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 90px;
  right: 1.5rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-dark);
  color: #FFF;
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-xs);
  border-left: 4px solid #C89B65;
  box-shadow: var(--shadow-lg);
  font-size: 0.84rem;
  animation: modalSlideUp 0.2s ease-out;
}

/* Empty State */
.empty-state {
  background: var(--bg-surface);
  border: 1px dashed var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 3.5rem 1.5rem;
  text-align: center;
  grid-column: 1 / -1;
}

/* ==========================================================================
   PAGE / TAB SWITCHER & SPECIALIST TRADE CATEGORY CARDS
   ========================================================================== */
.nav-item {
  position: relative;
}

.nav-item.active::after {
  display: none;
}

.nav-badge-new {
  background: var(--accent-sage);
  color: #FFF;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-left: 4px;
  vertical-align: middle;
}

/* Dual Page Switcher Bar inside Hero */
.page-mode-switcher {
  display: inline-flex;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.mode-switch-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-xs);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.mode-switch-btn:hover {
  color: var(--text-primary);
}

.mode-switch-btn.active {
  background: var(--bg-dark);
  color: var(--text-on-dark);
  box-shadow: var(--shadow-sm);
}

.mode-switch-count {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(140, 94, 60, 0.16);
  color: var(--accent-wood-dark);
}

.mode-switch-btn.active .mode-switch-count {
  background: var(--accent-wood);
  color: #FFF;
}

/* Visual Trade Categories Grid (For Specialist Page) */
.specialist-categories-bar {
  margin-top: 1.35rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-light);
}

.specialist-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.specialist-cat-title {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
  color: var(--text-secondary);
}

.trade-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.6rem;
}

.trade-cards-grid.style-cards-grid {
  grid-template-columns: repeat(5, 1fr);
}

.trade-cat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xs);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.trade-cat-card:hover {
  border-color: var(--accent-wood);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.trade-cat-card.active {
  background: var(--bg-dark);
  border-color: var(--bg-dark);
  color: #FFF;
}

.trade-cat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.15rem;
}

.trade-cat-count {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-primary);
  padding: 1px 6px;
  border-radius: 99px;
}

.trade-cat-card.active .trade-cat-count {
  background: var(--accent-wood);
  color: #FFF;
}

.trade-cat-name {
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.trade-cat-card.active .trade-cat-name {
  color: #FFF;
}

.trade-cat-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-wood-dark);
  background: var(--accent-wood-light);
  border: 1px solid rgba(140, 94, 60, 0.25);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
  width: fit-content;
}

/* Responsive Breakpoints */
@media (max-width: 1100px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .search-bar-grid {
    grid-template-columns: 1fr 1fr;
  }
  .search-field {
    border-right: none;
    border-bottom: 1px solid var(--border-light);
  }
  .directory-layout {
    grid-template-columns: 1fr;
  }
  .companies-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .filter-sidebar {
    position: static;
    max-height: none;
  }
  .trade-cards-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  .companies-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
  }
  .companies-grid.list-view .company-card {
    flex-direction: column;
  }
  .companies-grid.list-view .card-media {
    width: 100%;
  }
  .search-bar-grid {
    grid-template-columns: 1fr;
  }
  .profile-hero {
    grid-template-columns: 1fr;
  }
  .partner-banner {
    grid-template-columns: 1fr;
    padding: 1.75rem;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .trade-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   THANH SẮP XẾP THỨ TỰ TRỰC TIẾP TRÊN THẺ (CARD REORDER BAR)
   ========================================================================== */
.reorder-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.reorder-toggle-btn:hover {
  border-color: var(--accent-wood);
}

.reorder-toggle-btn.active {
  background: #294B3C;
  border-color: #294B3C;
  color: #FFF;
}

.card-reorder-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem;
  background: #F4EFE6;
  border-bottom: 1px solid #DFD5C5;
  font-size: 0.78rem;
  user-select: none;
}

.companies-grid.list-view .company-card {
  position: relative;
}

.companies-grid.list-view .card-reorder-bar {
  border-bottom: none;
  border-right: 1px solid #DFD5C5;
  flex-direction: column;
  justify-content: center;
  padding: 0.65rem 0.5rem;
  min-width: 96px;
}

.card-reorder-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.card-drag-handle {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: grab;
  font-weight: 700;
  color: var(--accent-wood-dark);
  background: #FFF;
  border: 1px solid #D8CBB8;
  padding: 0.22rem 0.5rem;
  border-radius: 4px;
  font-size: 0.82rem;
  line-height: 1.1;
  transition: all 0.15s ease;
}

.card-drag-handle:hover {
  background: var(--accent-wood);
  color: #FFF;
  border-color: var(--accent-wood);
}

.card-drag-handle:active {
  cursor: grabbing;
}

.card-order-label {
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.76rem;
}

.card-order-input {
  width: 52px;
  padding: 0.22rem 0.35rem;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  background: #FFF;
  border: 1px solid var(--accent-wood);
  border-radius: 4px;
}

.card-order-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(140, 94, 60, 0.25);
}

.card-reorder-actions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.card-order-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  padding: 0.24rem 0.52rem;
  border-radius: 4px;
  border: 1px solid #D5C8B4;
  background: #FFF;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
}

.card-order-btn:hover:not(:disabled) {
  background: var(--accent-wood);
  color: #FFF;
  border-color: var(--accent-wood);
}

.card-order-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.company-card.card-dragging {
  opacity: 0.45;
  border: 2px dashed var(--accent-wood);
}

.company-card.card-drag-over {
  outline: 3px solid var(--accent-wood);
  box-shadow: 0 0 0 4px rgba(140, 94, 60, 0.2);
}

.company-card.card-picked-source {
  outline: 3px solid #294B3C;
  box-shadow: 0 0 0 5px rgba(41, 75, 60, 0.22);
}

.card-order-select {
  padding: 0.22rem 0.4rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-primary);
  background: #FFF;
  border: 1px solid var(--accent-wood);
  border-radius: 4px;
  cursor: pointer;
}

.card-order-btn.btn-pick-source {
  background: #FAF6F0;
  border-color: #C8B69E;
  color: var(--accent-wood-dark);
}

.card-order-btn.btn-pick-active {
  background: #161513;
  border-color: #161513;
  color: #FFF;
}

.card-order-btn.btn-drop-here {
  background: #294B3C;
  border-color: #294B3C;
  color: #FFF;
  font-weight: 800;
  padding: 0.28rem 0.65rem;
  animation: pulseDropBtn 1.1s infinite alternate;
}

.card-order-btn.btn-drop-here:hover {
  background: #1E382C;
  border-color: #1E382C;
}

@keyframes pulseDropBtn {
  from {
    box-shadow: 0 0 0 0 rgba(41, 75, 60, 0.35);
  }
  to {
    box-shadow: 0 0 0 4px rgba(41, 75, 60, 0.15);
  }
}

/* Quick Reorder Modal (Compact Visual List) */
.quick-reorder-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 62vh;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.quick-reorder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #FFF;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  transition: all 0.14s ease;
}

.quick-reorder-item:hover {
  border-color: var(--accent-wood);
  background: #FCFBF9;
}

.quick-reorder-item.picked {
  border: 2px solid #294B3C;
  background: #EEF5F1;
}

.quick-reorder-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.quick-rank-badge {
  min-width: 36px;
  height: 28px;
  border-radius: 5px;
  background: var(--bg-dark);
  color: #FFF;
  font-weight: 800;
  font-size: 0.78rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.quick-thumb {
  width: 44px;
  height: 34px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
}

.quick-info {
  min-width: 0;
  flex: 1;
}

.quick-title {
  font-weight: 700;
  font-size: 0.86rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-reorder-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ==========================================================================
   MOBILE FILTER DRAWER & COMPREHENSIVE MOBILE / TABLET RESPONSIVE UI
   ========================================================================== */
.mobile-filter-backdrop,
.mobile-filter-close-btn,
.mobile-filter-Sticky-footer {
  display: none;
}

.mobile-filter-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem 0.85rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-medium);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}
.mobile-filter-trigger-btn:hover,
.mobile-filter-trigger-btn.active {
  border-color: var(--accent-wood);
  background: var(--accent-wood-light);
  color: var(--accent-wood-dark);
}

@media (max-width: 1100px) {
  .filter-groups-horizontal {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .filter-group {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-light);
  }
  .filter-group:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .mobile-filter-backdrop {
    position: fixed;
    inset: 0;
    z-index: 125;
    background: rgba(16, 15, 13, 0.6);
    backdrop-filter: blur(4px);
    display: none;
  }

  .mobile-filter-backdrop.open {
    display: block;
  }

  .filter-sidebar {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    z-index: 130;
    margin-bottom: 0;
    max-height: 86vh;
    border-radius: 16px 16px 0 0;
    padding: 1.15rem 1.15rem 0;
    box-shadow: var(--shadow-floating);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }

  .filter-sidebar.mobile-open {
    transform: translateY(0);
  }

  .mobile-filter-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-medium);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
  }

  .mobile-filter-Sticky-footer {
    display: block;
    position: sticky;
    bottom: 0;
    background: var(--bg-surface);
    padding: 0.85rem 0 1.15rem;
    border-top: 1px solid var(--border-light);
    margin-top: 1rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 0.9rem;
  }

  /* 1. Topbar & Header trên Điện thoại */
  .editorial-topbar .topbar-left {
    display: none;
  }
  .editorial-topbar .topbar-inner {
    justify-content: center;
  }
  .editorial-topbar .topbar-link {
    font-size: 0.74rem;
    text-align: center;
  }

  .header-inner {
    height: auto;
    padding: 0.65rem 0;
    flex-wrap: wrap;
    gap: 0.55rem;
  }

  .brand-logo {
    gap: 0.55rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 0.92rem;
  }

  .brand-title {
    font-size: 1.12rem;
  }

  .brand-subtitle {
    display: none;
  }

  .header-actions {
    gap: 0.4rem;
    margin-left: auto;
  }

  .header-actions .btn {
    padding: 0.44rem 0.68rem;
    font-size: 0.76rem;
  }

  /* Chuyển 2 tab chính thành thanh Segmented Control chuẩn iOS/Google ngay hàng 2 */
  .header-nav {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
    background: var(--bg-secondary);
    padding: 0.24rem;
    border-radius: 7px;
    border: 1px solid var(--border-light);
  }

  .header-nav .nav-item {
    justify-content: center;
    text-align: center;
    padding: 0.46rem 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-nav .nav-item-icon {
    display: none;
  }

  .header-nav .nav-item.active {
    background: var(--bg-dark);
    color: #FFF;
    box-shadow: var(--shadow-sm);
  }

  .header-nav .nav-item.active::after {
    display: none;
  }

  /* 2. Hero & Thanh Tìm kiếm trên Điện thoại */
  .hero-section {
    padding: 1.15rem 0 1.35rem;
  }

  .hero-grid {
    gap: 0.9rem;
    margin-bottom: 1rem;
  }

  .hero-mode-tabs {
    gap: 0.5rem;
  }

  .hero-mode-tab {
    padding: 0.72rem 0.78rem;
  }

  .hero-mode-tab-title {
    font-size: 0.85rem;
  }

  .hero-mode-tab-sub {
    font-size: 0.69rem;
    line-height: 1.3;
  }

  .hero-title {
    font-size: 1.48rem;
    line-height: 1.26;
  }

  .hero-desc {
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .hero-stats {
    padding: 0.75rem 0.85rem;
    gap: 0.5rem;
  }

  .stat-value {
    font-size: 1.18rem;
  }

  .stat-label {
    font-size: 0.68rem;
    line-height: 1.25;
  }

  .search-command-bar {
    padding: 0.65rem;
  }

  .search-bar-grid {
    gap: 0.35rem;
  }

  .search-field {
    padding: 0.35rem 0.5rem;
  }

  /* Font 16px ngăn iOS Safari tự phóng to màn hình khi chạm vào ô tìm kiếm */
  .search-input,
  .search-select,
  .form-control {
    font-size: 16px;
  }

  .search-submit-btn {
    height: 44px;
    width: 100%;
    font-size: 0.9rem;
    margin-top: 0.2rem;
  }

  /* Lối tắt vuốt ngang mượt mà trên Điện thoại */
  .quick-presets {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
    margin-top: 0.75rem;
    scrollbar-width: none;
  }
  .quick-presets::-webkit-scrollbar {
    display: none;
  }
  .preset-label,
  .preset-chip {
    flex-shrink: 0;
    white-space: nowrap;
  }

  /* Lối tắt 12 Hạng mục / 12 Phong cách: 2 hàng vuốt ngang mượt mà trên Điện thoại */
  .specialist-categories-bar {
    margin-top: 0.9rem;
    padding-top: 0.85rem;
  }

  .specialist-cat-header {
    margin-bottom: 0.55rem;
    gap: 0.5rem;
  }

  .specialist-cat-title {
    font-size: 0.7rem;
    letter-spacing: 0.05em;
  }

  .trade-cards-grid,
  .trade-cards-grid.style-cards-grid {
    display: grid;
    grid-template-columns: none;
    grid-template-rows: repeat(2, auto);
    grid-auto-flow: column;
    grid-auto-columns: 170px;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.3rem;
    scrollbar-width: none;
  }

  .trade-cards-grid::-webkit-scrollbar {
    display: none;
  }

  .trade-cat-card {
    padding: 0.55rem 0.65rem;
  }

  .trade-cat-top {
    font-size: 1rem;
  }

  .trade-cat-name {
    font-size: 0.75rem;
  }

  /* 3. Thanh kết quả & Thẻ Công ty / Xưởng trên Điện thoại */
  .directory-main {
    padding: 1.25rem 0 4rem;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding-bottom: 0.8rem;
  }

  .results-title {
    font-size: 1.02rem;
  }

  .toolbar-controls {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem;
  }

  .mobile-filter-trigger-btn {
    flex: 1;
    justify-content: center;
  }

  .sort-select {
    flex: 1.2;
    min-width: 0;
    font-size: 0.79rem;
    padding: 0.48rem 0.6rem;
  }

  .view-switcher {
    display: none;
  }

  .card-media {
    height: 122px;
  }

  .card-top-badges {
    top: 0.4rem;
    left: 0.4rem;
    right: 0.4rem;
  }

  .card-top-badges .badge-row {
    gap: 0.2rem;
    max-width: calc(100% - 30px);
  }

  .card-top-badges .badge-factory {
    display: none;
  }

  .status-badge {
    font-size: 0.52rem;
    padding: 0.14rem 0.34rem;
    letter-spacing: 0.02em;
  }

  .icon-action-btn {
    width: 26px;
    height: 26px;
    font-size: 0.8rem;
  }

  .card-bottom-caption {
    bottom: 0.35rem;
    left: 0.4rem;
    right: 0.4rem;
    gap: 0.2rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .hq-pill,
  .rating-pill {
    font-size: 0.58rem;
    padding: 0.12rem 0.36rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .card-body {
    padding: 0.6rem;
    gap: 0.45rem;
  }

  .trade-cat-badge {
    font-size: 0.58rem;
    padding: 0.14rem 0.38rem;
    margin-bottom: 0.22rem;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
  }

  .company-name {
    font-size: 0.82rem;
    line-height: 1.26;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .company-tagline {
    font-size: 0.68rem;
    line-height: 1.32;
    margin-top: 0.15rem;
    -webkit-line-clamp: 2;
  }

  .card-info-matrix {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    padding: 0.65rem;
  }

  .card-footer {
    flex-direction: column;
    align-items: stretch;
    padding-top: 0.5rem;
    gap: 0.35rem;
  }

  .card-cta-group {
    order: 1;
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem;
  }

  .card-cta-group .btn-sm {
    padding: 0.38rem 0.42rem;
    font-size: 0.65rem;
    white-space: nowrap;
    justify-content: center;
  }

  .compare-check-label {
    order: 2;
    width: 100%;
    justify-content: center;
    padding: 0.26rem 0.4rem;
    font-size: 0.65rem;
    gap: 0.3rem;
  }

  /* Thanh sắp xếp Admin trên thẻ khi mở trên điện thoại */
  .card-reorder-bar {
    flex-wrap: wrap;
    padding: 0.45rem 0.65rem;
    gap: 0.4rem;
  }

  .card-reorder-left,
  .card-reorder-actions {
    width: 100%;
    justify-content: space-between;
  }

  /* 4. Modals, Bàn cân So sánh & Quick Reorder trên Điện thoại */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }

  .modal-container {
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
  }

  .modal-sticky-header {
    padding: 0.9rem 1rem;
  }

  .modal-title {
    font-size: 1.05rem;
  }

  .modal-body {
    padding: 1rem;
  }

  .profile-hero {
    padding: 0.85rem;
    gap: 0.9rem;
    margin-bottom: 1rem;
  }

  .profile-cover {
    height: 185px;
  }

  .profile-spec-row {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    padding: 0.5rem 0;
  }

  .profile-spec-label {
    padding-top: 0;
  }

  .profile-left-contact-actions {
    grid-template-columns: 1fr 1fr;
  }

  .profile-meta-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.55rem;
  }

  .profile-section {
    padding: 0.95rem;
  }

  .compare-dock {
    bottom: 0.5rem;
    width: calc(100vw - 1rem);
    padding: 0.65rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .dock-info {
    min-width: auto;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .dock-title {
    font-size: 0.98rem;
  }

  .dock-slots {
    width: 100%;
  }

  .dock-actions {
    width: 100%;
    justify-content: flex-end;
  }

  .quick-reorder-item {
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
  }

  .quick-reorder-controls {
    justify-content: space-between;
  }

  .toast-container {
    top: auto;
    bottom: 1rem;
    left: 0.75rem;
    right: 0.75rem;
  }
}



