/* 
 * Searchit Digital Marketplace CSS Design System
 * Built with Vanilla CSS supporting light/dark modern themes, glassmorphism, and responsive grids.
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

/* --- CUSTOM PROPERTIES --- */
:root {
  /* Light Theme Colors (Default) - Premium Blue and Green Theme */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #14213d; /* Deep navy — classic pairing with the brand yellow */
  --primary-hover: #1f325c;
  --primary-glow: rgba(20, 33, 61, 0.08);

  --secondary: #00a896; /* Teal */
  --secondary-hover: #028090;
  --secondary-glow: rgba(0, 168, 150, 0.1);

  --accent: #fca311; /* Brand yellow — keep */
  --accent-glow: rgba(252, 163, 17, 0.15);
  
  --success: #10b981;
  --success-glow: rgba(16, 185, 129, 0.2);
  --warning: #fca311;
  --danger: #ef4444;

  --border-color: rgba(226, 232, 240, 0.8);
  --border-glass: rgba(255, 255, 255, 0.6);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -1px rgba(0,0,0,0.03);
  --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.05), 0 8px 10px -6px rgba(0,0,0,0.03);
  --shadow-glow: 0 0 20px var(--primary-glow);
  
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-blur: blur(20px);
  --card-radius: 16px;
  --btn-radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- RESET & BASIC STYLES --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
  scroll-behavior: smooth;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: var(--transition);
}
a:hover {
  color: var(--primary-hover);
}

/* --- SCROLLBAR --- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-secondary);
}

/* --- GLOBAL APP SHELL --- */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

/* Background Ambient Lighting (Glow Blobs) */
.ambient-light {
  display: none;
  position: fixed;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.2;
  transition: var(--transition);
}
.blob-1 {
  top: -10%;
  left: -10%;
  background: transparent;
}
.blob-2 {
  bottom: -10%;
  right: -10%;
  background: transparent;
}
.blob-3 {
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  width: 300px;
  height: 300px;
  opacity: 0.1;
}
/* --- NAV BAR --- */
.main-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.6rem;
  font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}
.logo:hover {
  opacity: 0.9;
  transform: scale(1.02);
}
.logo-emblem {
  background: var(--accent);
  color: #0f172a;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.8rem;
  box-shadow: 0 4px 10px var(--accent-glow);
  position: relative;
}
.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
}
.logo-text span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
}
.nav-link {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  padding: 0.25rem 0;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--accent);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Toggle Switch */
.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.theme-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}

/* --- BUTTONS --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--btn-radius);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-family: inherit;
}
.btn-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
  opacity: 0.95;
}
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-tertiary);
  transform: translateY(-1px);
}
.btn-accent {
  background: var(--accent) !important;
  color: #0f172a !important;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 8px;
}
.btn-icon {
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
}

/* --- GLASS CARD COMPONENT --- */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}
.glass-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: rgba(79, 70, 229, 0.2);
}

/* --- MARKETING LANDING PAGE VIEWS --- */
.hero-section {
  padding: 6rem 2rem 4rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
  line-height: 1.15;
}
.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 700px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Core Searchbar System (Localized Category & District) */
.search-container {
  max-width: 850px;
  margin: 0 auto;
  border-radius: 20px;
  padding: 0.5rem;
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 0.5rem;
  align-items: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-glass);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
}
.search-field {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-right: 1px solid var(--border-color);
  height: 100%;
}
.search-field:nth-child(3) {
  border-right: none;
}
.search-field input, .search-field select {
  border: none;
  background: transparent;
  width: 100%;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}
.search-field select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}
.search-field i {
  color: var(--primary);
  font-size: 1.2rem;
}

/* Stats Counter Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  max-width: 1000px;
  margin: 3rem auto 0;
}
.stat-card {
  text-align: center;
}
.stat-num {
  font-size: 2.2rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  color: var(--primary);
}
.stat-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Categories Quick Grid */
.category-section {
  padding: 4rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.section-header {
  margin-bottom: 2.5rem;
  text-align: center;
}
.section-title {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}
.section-desc {
  color: var(--text-secondary);
  max-width: 550px;
  margin: 0 auto;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.category-card {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  cursor: pointer;
}
.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary);
  box-shadow: var(--shadow-lg), 0 0 15px var(--primary-glow);
}
.cat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary);
  flex-shrink: 0;
}
.cat-info h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}
.cat-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Workflow Flowchart */
.workflow-section {
  padding: 4rem 2rem;
  background: var(--bg-tertiary);
  position: relative;
}
.workflow-container {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}
.workflow-step {
  text-align: center;
  position: relative;
  z-index: 1;
}
.step-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  margin: 0 auto 1.5rem;
  box-shadow: 0 4px 10px var(--primary-glow);
}
.workflow-step h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}
.workflow-step p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}
/* Flow Lines */
.workflow-container::after {
  content: "";
  position: absolute;
  top: 24px;
  left: 10%;
  width: 80%;
  height: 2px;
  background: var(--primary);
  z-index: 0;
  opacity: 0.4;
}

/* B2B Revenue Calculator */
.calc-section {
  padding: 4rem 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.calc-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
  overflow: hidden;
  padding: 2.5rem;
}
.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.calc-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.calc-slider-label {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.95rem;
}
.calc-slider-label span:last-child {
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
}
.calc-slider-group input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
}
.calc-slider-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 0 10px var(--primary-glow);
}
.calc-slider-group input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
.calc-results {
  background: var(--bg-tertiary);
  border-radius: 12px;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  border: 1px solid var(--primary-glow);
}
.calc-total {
  font-size: 3.5rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  line-height: 1;
  margin: 0.5rem 0;
}
.calc-results p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* --- THE PORTAL DASHBOARD VIEW --- */
.dashboard-wrapper {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 73px);
}

