:root {
  --bg: #F7F4EF;
  --fg: #1A1410;
  --accent: #C4622D;
  --accent-dark: #A04E22;
  --green: #2D5C3F;
  --green-light: #3D7A52;
  --warm-gray: #9A8F85;
  --border: #D6CFC6;
  --white: #FDFCFA;
  --hero-overlay: rgba(26, 20, 16, 0.55);
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(247, 244, 239, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-logo-mark { color: var(--accent); font-size: 1.1rem; }

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  opacity: 0.75;
  transition: opacity 0.2s;
}

.nav-links a:hover { opacity: 1; }

/* Hero */
.hero {
  padding: 4rem 2rem 3rem;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-headline {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2.4rem, 4.5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.12;
  color: var(--fg);
  margin-bottom: 1.5rem;
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--warm-gray);
  line-height: 1.7;
  max-width: 420px;
}

.hero-image-wrap {
  position: relative;
}

.hero-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.hero-img-caption {
  position: absolute;
  bottom: -1.5rem;
  right: 0;
  font-size: 0.75rem;
  color: var(--warm-gray);
  font-style: italic;
}

/* Stats */
.stats {
  background: var(--green);
  padding: 3rem 2rem;
}

.stats-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(253, 252, 250, 0.65);
  font-weight: 500;
}

.stat-divider {
  width: 1px;
  height: 50px;
  background: rgba(253, 252, 250, 0.2);
}

/* Features */
.features {
  padding: 5rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.features-header {
  text-align: center;
  margin-bottom: 4rem;
}

.features-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 1rem;
}

.features-sub {
  font-size: 1rem;
  color: var(--warm-gray);
  max-width: 480px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.feature-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--white);
  transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(26, 20, 16, 0.1);
}

.feature-icon { overflow: hidden; }

.feature-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}

.feature-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--fg);
  padding: 1.2rem 1.2rem 0.5rem;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--warm-gray);
  padding: 0 1.2rem 1.4rem;
  line-height: 1.6;
}

/* Categories */
.categories {
  padding: 4rem 2rem 5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.categories-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 2.5rem;
  text-align: center;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.cat-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2rem 1.5rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  background: var(--white);
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.cat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s;
}

.cat-card:hover::before { transform: scaleX(1); }

.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cat-icon { font-size: 1.5rem; color: var(--accent); margin-bottom: 0.5rem; }

.cat-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--fg);
}

.cat-count {
  font-size: 0.8rem;
  color: var(--warm-gray);
}

.cat-realestate::before { background: var(--green); }
.cat-vehicles::before { background: #8B4A2B; }
.cat-phones::before { background: #2B5B8B; }
.cat-fashion::before { background: var(--accent); }
.cat-jobs::before { background: #5C4B8B; }
.cat-other::before { background: var(--warm-gray); }

/* Closing */
.closing {
  background: var(--fg);
  padding: 6rem 2rem;
  text-align: center;
}

.closing-inner { max-width: 640px; margin: 0 auto; }

.closing-quote {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-style: italic;
  color: var(--white);
  margin-bottom: 1rem;
  line-height: 1.4;
}

.closing-attr {
  font-size: 0.85rem;
  color: rgba(253, 252, 250, 0.5);
  margin-bottom: 2.5rem;
  letter-spacing: 0.05em;
}

.closing-cta {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  padding: 0.85rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.btn-primary:hover { background: var(--accent-dark); }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--white);
  padding: 0.85rem 2rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid rgba(253, 252, 250, 0.3);
  transition: border-color 0.2s;
}

.btn-secondary:hover { border-color: rgba(253, 252, 250, 0.7); }

/* Footer */
.footer {
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 3rem 2rem 1.5rem;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 3rem;
  margin-bottom: 2.5rem;
}

.footer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  display: block;
  margin-bottom: 0.75rem;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--warm-gray);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: flex-start;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--warm-gray);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover { color: var(--fg); }

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 0.75rem;
  color: var(--warm-gray);
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
}

/* =========================================
   MOBILE FOUNDATIONS
   ========================================= */

/* Touch targets: minimum 44x44px */
button, a, input, select, textarea, .clickable {
  min-height: 44px;
  min-width: 44px;
}

/* Body text: minimum 16px — no iOS zoom on focus */
input, select, textarea {
  font-size: 16px !important;
}

/* Remove any horizontal overflow */
html, body {
  overflow-x: hidden;
}

/* =========================================
   HAMBURGER NAVIGATION
   ========================================= */

.nav-mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 4px;
  flex-shrink: 0;
}

.nav-mobile-toggle:focus { outline: 2px solid var(--accent); }

.nav-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  position: relative;
  transition: background 0.2s;
}

.nav-mobile-toggle span::before,
.nav-mobile-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: var(--fg);
  border-radius: 2px;
  transition: transform 0.25s;
}

.nav-mobile-toggle span::before { top: -7px; }
.nav-mobile-toggle span::after  { top: 7px; }

/* Open state */
.nav-mobile-toggle.open span { background: transparent; }
.nav-mobile-toggle.open span::before { transform: rotate(45deg) translate(5px, 5px); }
.nav-mobile-toggle.open span::after  { transform: rotate(-45deg) translate(5px, -5px); }

/* Overlay */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,20,16,0.5);
  z-index: 98;
  opacity: 0;
  transition: opacity 0.25s;
}

