/* ================================
   Global Styles & Theme
   (Aligned with PackForm)
================================ */

:root {
  --cream: #F5F0E8;
  --dark: #1A1A14;
  --olive: #4A5240;
  --sand: #C8B99A;
  --terracotta: #C4622D;
  --light-olive: #8A9478;
  --paper: #EDE8DC;
  --white: #FAFAF7;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--cream);
  color: var(--dark);
  line-height: 1.6;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ================================
   Navigation
================================ */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--dark);
  color: var(--cream);
  padding: 0.9rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 1.4rem;
  letter-spacing: -0.03em;
  color: var(--cream);
}

.logo::first-letter {
  color: var(--terracotta);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.8rem;
  list-style: none;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.nav-link a {
  color: rgba(245, 240, 232, 0.7);
  padding-bottom: 0.2rem;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link a:hover {
  color: var(--cream);
}

.nav-link.active a {
  border-color: var(--terracotta);
  color: var(--cream);
}

.nav-toggle {
  display: none;
  cursor: pointer;
  flex-direction: column;
  gap: 0.18rem;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--terracotta);
  margin: 4px 0;
}

/* ================================
   Buttons & Utilities
================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.6rem;
  border-radius: 3px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease, border-color 0.2s ease;
  box-shadow: 0 4px 16px rgba(26, 26, 20, 0.08);
}

.btn-primary {
  background-color: var(--terracotta);
  color: var(--white);
}

.btn-primary.alt {
  background-color: var(--dark);
  color: var(--cream);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid rgba(245, 240, 232, 0.3);
  color: var(--cream);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(26, 26, 20, 0.16);
  background-color: #b5571f;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge-orange {
  background-color: var(--terracotta);
  color: var(--white);
}

.badge-soft {
  background-color: var(--paper);
  color: var(--olive);
  border: 1px solid rgba(74, 82, 64, 0.25);
}

.tag-muted {
  font-size: 0.8rem;
  color: rgba(74, 82, 64, 0.85);
}

/* ================================
   Cards & Layout
================================ */

.card {
  background-color: var(--white);
  border-radius: 8px;
  border: 1px solid rgba(74, 82, 64, 0.15);
  padding: 1.6rem 1.7rem;
  box-shadow: 0 10px 30px rgba(26, 26, 20, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(26, 26, 20, 0.15);
  border-color: var(--terracotta);
  background: rgba(196, 98, 45, 0.03);
}

.page-section {
  padding: 4rem 0;
}

.page-title {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem;
  font-weight: 900;
  margin-bottom: 0.5rem;
  color: var(--dark);
}

.page-subtitle {
  font-size: 1rem;
  color: var(--olive);
}

/* ================================
   Home / Hero
================================ */

.hero {
  background-color: var(--dark);
  padding: 4.5rem 0 3.5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
}

.hero-heading {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.6rem, 3vw + 1.6rem, 3.6rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 1.2rem;
  color: var(--cream);
}

.hero-subheading {
  font-size: 1.05rem;
  max-width: 34rem;
  color: rgba(245, 240, 232, 0.7);
  margin-bottom: 1.8rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.hero-meta {
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: rgba(245, 240, 232, 0.5);
}

.hero-illustration {
  position: relative;
}

.hero-box-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.hero-box {
  background-color: var(--paper);
  border-radius: 16px;
  border: 1px solid rgba(74, 82, 64, 0.18);
  padding: 1.1rem;
  min-height: 90px;
  box-shadow: 0 12px 32px rgba(26, 26, 20, 0.35);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.hero-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(26, 26, 20, 0.5);
  background: #C4622D;
}

.hero-box-icon {
  font-size: 1.6rem;
}

.hero-box-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  margin-top: 0.4rem;
  color: var(--dark);
}

.hero-box-text {
  font-size: 0.8rem;
  color: var(--olive);
  margin-top: 0.3rem;
}

.hero-pattern {
  position: absolute;
  inset: 10%;
  pointer-events: none;
  opacity: 0.04;
  background-image: linear-gradient(90deg, var(--sand) 1px, transparent 1px),
    linear-gradient(var(--sand) 1px, transparent 1px);
  background-size: 24px 24px;
}

.hero-inner {
  position: relative;
  z-index: 1;
}

/* How It Works */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 2.2rem;
}

.step-number {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--terracotta);
}

.step-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.step-icon {
  font-size: 1.4rem;
}

.step-title {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--dark);
}

.step-description {
  font-size: 0.92rem;
  color: var(--olive);
}

/* Categories Preview */

.categories-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
  margin-top: 1.8rem;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: flex-start;
}