/* Sidebar Styling */
.sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.sidebar-menu {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  list-style: none;
}
.sidebar-header {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  letter-spacing: 1px;
  padding: 0.75rem 0.75rem 0.25rem;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.92rem;
}
.sidebar-item:hover {
  background: var(--bg-tertiary);
  color: var(--primary);
}
.sidebar-item.active {
  background: var(--primary-glow);
  color: var(--primary);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
}
.sidebar-item i {
  font-size: 1.15rem;
  width: 20px;
}

/* Profile / Role Controller */
.profile-panel {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}
.profile-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.5rem;
}
.profile-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
}
.profile-name {
  font-size: 0.9rem;
  font-weight: 600;
}
.profile-role {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.role-toggle-btn {
  width: 100%;
  font-size: 0.8rem;
  padding: 0.5rem;
  border-radius: 8px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.role-toggle-btn:hover {
  background: var(--primary);
  color: #fff;
}

/* Main Dashboard Workspace */
.workspace {
  padding: 2rem;
  overflow-y: auto;
  max-height: calc(100vh - 73px);
  background: var(--bg-primary);
}
.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}
.workspace-title h2 {
  font-size: 1.8rem;
  margin-bottom: 0.25rem;
}
.workspace-title p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.workspace-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- CLASSIFIEDS / DIRECTORY LAYOUT (ikman style) --- */
.directory-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2rem;
}

/* Filters Panel */
.filters-panel {
  height: fit-content;
}
.filter-group {
  margin-bottom: 1.25rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.filter-label {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.75rem;
  display: block;
}
.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--text-primary);
}
.filter-option input[type="checkbox"], .filter-option input[type="radio"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}
.price-range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.price-input {
  width: 100%;
  padding: 0.4rem 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

/* List Results Area */
.list-results-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.result-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.result-count {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.sort-select {
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.85rem;
  outline: none;
}

/* Unified Classified Card (Sleek List/Grid like ikman.lk but modern) */
.classified-card {
  display: flex;
  gap: 1.5rem;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: var(--transition);
}
.classified-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(79, 70, 229, 0.3);
}
.classified-card.featured {
  background: var(--bg-secondary); border: 2px solid var(--secondary);
  border-color: var(--secondary);
}
.classified-badge-featured {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--secondary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 0 0 8px 0;
  text-transform: uppercase;
}
.classified-img-wrapper {
  width: 180px;
  height: 130px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-tertiary);
  flex-shrink: 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.classified-img-placeholder {
  font-size: 2rem;
  color: var(--text-muted);
}
.classified-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.classified-details {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}
.classified-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.classified-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}
.classified-title:hover {
  color: var(--primary);
  cursor: pointer;
}
.classified-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  font-family: 'Outfit', sans-serif;
  white-space: nowrap;
}
.classified-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0.5rem 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.classified-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.classified-meta-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.classified-meta-item i {
  color: var(--primary);
}
.classified-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Comparison Shelf floating bubble */
.comparison-shelf {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--bg-secondary);
  border: 1px solid var(--primary);
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.2);
  border-radius: 30px;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  z-index: 999;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.comparison-shelf.active {
  transform: translateX(-50%) translateY(0);
}
.shelf-items-count {
  font-weight: 700;
  font-size: 0.95rem;
}
.shelf-item-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-tertiary);
  padding: 0.3rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.shelf-item-remove {
  cursor: pointer;
  color: var(--danger);
  font-size: 0.85rem;
}

/* Side by Side Comparison Sheet Grid Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition);
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.comparison-modal {
  width: 90%;
  max-width: 1100px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2.5rem;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.15);
}
.modal-overlay.active .comparison-modal {
  transform: scale(1);
}
.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--text-secondary);
  transition: var(--transition);
}
.modal-close:hover {
  background: var(--danger);
  color: #fff;
}

/* Comparison Sheet Layout */
.comparison-sheet {
  display: grid;
  grid-template-columns: 200px 1fr 1fr;
  gap: 1px;
  background: var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 1.5rem;
  box-shadow: var(--shadow-lg);
}
.comparison-cell {
  background: var(--bg-secondary);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  font-size: 0.95rem;
}
.comparison-cell.header-row {
  background: var(--bg-tertiary);
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
}
.comparison-item-header {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}
.comparison-item-header img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 6px;
}
.comparison-item-header h3 {
  font-size: 1.1rem;
}
.comparison-winner {
  background: var(--bg-tertiary) !important;
  border: 1px solid rgba(16, 185, 129, 0.3);
  position: relative;
}
.comparison-winner::after {
  content: "🏆 Recommended";
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--success);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

/* --- IN-APP CHAT INTERFACE --- */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  height: calc(100vh - 180px);
  background: var(--bg-secondary);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-color);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.chat-sidebar {
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}
.chat-search-bar {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.chat-search-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  font-size: 0.88rem;
}
.chat-users-list {
  flex-grow: 1;
  overflow-y: auto;
}
.chat-user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.88rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  transition: var(--transition);
}
.chat-user-item:hover {
  background: var(--bg-tertiary);
}
.chat-user-item.active {
  background: var(--primary-glow);
  border-left: 3px solid var(--primary);
}
.chat-user-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-tertiary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  position: relative;
}
.chat-user-status {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  border: 2px solid var(--bg-secondary);
  position: absolute;
  bottom: 0;
  right: 0;
}
.chat-user-details {
  flex-grow: 1;
  overflow: hidden;
}
.chat-user-name {
  font-weight: 600;
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-user-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 400;
}
.chat-user-last-msg {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  margin-top: 0.15rem;
}