.nav-overlay.active {
  display: block;
  opacity: 1;
}

/* Mobile menu drawer */
.nav-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--white);
  z-index: 99;
  overflow-y: auto;
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -4px 0 24px rgba(26,20,16,0.15);
}

.nav-drawer.open { right: 0; }

.nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.nav-drawer-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-drawer-close {
  width: 44px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--warm-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  flex-shrink: 0;
}

.nav-drawer-close:focus { outline: 2px solid var(--accent); }

.nav-drawer-links {
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.nav-drawer-links a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  min-height: 52px;
}

.nav-drawer-links a:hover { background: var(--bg); }
.nav-drawer-links a:last-child { border-bottom: none; }

.nav-drawer-cta {
  margin: 1rem 1.25rem;
  display: block;
  background: var(--accent);
  color: var(--white) !important;
  padding: 0.85rem;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  border-bottom: none !important;
}

.nav-drawer-cta:hover { background: var(--accent-dark); }

/* =========================================
   RESPONSIVE BREAKPOINTS
   ========================================= */

@media (max-width: 768px) {
  /* Nav: switch to hamburger */
  .nav-links { display: none; }

  .nav-mobile-toggle { display: flex; }

  .nav-inner {
    padding: 0 1.25rem;
    gap: 1rem;
  }

  /* Hero: stack vertically */
  .hero { padding: 2.5rem 1.25rem 2rem; }
  .hero-content { grid-template-columns: 1fr; gap: 2rem; }
  .hero-image-wrap { order: -1; }
  .hero-img { aspect-ratio: 16/9; }
  .hero-sub { max-width: 100%; }
  .hero-cta { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

  /* Features: single column */
  .features-grid { grid-template-columns: 1fr; }

  /* Categories: 2 columns on tablet */
  .categories-grid { grid-template-columns: repeat(2, 1fr); }

  /* Stats */
  .stats-grid { flex-wrap: wrap; gap: 1.5rem; }
  .stat-divider { display: none; }

  /* Footer: column */
  .footer-inner { flex-direction: column; gap: 2rem; }
  .footer-links { gap: 1rem; }

  /* Listing detail: single column */
  .detail-grid { grid-template-columns: 1fr; }
  .listing-image { aspect-ratio: 16/9; }

  /* Sell form: single column — already is, ensure full-width */
  .container { padding: 1.5rem 1.25rem; }
  .form-card { padding: 1.25rem; }
}

@media (max-width: 480px) {
  /* Hero: tighter padding */
  .hero { padding: 2rem 1rem 1.5rem; }
  .hero-headline { font-size: 2rem; }

  /* Browse: 1-column on small phones */
  .listings-grid { grid-template-columns: 1fr !important; }

  /* Categories: 1 column on phone */
  .categories-grid { grid-template-columns: 1fr; }

  /* Closing CTA */
  .closing-cta { flex-direction: column; align-items: center; }

  /* Category pills: horizontal scroll */
  .sub-cat-list { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sub-cat-list::-webkit-scrollbar { display: none; }

  /* Page headers */
  .page-header { padding: 2.5rem 1.25rem 2rem; }
  .page-header h1 { font-size: 2rem; }
}

/* =========================================
   BLUR-UP IMAGE PLACEHOLDER
   ========================================= */
img[loading="lazy"] {
  background: var(--border);
}

/* =========================================
   STICKY BOTTOM BAR (listing detail)
   ========================================= */
.sticky-bottom-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 16px rgba(26,20,16,0.08);
  gap: 0.75rem;
  justify-content: flex-end;
  align-items: center;
}

.sticky-bottom-bar .contact-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0 1.5rem;
  background: var(--green);
  color: var(--white);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: background 0.2s;
}

.sticky-bottom-bar .contact-btn:hover { background: var(--green-light); }

.sticky-bottom-bar .boost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0 1.25rem;
  background: var(--accent);
  color: var(--white);
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.sticky-bottom-bar .boost-btn:hover { background: var(--accent-dark); }

/* =========================================
   SWIPEABLE CATEGORY PILLS
   ========================================= */
.swipe-pills {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.swipe-pills::-webkit-scrollbar { display: none; }

.swipe-pills .cat-pill {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

/* =========================================
   SELL FORM MOBILE ENHANCEMENTS
   ========================================= */
.form-input, .form-textarea, .form-select {
  min-height: 48px;
  font-size: 16px;
  padding: 0.75rem 1rem;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 6px;
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239A8F85' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.submit-btn { min-height: 52px; font-size: 1.05rem; border-radius: 6px; }

/* =========================================
   FOOTER COLLAPSIBLE ON MOBILE
   ========================================= */
.footer-collapsible-toggle {
  display: none;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border);
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.footer-section-links { display: flex; flex-direction: column; gap: 0.5rem; }

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column;
    gap: 0;
  }

  .footer-links-group {
    border-bottom: 1px solid var(--border);
  }

  .footer-links-group:last-child { border-bottom: none; }

  .footer-collapsible-toggle { display: flex; }

  .footer-section-links {
    display: none;
    padding-bottom: 0.75rem;
    gap: 0.6rem;
  }

  .footer-section-links.open { display: flex; }

  .footer-links-group .footer-links-toggle-icon {
    font-size: 1.2rem;
    transition: transform 0.2s;
  }

  .footer-links-group.open .footer-links-toggle-icon { transform: rotate(180deg); }
}