.category-icon {
  font-size: 1.6rem;
}

.category-label {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--dark);
}

/* ================================
   Suppliers Directory
================================ */

 .filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
}

.filters-bar select,
.filters-bar input[type='search'] {
  padding: 0.6rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(74, 82, 64, 0.4);
  background-color: var(--white);
  font-size: 0.9rem;
  min-width: 160px;
}

.filters-bar input[type='search'] {
  flex: 1;
  min-width: 200px;
}

.suppliers-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}

.supplier-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}

.supplier-icon {
  font-size: 1.6rem;
}

.supplier-name {
  font-weight: 700;
  font-size: 1.02rem;
  margin-bottom: 0.1rem;
}

.supplier-meta {
  font-size: 0.9rem;
  margin: 0.4rem 0;
  color: #444444;
}

.supplier-contact {
  font-size: 0.88rem;
  margin: 0.1rem 0;
}

.supplier-actions {
  margin-top: 0.9rem;
  display: flex;
  justify-content: flex-end;
}

/* Supplier modal */

 .modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background-color: var(--white);
  border-radius: 16px;
  border: 1px solid rgba(74, 82, 64, 0.4);
  max-width: 480px;
  width: 92%;
  padding: 1.8rem;
  box-shadow: 0 24px 60px rgba(26, 26, 20, 0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
}

.modal-body {
  font-size: 0.9rem;
  color: #333333;
}

/* ================================
   Finder Page
================================ */

 .finder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr);
  gap: 2rem;
  margin-top: 2rem;
}

.form-section {
  background-color: var(--white);
  border-radius: 12px;
  border: 1px solid rgba(74, 82, 64, 0.25);
  padding: 1.75rem;
  box-shadow: 0 10px 30px rgba(26, 26, 20, 0.06);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group-inline {
  display: flex;
  gap: 0.75rem;
}

.form-group-inline .form-group {
  flex: 1;
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

input[type='text'],
input[type='email'],
input[type='tel'],
input[type='number'],
select,
textarea {
  width: 100%;
  padding: 0.8rem 0.9rem;
  border-radius: 4px;
  border: 1.5px solid rgba(74, 82, 64, 0.25);
  background-color: var(--white);
  font-size: 0.9rem;
  color: var(--dark);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 1px rgba(196, 98, 45, 0.2);
}

textarea {
  min-height: 100px;
  resize: vertical;
}

.unit-select-wrapper {
  display: flex;
  gap: 0.5rem;
}

.unit-select-wrapper input[type='number'] {
  flex: 2;
}

.unit-select-wrapper select {
  flex: 1;
}

.results-section {
  min-height: 150px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1rem;
}

.results-count {
  font-size: 0.9rem;
  color: #444444;
}

 .results-empty {
  font-size: 0.92rem;
  color: var(--olive);
  border-radius: 12px;
  border: 1px dashed rgba(74, 82, 64, 0.6);
  padding: 1rem;
  background-color: rgba(237, 232, 220, 0.7);
}

/* ================================
   Form validation helpers
================================ */

.form-error-banner {
  border-left: 3px solid var(--terracotta);
  background: rgba(196, 98, 45, 0.06);
  color: var(--olive);
  padding: 0.9rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(196, 98, 45, 0.25);
}

.field-error {
  border-color: var(--terracotta) !important;
  box-shadow: 0 0 0 1px rgba(196, 98, 45, 0.2) !important;
}

.field-error-label {
  color: var(--terracotta);
}

/* ================================
   Footer
================================ */

.site-footer {
  margin-top: 3rem;
  background-color: var(--dark);
  color: var(--cream);
  padding: 2.5rem 0;
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.site-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ================================
   Responsive
================================ */

@media (max-width: 960px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-illustration {
    order: -1;
  }

  .steps-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .categories-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .suppliers-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finder-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .navbar-inner {
    align-items: center;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-links {
    position: absolute;
    right: 1.5rem;
    top: 3.2rem;
    flex-direction: column;
    align-items: flex-end;
    background-color: var(--dark);
    padding: 0.75rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    display: none;
  }

  .nav-links.open {
    display: flex;
  }

  .steps-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .categories-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .suppliers-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .filters-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .filters-bar input[type='search'] {
    min-width: 0;
  }

  .hero {
    padding-top: 3rem;
  }
}

/* ================================
   Page fade-up animation (PackForm style)
================================ */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

main > * {
  animation: fadeUp 0.4s ease both;
}

main > *:nth-child(2) {
  animation-delay: 0.07s;
}

main > *:nth-child(3) {
  animation-delay: 0.14s;
}