.chat-main {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-header {
  padding: 0.88rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-tertiary);
}
.chat-header-user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chat-header-name {
  font-weight: 700;
  font-size: 1rem;
}
.chat-header-status {
  font-size: 0.75rem;
  color: var(--success);
}
.chat-body {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-primary);
}
.chat-bubble {
  max-width: 65%;
  padding: 0.88rem 1.15rem;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.4;
  position: relative;
}
.chat-bubble.incoming {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
  border: 1px solid var(--border-color);
}
.chat-bubble.outgoing {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}
.chat-bubble-time {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  text-align: right;
  display: block;
}
.chat-bubble.outgoing .chat-bubble-time {
  color: rgba(255, 255, 255, 0.7);
}
.chat-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.chat-input {
  flex-grow: 1;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-tertiary);
  color: var(--text-primary);
  outline: none;
  font-family: inherit;
  font-size: 0.9rem;
}

/* --- PAYMENT METHOD INVOICING MODAL --- */
.payment-card-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
}
.credit-card {
  width: 100%;
  height: 180px;
  background: var(--primary);
  border-radius: 16px;
  padding: 1.5rem;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
  position: relative;
  overflow: hidden;
}
.credit-card::before {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 150px;
  height: 150px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 50%;
}
.credit-card-chip {
  width: 35px;
  height: 25px;
  background: #f59e0b;
  border-radius: 4px;
}
.credit-card-number {
  font-size: 1.3rem;
  font-family: monospace;
  letter-spacing: 2px;
}
.credit-card-details {
  display: flex;
  justify-content: space-between;
}
.credit-card-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  opacity: 0.8;
}
.credit-card-val {
  font-size: 0.85rem;
  font-weight: 600;
}

/* --- ANALYTICS DASHBOARD CHART SPEC (Pure SVG / CSS) --- */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.analytics-card {
  padding: 1.5rem;
}
.chart-container {
  height: 220px;
  margin-top: 1.5rem;
  position: relative;
}
.bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  padding-top: 20px;
}
.chart-bar-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex-grow: 1;
}
.chart-bar {
  width: 24px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 1s ease-out;
  position: relative;
}
.chart-bar:hover {
  background: var(--accent);
}
.chart-bar-tooltip {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: var(--bg-primary);
  font-size: 0.7rem;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  opacity: 0;
  transition: var(--transition);
  pointer-events: none;
}
.chart-bar:hover .chart-bar-tooltip {
  opacity: 1;
}
.chart-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Pie Chart using SVG stroke-dasharray */
.pie-chart-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
}
.donut-svg {
  transform: rotate(-90deg);
}
.donut-segment {
  fill: none;
  stroke-width: 8;
  transition: stroke-dasharray 1s ease;
}
.donut-segment-1 {
  stroke: var(--primary);
}
.donut-segment-2 {
  stroke: var(--secondary);
}
.donut-segment-3 {
  stroke: var(--accent);
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

/* --- MEDICAL CALENDAR SPEC --- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.5rem;
  margin-top: 1rem;
}
.calendar-header-cell {
  text-align: center;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
}
.calendar-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
}
.calendar-day:hover {
  border-color: var(--primary);
  background: var(--bg-tertiary);
}
.calendar-day.active {
  background: var(--primary-glow);
  border-color: var(--primary);
}
.calendar-day-num {
  font-weight: 600;
  font-size: 0.85rem;
}
.calendar-slots-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  margin: 0 auto;
}
.calendar-day.muted {
  opacity: 0.3;
  pointer-events: none;
}

/* --- NOTIFICATIONS BANNER --- */
.notif-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.notif-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  display: none;
  z-index: 1001;
}
.notif-dropdown.active {
  display: block;
}
.notif-header {
  padding: 0 1rem 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: 700;
  font-size: 0.9rem;
}
.notif-list {
  max-height: 250px;
  overflow-y: auto;
}
.notif-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover {
  background: var(--bg-tertiary);
}
.notif-item.unread {
  background: var(--primary-glow);
}

/* --- RESPONSIVE MEDIA QUERIES --- */
@media (max-width: 1024px) {
  .dashboard-wrapper {
    grid-template-columns: 80px 1fr;
  }
  .sidebar-item span, .sidebar-header, .profile-card, .role-toggle-btn span {
    display: none;
  }
  .sidebar-item {
    justify-content: center;
    padding: 0.88rem;
  }
  .sidebar-item i {
    font-size: 1.4rem;
    margin: 0;
  }
  .role-toggle-btn {
    padding: 0.5rem;
    border-radius: 50%;
    width: 42px;
    height: 42px;
  }
  .directory-layout {
    grid-template-columns: 1fr;
  }
  .filters-panel {
    display: none; /* Can toggle in real system, hidden for screen real estate here */
  }
  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow-container {
    grid-template-columns: repeat(2, 1fr);
  }
  .workflow-container::after {
    display: none;
  }
}

@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  .search-container {
    grid-template-columns: 1fr;
    padding: 1rem;
    border-radius: 16px;
  }
  .search-field {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
  }
  .search-field:nth-child(3) {
    border-bottom: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
  .calc-card {
    grid-template-columns: 1fr;
  }
  .classified-card {
    flex-direction: column;
  }
  .classified-img-wrapper {
    width: 100%;
    height: 180px;
  }
  .comparison-sheet {
    grid-template-columns: 1fr;
  }
  .comparison-cell.header-row {
    background: var(--bg-secondary);
    color: var(--primary);
    padding-bottom: 0.25rem;
  }
  .chat-layout {
    grid-template-columns: 1fr;
  }
  .chat-sidebar {
    display: none; /* toggleable list on mobile */
  }
  .payment-card-layout {
    grid-template-columns: 1fr;
  }
}

/* --- REBRANDING ADDITIONS: UNIQUE, MODERN & EYE-CATCHY GLASSMORPHISM --- */

/* Drag & Drop File Upload Zone */
.upload-zone {
  border: 2px dashed var(--primary);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  text-align: center;
  background: var(--bg-tertiary);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}
.upload-zone:hover {
  background: var(--primary-glow);
  border-color: var(--accent);
  transform: translateY(-2px);
}
.upload-zone i {
  font-size: 2rem;
  color: var(--primary);
  transition: var(--transition);
}
.upload-zone:hover i {
  color: var(--accent);
  transform: scale(1.1);
}
.upload-preview-box {
  display: none;
  position: relative;
  width: 100%;
  height: 150px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  margin-top: 1rem;
}
.upload-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.upload-preview-remove:hover {
  background: rgb(220, 38, 38);
  transform: scale(1.1);
}

/* Premium Top Featured Ads Grid & Cards */
.top-ads-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}
.top-ad-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: var(--shadow-md);
}
.top-ad-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--primary);
  opacity: 0.8;
}
.top-ad-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(139, 92, 246, 0.2), var(--shadow-glow);
  border-color: var(--primary);
}
.top-ad-img-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
}
.top-ad-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}
.top-ad-card:hover .top-ad-img-wrapper img {
  transform: scale(1.08);
}
.top-ad-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--accent); color: #0f172a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(255, 0, 122, 0.3);
  z-index: 5;
}
.top-ad-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.top-ad-cat {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.4rem;
}
.top-ad-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
  cursor: pointer;
  transition: var(--transition);
}
.top-ad-title:hover {
  color: var(--primary);
}
.top-ad-loc {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 1rem;
}
.top-ad-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
  padding: 0.75rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}
.top-ad-metric {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.top-ad-metric i {
  color: var(--primary);
}
.top-ad-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: 1rem;
}
.top-ad-price-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}
.top-ad-price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
}

/* Glass Card Overlay Styling (Breathtaking details!) */
.glass-glow-card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: var(--transition);
}
.glass-glow-card::after {
  content: '';
  position: absolute;
  width: 100px;
  height: 100px;
  background: var(--primary);
  filter: blur(50px);
  opacity: 0.2;
  top: -20px;
  right: -20px;
  pointer-events: none;
}

/* Unique Animated Grid Borders */
@keyframes neon-pulse {
  0%, 100% { border-color: var(--border-color); box-shadow: var(--shadow-sm); }
  50% { border-color: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }
}
.top-ad-pulsate {
  animation: neon-pulse 3s infinite;
}

/* Hero Grid Background Pattern */
.hero-grid-pattern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M40 0H0v1h39v39h1V0z' fill='%23cbd5e1' fill-opacity='0.25'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  z-index: 1;
  pointer-events: none;
}

/* --- ADDITIONS FOR RESPONSIVE COMPATIBILITY Across ALL DEVICE SIZES --- */
.search-divider {
  width: 1px;
  height: 35px;
  background: var(--border-color);
  display: block;
  margin: 0 5px;
}

@media (max-width: 768px) {
  .landing-section {
    padding: 3rem 1.25rem !important;
  }
  .hero-section {
    padding-top: 4rem !important;
    padding-bottom: 4rem !important;
  }
  .hero-title {
    font-size: 2.2rem !important;
    margin-bottom: 1rem !important;
  }
  .hero-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }

  /* Responsive Search bar on landing */
  .landing-search-container {
    flex-direction: column;
    align-items: stretch !important;
    gap: 0.75rem;
    padding: 1rem !important;
    border-radius: 16px !important;
  }
  .landing-search-fields {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .landing-search-field {
    width: 100% !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.75rem 0.5rem !important;
    min-width: 0 !important;
  }
  #landing-search-town-wrapper {
    border-bottom: none !important;
  }
  .search-divider {
    display: none !important;
  }
  .landing-search-container button {
    width: 100% !important;
    margin-left: 0 !important;
    height: 48px !important;
    border-radius: 12px !important;
  }

  /* Compact Main Navigation header */
  .main-nav {
    padding: 0.5rem 1rem !important;
  }
  .logo img {
    height: 55px !important;
  }
  .nav-links {
    gap: 0.75rem !important;
  }
  .nav-link {
    font-size: 0.82rem !important;
  }
  .nav-chat-link span,
  .nav-login-link span {
    display: none !important;
  }
  .nav-post-btn span {
    display: none !important;
  }
  .nav-post-btn {
    padding: 0 !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* Sticky drawer menu sidebar on mobile */
  .sidebar-toggle-btn {
    display: flex !important;
  }
  .sidebar-mobile-header {
    display: flex !important;
  }
  .sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    height: 100vh !important;
    width: 280px !important;
    z-index: 2000 !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s ease !important;
    box-shadow: var(--shadow-lg) !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }
  .sidebar-item span,
  .sidebar-header,
  .profile-card,
  .role-toggle-btn span {
    display: block !important;
  }
  .sidebar-item {
    justify-content: flex-start !important;
    padding: 0.75rem 1rem !important;
  }
  .sidebar-item i {
    font-size: 1rem !important;
    margin-right: 0.85rem !important;
  }
  .role-toggle-btn {
    width: 100% !important;
    height: auto !important;
    border-radius: 8px !important;
    padding: 0.6rem 1rem !important;
  }

  /* Workspace Header & Action filters stacked */
  .workspace {
    padding: 1.25rem !important;
  }
  .workspace-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
    margin-bottom: 1.5rem !important;
  }
  .workspace-actions {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.75rem !important;
  }
  .workspace-actions > div {
    width: 100% !important;
  }
  .workspace-actions select {
    width: 100% !important;
  }

  /* Calculator card space saver */
  .calc-card {
    padding: 1.5rem !important;
    gap: 1.5rem !important;
  }

  /* Comparison modal sheet horizontal overflow scroll */
  .comparison-modal {
    padding: 1.25rem !important;
    width: 95% !important;
    max-height: 90vh !important;
  }
  .comparison-sheet {
    min-width: 600px !important;
  }
  #comparison-sheet-container {
    overflow-x: auto !important;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Mobile Master-Detail Chat layout */
  .chat-layout {
    grid-template-columns: 1fr !important;
    height: calc(100vh - 150px) !important;
  }
  .chat-sidebar {
    display: block !important;
    border-right: none !important;
  }
  .chat-main {
    display: none !important;
  }
  .chat-layout.show-chat .chat-sidebar {
    display: none !important;
  }
  .chat-layout.show-chat .chat-main {
    display: flex !important;
  }
  .chat-back-btn {
    display: flex !important;
  }
}

/* --- POST AD: MULTI-PHOTO WORKFLOW --- */
.post-ad-page {
  min-height: 70vh;
  padding: 2.5rem 1.25rem 5rem;
  background: var(--bg-primary);
}
.post-ad-shell {
  width: min(100%, 760px);
  margin: 0 auto;
}
.post-ad-panel {
  padding: 2.5rem 2rem;
  border-radius: var(--card-radius);
}
.post-ad-title {
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  text-align: center;
}
.post-ad-title i {
  color: var(--accent);
}
.post-ad-intro {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
  text-align: center;
}
.post-ad-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.post-ad-fields-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.post-ad-fields-grid-single {
  grid-template-columns: 1fr;
}
.post-ad-form .price-input {
  min-height: 48px;
}
.post-ad-form textarea.price-input {
  min-height: 100px;
  resize: none !important;
}
.post-ad-upload-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.post-ad-upload-heading p {
  margin-top: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}
#post-ad-image-count {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: var(--accent-glow);
  color: #7a4d00;
  font-size: 0.78rem;
  font-weight: 700;
}
.post-ad-photo-field .upload-zone {
  min-height: 148px;
  justify-content: center;
  border-color: var(--accent);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  transform: none;
}
.post-ad-photo-field .upload-zone:hover,
.post-ad-photo-field .upload-zone.is-dragging {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: none;
}
.post-ad-photo-field .upload-zone:focus-visible,
.post-ad-back:focus-visible,
.ad-gallery-arrow:focus-visible,
.ad-gallery-expand:focus-visible,
.ad-media-thumb:focus-visible,
.ad-lightbox button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.post-ad-photo-field .upload-zone.is-full {
  display: none;
}
.upload-zone-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--accent-glow);
}
.post-ad-photo-field .upload-zone i {
  font-size: 1.25rem;
  color: var(--accent);
  transform: none;
}
.post-ad-photo-field .upload-zone strong {
  color: var(--text-primary);
}
.post-ad-photo-field .upload-zone small {
  color: var(--text-muted);
}
.upload-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.upload-preview-item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 12px;
  background: var(--bg-tertiary);
}
.upload-preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.upload-cover-badge {
  position: absolute;
  left: 0.5rem;
  bottom: 0.5rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--accent);
  color: #0f172a;
  font-size: 0.7rem;
  font-weight: 700;
}
.upload-preview-grid .upload-preview-remove {
  top: 0.45rem;
  right: 0.45rem;
  width: 44px;
  height: 44px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  font-size: 1rem;
}
.upload-preview-grid .upload-preview-remove:hover {
  background: var(--danger);
  transform: none;
}
.post-ad-upload-status {
  min-height: 1.25rem;
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.post-ad-promotion {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: 16px;
  background: var(--bg-secondary);
  transition: border-color 180ms ease, background-color 180ms ease;
}

.post-ad-promotion.is-selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.post-ad-promotion-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
}

.post-ad-promotion-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 12px;
  background: var(--accent);
  color: #0f172a;
  font-size: 1.2rem;
}

.post-ad-promotion-copy > div {
  min-width: 0;
}

.post-ad-promotion-copy p {
  margin: 0.25rem 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.45;
}

.post-ad-promotion-copy small,
.post-ad-promotion-choice small {
  display: block;
  color: var(--text-muted);
  font-size: 0.74rem;
}

.post-ad-promotion-choice {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-height: 48px;
  flex: 0 0 auto;
  cursor: pointer;
}

.post-ad-promotion-choice input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
  cursor: pointer;
}

.post-ad-promotion-choice strong {
  color: var(--text-primary);
}

/* --- AD DETAILS: RESPONSIVE PHOTO FUNCTIONALITY --- */
.ad-details-page {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 3rem 5%;
  background: var(--bg-primary);
}
.ad-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  margin-bottom: 2rem;
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-transform: capitalize;
}
.ad-breadcrumb button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.ad-breadcrumb button i {
  margin-right: 0.35rem;
}
.ad-breadcrumb span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-media-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
  margin-bottom: 3rem;
  padding: 0.75rem;
  border-radius: 16px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-md);
}
.ad-media-gallery.has-single-image {
  grid-template-columns: 1fr;
}
.ad-media-main {
  position: relative;
  min-width: 0;
  height: clamp(340px, 56vh, 560px);
  overflow: hidden;
  border-radius: 14px;
  border: 2px solid var(--accent);
  background: var(--bg-tertiary);
}
.ad-media-main > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: zoom-in;
}
.ad-media-thumbs {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.75rem;
  min-width: 0;
}
.ad-media-thumb {
  min-width: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--bg-tertiary);
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 180ms ease, border-color 180ms ease;
}
.ad-media-thumb:hover,
.ad-media-thumb.is-active {
  border-color: var(--accent);
  opacity: 1;
}
.ad-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ad-gallery-arrow,
.ad-lightbox-arrow,
.ad-lightbox-close {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  cursor: pointer;
}
.ad-gallery-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}
.ad-gallery-arrow:hover,
.ad-lightbox-arrow:hover,
.ad-lightbox-close:hover {
  background: #0f172a;
}
.ad-gallery-arrow-prev {
  left: 0.85rem;
}
.ad-gallery-arrow-next {
  right: 0.85rem;
}
.ad-gallery-expand {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.65rem 0.85rem;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}
.ad-gallery-count {
  position: absolute;
  left: 0.85rem;
  bottom: 0.85rem;
  padding: 0.5rem 0.65rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
}
.ad-details-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
  gap: 3rem;
  align-items: start;
}
.ad-title-block h1 {
  max-width: 24ch;
  margin: 0 0 0.5rem;
  font-size: 2.2rem;
  letter-spacing: normal;
  text-wrap: balance;
}
.ad-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.86rem;
  margin-bottom: 2rem;
}
.ad-meta-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.ad-meta-row i {
  color: var(--accent);
}
.ad-info-section {
  margin-top: 2.5rem;
}
.ad-info-section h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent);
  font-size: 1.25rem;
}
.ad-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 0;
}
.ad-specs-grid .spec-item {
  padding: 1rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-tertiary);
}
.ad-specs-grid dt {
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
}
.ad-specs-grid dd {
  margin: 0.28rem 0 0;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
}
.ad-description {
  max-width: 70ch;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  white-space: pre-wrap;
  text-wrap: pretty;
}
.ad-contact-panel {
  position: sticky;
  top: 100px;
  padding: 2.5rem;
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--accent);
  border-radius: 16px;
  background: var(--bg-secondary);
  box-shadow: var(--shadow-lg);
}
.ad-price-block {
  display: flex;
  flex-direction: column;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-color);
}
.ad-price-block > span,
.ad-price-block small {
  color: var(--text-secondary);
  font-size: 0.78rem;
}
.ad-price-block strong {
  margin: 0.25rem 0;
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-size: clamp(1.65rem, 2.8vw, 2.5rem);
  line-height: 1.2;
  white-space: nowrap;
}
.ad-seller-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1.5rem 0 2rem;
  padding: 1.5rem;
  border-radius: 16px;
  background: var(--bg-tertiary);
}
.ad-seller-avatar {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #0f172a;
  font-weight: 800;
}
.ad-seller-row > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}
.ad-seller-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ad-seller-row span {
  color: #087f5b;
  font-size: 0.78rem;
  font-weight: 600;
}
.ad-contact-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.ad-contact-actions .btn,
.ad-message-box .btn {
  min-height: 50px;
  width: 100%;
}
.ad-whatsapp-btn {
  background: #128c5e;
  color: #fff;
}
.ad-whatsapp-btn:hover {
  background: #0d754e;
  color: #fff;
}
.ad-message-box {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}
.ad-message-box label {
  display: block;
  margin-bottom: 0.55rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.ad-message-box textarea {
  min-height: 100px;
  margin-bottom: 0.65rem;
  resize: vertical;
}
.ad-safety-note {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  color: var(--text-secondary);
  font-size: 0.75rem;
  line-height: 1.5;
}
.ad-safety-note i {
  margin-top: 0.15rem;
  color: var(--accent);
}
body.lightbox-open {
  overflow: hidden;
}
.ad-lightbox {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem;
  padding: 2rem;
  background: rgba(3, 7, 18, 0.96);
  opacity: 0;
  transition: opacity 180ms ease;
}
.ad-lightbox.is-open {
  opacity: 1;
}
.ad-lightbox-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  height: calc(100vh - 4rem);
}
.ad-lightbox-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.ad-lightbox-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, env(safe-area-inset-right));
}
.ad-lightbox-count {
  position: absolute;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.85);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 980px) {
  .ad-media-gallery {
    grid-template-columns: 1fr;
  }
  .ad-media-thumbs {
    display: flex;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    scroll-snap-type: x proximity;
  }
  .ad-media-thumb {
    width: 112px;
    height: 80px;
    flex: 0 0 112px;
    scroll-snap-align: start;
  }
  .ad-details-layout {
    grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
    gap: 1.5rem;
  }
}

@media (max-width: 760px) {
  .post-ad-page {
    padding: 1.25rem 1rem 3rem;
  }
  .post-ad-heading-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 1rem;
  }
  .post-ad-heading-row h1 {
    max-width: none;
    font-size: 1.85rem;
  }
  .post-ad-trust-note {
    flex-basis: auto;
    width: 100%;
  }
  .post-ad-panel {
    padding: 1.25rem;
  }
  .post-ad-fields-grid {
    grid-template-columns: 1fr;
  }
  .post-ad-promotion {
    align-items: stretch;
    flex-direction: column;
  }
  .post-ad-promotion-choice {
    justify-content: space-between;
    width: 100%;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
  }
  .upload-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ad-details-page {
    padding: 1rem 1rem 3rem;
  }
  .ad-breadcrumb span:nth-of-type(2),
  .ad-breadcrumb span:nth-of-type(3) {
    display: none;
  }
  .ad-media-gallery {
    margin-inline: -1rem;
    padding: 0.5rem;
    border-radius: 0;
  }
  .ad-media-main {
    height: clamp(280px, 52vh, 420px);
    border-radius: 0;
  }
  .ad-media-thumbs {
    padding: 0 1rem 0.25rem;
  }
  .ad-gallery-expand span {
    display: none;
  }
  .ad-gallery-expand {
    width: 44px;
    justify-content: center;
    padding: 0;
  }
  .ad-gallery-arrow {
    width: 44px;
    height: 44px;
  }
  .ad-details-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .ad-title-block h1 {
    max-width: none;
    font-size: 1.9rem;
  }
  .ad-contact-panel {
    position: static;
    padding: 1.25rem;
  }
  .ad-lightbox {
    grid-template-columns: 1fr;
    padding: 4rem 0.75rem 1rem;
  }
  .ad-lightbox-stage {
    height: calc(100vh - 5rem);
  }
  .ad-lightbox-arrow {
    position: absolute;
    z-index: 1;
    top: 50%;
    width: 46px;
    height: 46px;
  }
  .ad-lightbox-prev {
    left: 0.75rem;
  }
  .ad-lightbox-next {
    right: 0.75rem;
  }
}

@media (max-width: 540px) {
  .main-nav {
    gap: 0.5rem;
  }
  .main-nav .nav-links {
    display: none;
  }
  .nav-actions {
    gap: 0.65rem !important;
  }
  .logo img {
    height: 48px !important;
  }
  .upload-preview-grid {
    gap: 0.55rem;
  }
  .ad-meta-row {
    flex-direction: column;
    gap: 0.55rem;
  }
  .ad-specs-grid {
    grid-template-columns: 1fr;
  }
  .ad-gallery-count {
    left: 0.65rem;
    bottom: 0.65rem;
  }
  .ad-gallery-expand {
    right: 0.65rem;
    bottom: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-media-thumb,
  .ad-lightbox,
  .post-ad-photo-field .upload-zone,
  .upload-preview-remove {
    transition: none !important;
  }
  .post-ad-promotion {
    transition: none !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* --- RESPONSIVE HARDENING & SECURE CHECKOUT --- */
img,
video,
canvas,
svg {
  max-width: 100%;
}

#app-view-container,
.dashboard-wrapper,
.workspace,
.directory-layout,
.directory-results,
.classified-content,
.chat-main {
  min-width: 0;
}

body.payment-open {
  overflow: hidden;
}

.payment-checkout-page {
  width: min(1040px, calc(100vw - 2rem));
  max-height: min(860px, calc(100dvh - 2rem));
  overflow: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
}

.payment-checkout-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.payment-checkout-header h2 {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
}

.payment-checkout-header h2 i,
.payment-checkout-intro > i,
.payment-provider-note i {
  color: var(--accent);
}

.payment-checkout-content {
  padding: 1.5rem;
}

.payment-checkout-intro {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  background: var(--bg-tertiary);
}

.payment-checkout-intro > i {
  margin-top: 0.15rem;
  font-size: 1.35rem;
}

.payment-checkout-intro h3 {
  margin-bottom: 0.2rem;
  font-size: 1rem;
}

.payment-checkout-intro p,
.payment-provider-note,
.payment-terms,
.payment-status-card > p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.55;
}

.payment-checkout-layout {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.22fr);
  gap: 1.5rem;
  align-items: start;
}

.payment-order-summary,
.payment-customer-form {
  padding: 1.4rem;
}

.payment-order-summary h3,
.payment-customer-form h3 {
  margin-bottom: 1.25rem;
}

.payment-order-summary dl > div,
.payment-receipt-details > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border-color);
}

.payment-order-summary dt,
.payment-receipt-details dt {
  color: var(--text-secondary);
}

.payment-order-summary dd,
.payment-receipt-details dd {
  margin: 0;
  max-width: 60%;
  overflow-wrap: anywhere;
  text-align: right;
  font-weight: 600;
}

.payment-order-summary .payment-total-row {
  margin-top: 0.35rem;
  border-bottom: 0;
  font-size: 1.08rem;
}

.payment-total-row dd {
  color: var(--accent);
}

.payment-provider-note {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 1rem;
}

.payment-customer-form {
  border: 1px solid var(--border-color);
  border-radius: var(--card-radius);
  background: var(--bg-secondary);
}

.payment-form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.payment-customer-form .calc-slider-group {
  margin-bottom: 1rem;
}

.payment-customer-form .price-input {
  width: 100%;
}

.payment-error {
  min-height: 1.4rem;
  margin-bottom: 0.5rem;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.4;
}

.payment-submit-btn {
  width: 100%;
  min-height: 48px;
}

.payment-submit-btn:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}

.payment-terms {
  margin-top: 0.75rem;
  text-align: center;
}

.payment-status-card {
  width: min(520px, calc(100vw - 2rem));
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 2rem;
  text-align: center;
}

.payment-status-card > i {
  margin-bottom: 1rem;
  color: var(--accent);
  font-size: 2.5rem;
}

.payment-status-card h2 {
  margin-bottom: 0.6rem;
}

.payment-status-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 1.65rem;
}

.payment-status-icon.is-success {
  background: var(--success-glow);
  color: var(--success);
}

.payment-receipt-details {
  margin: 1.25rem 0;
  text-align: left;
}

.payment-receipt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Original Searchit listing modal with the requested photo controls. */
.ad-details-modal {
  width: min(940px, calc(100vw - 2rem));
  max-width: 940px;
  max-height: calc(100dvh - 2rem);
  overflow: auto;
  padding: 2rem;
}

.ad-modal-breadcrumb {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.ad-details-modal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 1fr);
  gap: 2rem;
}

.ad-modal-gallery {
  margin-bottom: 1.5rem;
}

.ad-modal-title {
  margin-bottom: 0.25rem;
  font-size: 1.5rem;
}

.ad-modal-price {
  margin-bottom: 1rem;
  color: var(--accent);
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.ad-modal-section-title {
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
}

.ad-modal-specs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1rem;
  font-size: 0.9rem;
}

.ad-modal-spec {
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.ad-modal-description {
  margin-top: 1.5rem;
}

.ad-modal-description p {
  margin-top: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
}

.ad-modal-contact {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-tertiary);
}

.ad-modal-contact h4 {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.15rem;
}

.ad-modal-contact h4 i,
.ad-modal-seller-stats i {
  color: var(--accent);
}

.ad-modal-seller-stats,
.ad-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.ad-modal-actions .btn,
.ad-modal-message .btn {
  width: 100%;
  min-height: 44px;
}

.ad-modal-message {
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.ad-modal-message label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}

.ad-modal-message textarea {
  min-height: 76px;
  margin-bottom: 0.5rem;
  resize: vertical;
}

@media (max-width: 1024px) {
  .filters-panel {
    display: block;
  }

  .analytics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .ad-details-modal {
    width: 100vw;
    max-height: 100dvh;
    padding: 1rem;
    border-radius: 0;
  }

  .ad-details-modal-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-wrapper {
    display: block;
    grid-template-columns: 1fr;
  }

  .workspace {
    max-height: none;
    overflow: visible;
    padding-right: max(1.25rem, env(safe-area-inset-right)) !important;
    padding-left: max(1.25rem, env(safe-area-inset-left)) !important;
  }

  .sidebar {
    height: 100dvh !important;
    padding-bottom: env(safe-area-inset-bottom);
  }

  .main-nav {
    padding-right: max(1rem, env(safe-area-inset-right)) !important;
    padding-left: max(1rem, env(safe-area-inset-left)) !important;
  }

  .sidebar-toggle-btn,
  .nav-actions > a,
  .nav-actions > button {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .classified-header,
  .classified-content > div:first-child,
  .payment-checkout-header {
    flex-wrap: wrap;
  }

  .classified-card-actions,
  .payment-receipt-actions {
    width: 100%;
  }

  .classified-card-actions .btn,
  .payment-receipt-actions .btn {
    flex: 1 1 auto;
  }

  #doctor-scheduler-card {
    position: static !important;
    width: 100% !important;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .chat-layout {
    height: calc(100dvh - 140px) !important;
    min-height: 480px;
  }

  .chat-footer {
    padding: 0.75rem;
  }

  .chat-bubble {
    max-width: 86%;
  }

  .modal-overlay {
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .payment-checkout-page {
    width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
    border-right: 0;
    border-left: 0;
  }

  .payment-checkout-layout,
  .payment-form-row {
    grid-template-columns: 1fr;
  }

  .payment-checkout-content {
    padding: 1rem;
  }

  .payment-order-summary,
  .payment-customer-form {
    padding: 1.15rem;
  }

  .payment-customer-form input,
  .payment-customer-form select,
  .payment-customer-form textarea {
    min-height: 44px;
  }

  .notif-dropdown {
    position: fixed;
    top: 68px;
    right: max(0.75rem, env(safe-area-inset-right));
    left: max(0.75rem, env(safe-area-inset-left));
    width: auto;
    max-height: calc(100dvh - 90px);
    overflow-y: auto;
  }

  footer > div {
    flex-direction: column;
    align-items: center !important;
    gap: 1rem !important;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .ad-modal-specs {
    grid-template-columns: 1fr;
  }

  .workspace {
    padding: 1rem !important;
  }

  .workspace-title h2,
  .post-ad-heading-row h1,
  .ad-title-block h1 {
    font-size: 1.65rem !important;
  }

  .stats-grid,
  .upload-preview-grid {
    grid-template-columns: 1fr;
  }

  .payment-checkout-header .btn {
    min-width: 44px;
    padding-inline: 0.75rem;
  }

  .payment-checkout-header .btn i {
    margin-right: 0;
  }

  .payment-receipt-actions {
    flex-direction: column-reverse;
  }
}

@media (pointer: coarse) {
  button,
  .btn,
  .sidebar-item,
  .nav-link,
  select,
  input,
  textarea,
  [role="button"] {
    min-height: 44px;
  }
}

@media print {
  body * {
    visibility: hidden;
  }

  #printable-receipt,
  #printable-receipt * {
    visibility: visible;
  }

  #printable-receipt {
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    max-height: none;
    box-shadow: none;
    border: 0;
  }

  .payment-receipt-actions {
    display: none;
  }
}

/* ============================================================
   BRAND REFRESH ADDITIONS (logo, footer, responsive polish)
   ============================================================ */

/* Shared raster brand logo, cropped for efficient display from newlogo.png. */
.brand-logo {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  line-height: 0;
}
.brand-logo-image {
  width: auto;
  height: 60px;
  display: block;
  object-fit: contain;
}
.brand-logo--large .brand-logo-image { height: 96px; }

/* Modern responsive footer */
.site-footer {
  background: var(--primary);
  color: #cbd5e1;
  margin-top: auto;
}
.site-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
}
.site-footer .brand-logo {
  padding: 0.35rem 0.65rem;
  border-radius: 12px;
  background: #ffffff;
}
.site-footer .brand-logo-image { height: 68px; }
.site-footer-about {
  margin-top: 0.9rem;
  font-size: 0.85rem;
  line-height: 1.65;
  color: #94a3b8;
  max-width: 320px;
}
.site-footer-heading {
  font-family: 'Outfit', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--accent);
  margin-bottom: 1rem;
}
.site-footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.site-footer-links a {
  color: #cbd5e1;
  font-size: 0.88rem;
  transition: var(--transition);
}
.site-footer-links a:hover { color: var(--accent); }
.site-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1.1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.78rem;
  color: #94a3b8;
}
.site-footer-bottom a { color: var(--accent); font-weight: 700; }
@media (max-width: 860px) {
  .site-footer-inner {
    grid-template-columns: 1fr 1fr;
    padding: 2.25rem 1.25rem 1.5rem;
  }
  .site-footer-inner > .site-footer-brand { grid-column: 1 / -1; }
  .site-footer-bottom { justify-content: center; text-align: center; }
}
@media (max-width: 480px) {
  .site-footer-inner { grid-template-columns: 1fr; }
}

/* Admin panel: keep its sidebar usable on small screens */
@media (max-width: 768px) {
  .admin-sidebar {
    position: static !important;
    transform: none !important;
    width: 100% !important;
    height: auto !important;
    box-shadow: none !important;
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.9rem 1.25rem !important;
  }
  .admin-sidebar > div {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.75rem !important;
  }
  .admin-sidebar .sidebar-menu { display: flex; align-items: center; gap: 0.75rem; }
  .admin-sidebar .sidebar-header { display: block !important; margin: 0 !important; }
  .admin-sidebar > div > div {
    margin-top: 0 !important;
    padding-top: 0 !important;
    border-top: none !important;
  }
}

/* Post-ad form: collapse two-column rows on narrow phones */
@media (max-width: 560px) {
  .post-ad-fields-grid { grid-template-columns: 1fr; }
  #post-ad-specs-container div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
}
