/**
 * Aarlika Public Stylesheet
 * Single-variety Alphonso mango pulp for Texas brewers
 */

:root {
  --ink: #1F2937;
  --ink-light: #4B5563;
  --muted: #6B7280;
  --cream: #FFFDF9;
  --cream-soft: #FBF7EE;
  --paper: #FFFFFF;
  --border: #E5E7EB;
  --border-warm: #F3E8D2;
  --mango-gold: #F59E0B;
  --mango-deep: #D9770B;
  --leaf: #2D6A4F;
  --leaf-light: #E8F5E9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 12px 30px rgba(0,0,0,0.08);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  overflow-x: clip; /* clip, unlike hidden, doesn't make html/body a scroll container, which stopped the header from sticking */
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* Deep links (/#calculator, /#faq …) land below the sticky header */
main section[id],
#calculator,
#process,
#applications,
[role="tabpanel"] {
  scroll-margin-top: 5.5rem;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  overflow-x: clip;
}

.wrap {
  width: 100%;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ink);
}

p {
  color: var(--ink-light);
  font-size: 1.05rem;
  line-height: 1.65;
}

a {
  color: var(--mango-deep);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: #B45309;
}

/* Navigation */
nav {
  position: sticky;
  top: 0;
  background: rgba(255, 253, 249, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  padding: 12px 0;
}

nav .nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
}

.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  height: 56px;
}

.logo-img {
  height: 56px;
  max-height: 56px;
  width: auto;
  display: block;
  object-fit: contain;
}

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

.nav-links a {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink-light);
}

.nav-links a:hover {
  color: var(--mango-deep);
}

.header-cta-group {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.btn.header-cta {
  padding: 8px 18px;
  font-size: 0.88rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.btn.header-cta.btn-primary {
  border: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  min-height: 44px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.18s ease;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--mango-deep);
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(217, 119, 11, 0.25);
}

.btn-primary:hover {
  background: #B45309;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #FFFFFF;
  color: var(--ink) !important;
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #F9FAFB;
  border-color: #D1D5DB;
}

/* Hero Section */
.hero {
  padding: 68px 0 60px;
  border-bottom: 1px solid var(--border-warm);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 48px;
  align-items: center;
  min-width: 0;
}

.hero-grid > * {
  min-width: 0;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--leaf-light);
  color: var(--leaf);
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: 3rem;
  margin-bottom: 18px;
  letter-spacing: -0.02em;
}

.hero-sub {
  font-size: 1.15rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin-bottom: 28px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-visual-card {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
}

.hero-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #F3F4F6;
  font-size: 0.92rem;
}

.hero-stat-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.hero-stat-row > span:first-child {
  color: var(--muted);
  flex-shrink: 0;
  white-space: nowrap;
}

.hero-stat-row > span:last-child {
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  line-height: 1.45;
}

/* Sections */
.section-pad {
  padding: 68px 0;
  border-bottom: 1px solid var(--border-warm);
}

.section-head {
  text-align: center;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 44px;
}

.section-head h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.section-head p {
  font-size: 1.05rem;
  color: var(--muted);
}

/* Cards & Grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}

.feature-card:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
}

.feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--leaf-light);
  color: var(--leaf);
  margin-bottom: 16px;
}

/* One line-icon set (Lucide paths, ISC licence) in brand green */
.feature-icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* Product Imagery & Trust Anchors */
.product-gallery {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 40px;
}

.gallery-card {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.gallery-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #F3E8D2;
}

.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-card:hover .gallery-img-wrap img {
  transform: scale(1.02);
}

.gallery-caption {
  padding: 22px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.gallery-tag {
  background: var(--leaf-light);
  color: var(--leaf);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 10px;
  width: fit-content;
}

.gallery-caption h4 {
  font-family: 'Fraunces', serif;
  font-size: 1.25rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.gallery-caption p {
  font-size: 0.93rem;
  color: var(--ink-light);
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 768px) {
  .product-gallery {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* Story Section */
.story-container {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.story-lead {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
}

/* Specs Table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table.specs-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  text-align: left;
}

table.specs-table th {
  background: #F9FAFB;
  padding: 14px 20px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}

table.specs-table td {
  padding: 16px 20px;
  font-size: 0.95rem;
  border-bottom: 1px solid #F3F4F6;
  color: var(--ink);
}

table.specs-table tr:last-child td {
  border-bottom: none;
}

table.specs-table td strong {
  color: var(--ink);
  font-weight: 600;
}

.todo-pill {
  display: inline-block;
  background: #FEF3C7;
  color: #92400E;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}

/* Calculator Card */
.calc-card {
  background: var(--paper);
  border: 1.5px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 16px;
  min-height: 44px;
  background: #FFFFFF;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--mango-deep);
  box-shadow: 0 0 0 3px rgba(217, 119, 11, 0.15);
}

.calc-results-box {
  background: var(--cream-soft);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.res-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.res-item {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.res-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}

.res-val {
  font-family: 'Fraunces', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.calc-advice {
  background: var(--paper);
  border-left: 3px solid var(--leaf);
  padding: 12px 14px;
  border-radius: 4px;
  font-size: 0.86rem;
  color: var(--ink-light);
  line-height: 1.5;
}

/* Cellar Handling Notes */
.cellar-section {
  padding: 64px 0;
  border-bottom: 1px solid var(--border);
  background: var(--cream);
}

.cellar-section h2 {
  font-size: 2rem;
  margin-bottom: 28px;
  text-align: center;
}

.notes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.note-card {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
}

.note-card h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 10px;
}

.note-card p {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.6;
  margin: 0;
}

.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 16px 0 8px;
  cursor: pointer;
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.45;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--mango-deep);
  cursor: pointer;
  flex-shrink: 0;
}

/* Timeline */
.timeline-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.timeline-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.timeline-bullet {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #FEF3C7;
  color: var(--mango-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

/* FAQ Section */
.faq-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
}

.faq-item {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.faq-item h3 {
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.faq-item p {
  font-size: 0.98rem;
  color: var(--ink-light);
  line-height: 1.6;
}

/* Turnstile */
.turnstile-wrapper {
  margin: 16px 0;
  display: flex;
  justify-content: center;
}

/* Sample Request Form */
.form-card {
  background: var(--paper);
  border: 1px solid var(--border-warm);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-md);
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* Form Feedback, Validation & States */
.field-error {
  display: none;
  font-size: 0.82rem;
  color: #DC2626;
  margin-top: 5px;
  font-weight: 600;
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: #DC2626 !important;
  background-color: #FEF2F2 !important;
}

.form-input.is-invalid:focus,
.form-select.is-invalid:focus,
.form-textarea.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15) !important;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sample-success-banner {
  background: #ECFDF5;
  border: 1.5px solid #10B981;
  border-radius: var(--radius-md);
  padding: 36px 24px;
  text-align: center;
  color: #065F46;
}

.sample-success-banner .success-icon {
  width: 52px;
  height: 52px;
  background: #10B981;
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 auto 16px;
}

.sample-success-banner h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: #065F46;
  margin-bottom: 10px;
}

.sample-success-banner p {
  font-size: 1.05rem;
  color: #047857;
  max-width: 560px;
  margin: 0 auto 12px;
  line-height: 1.5;
}

.sample-success-banner .success-details {
  font-size: 0.9rem;
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  margin-top: 8px;
}

.sample-error-banner {
  background: #FEF2F2;
  border: 1px solid #F87171;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  color: #991B1B;
  margin-top: 18px;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: left;
}

.sample-error-banner a {
  color: #B91C1C;
  font-weight: 700;
  text-decoration: underline;
}

/* Footer */
footer {
  background: var(--cream-soft);
  color: var(--ink-light);
  border-top: 1px solid var(--border-warm);
  padding: 56px 0 36px;
  font-size: 0.92rem;
}

.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
}

.footer-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  color: var(--ink);
  margin-bottom: 8px;
}

.footer-nav {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-nav a {
  color: var(--ink-light);
  font-size: 0.9rem;
  text-decoration: none;
  transition: color 0.15s ease;
}

.footer-nav a:hover {
  color: var(--mango-deep);
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.85rem;
}

/* Header menu (links were inline-styled per page) and the phone menu button */
.nav-menu-links {
  display: flex;
  gap: 16px;
  align-items: center;
  white-space: nowrap;
}

.nav-menu-links a {
  color: var(--ink-light);
  font-size: 0.9rem;
  text-decoration: none;
}

.nav-toggle {
  display: none;
  order: 3;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-close,
nav.menu-open .nav-toggle-bars {
  display: none;
}

nav.menu-open .nav-toggle-close {
  display: inline;
}

/* Crawl link at the end of each homepage section, to that topic's own page */
.section-crawl-link {
  margin-top: 28px;
  text-align: center;
  font-size: 0.95rem;
}

.section-crawl-link a {
  color: #2D6A4F;
  font-weight: 600;
}

/* About page long-form copy */
.about-story h2 {
  font-size: 1.5rem;
  margin: 40px 0 12px;
}

.about-story h2:first-child {
  margin-top: 0;
}

.about-story p {
  margin: 0 0 16px;
}

/* Calculator batch carried to the sample section */
.batch-summary {
  max-width: 680px;
  margin: 0 auto 20px;
  background: #FFF7EB;
  border: 1.5px solid #F5C77E;
  border-radius: 16px;
  padding: 20px 24px;
  text-align: left;
}

.batch-summary[hidden] {
  display: none;
}

.batch-summary-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 12px;
}

/* Calculator box count: the number large, pack size and surplus small */
.res-sub {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-top: 2px;
}

/* Even card grids: 4 across on desktop, 2×2 on tablets (no orphan card) */
.cards-grid.cards-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .cards-grid.cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Supply chain steps: a horizontal timeline on desktop, a vertical one on smaller screens.
   The line runs behind the cards and shows in the gaps between them. */
.steps-timeline {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 24px;
  position: relative;
}

.steps-timeline::before {
  content: '';
  position: absolute;
  top: 48px;
  left: 24px;
  right: 24px;
  height: 2px;
  background: var(--leaf);
  opacity: 0.35;
}

.steps-timeline > li {
  position: relative;
  counter-increment: step;
  padding: 24px 20px;
}

.steps-timeline > li h3 {
  font-size: 1.05rem;
}

.steps-timeline > li h3::before {
  content: 'Step ' counter(step);
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mango-deep);
  margin-bottom: 4px;
}

.steps-timeline > li p {
  font-size: 0.9rem;
}

@media (max-width: 1000px) {
  .steps-timeline {
    grid-template-columns: minmax(0, 1fr);
    max-width: 640px;
    margin: 0 auto;
  }
  .steps-timeline::before {
    top: 24px;
    bottom: 24px;
    left: 44px;
    right: auto;
    width: 2px;
    height: auto;
  }
}

/* Keep compound terms like "Bag-in-Box" on one line */
.nowrap {
  white-space: nowrap;
}

/* Hero: stack the highlights card under the copy before the two columns get cramped */
@media (max-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }
  .hero-visual-card {
    max-width: 640px;
  }
}

/* Keep the floating Brewmaster AI button off the footer links */
#public-footer {
  padding-bottom: 104px;
}

/* Mobile Responsiveness (375px & Tablets) */
.hero-ai-trust-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  font-size: 0.78rem;
  color: #6B7280;
  margin-top: 14px;
  hyphens: none;
}

.hero-ai-trust-legend span {
  white-space: nowrap;
}

/* Active nav item: current page, or (homepage) the section being read. Amber underline pill. */
.nav-menu-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 0.2s;
}

.nav-menu-links a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 3px;
  border-radius: 999px;
  background: #F59E0B;
  transform: scaleX(0);
  transition: transform 0.25s ease;
}

.nav-menu-links a[aria-current="page"],
.nav-menu-links a.is-active {
  color: #B45309 !important;
}

.nav-menu-links a[aria-current="page"]::after,
.nav-menu-links a.is-active::after {
  transform: scaleX(1);
}

/* Segmented tabs (homepage specs / packaging / styles) */
.seg-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #F3EDE2;
  border-radius: 999px;
  max-width: 640px;
  margin: 0 auto 24px;
}

.seg-tab {
  flex: 1;
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: #4B5563;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.seg-tab:hover {
  color: #1F2937;
}

.seg-tab[aria-selected="true"] {
  background: #FFFFFF;
  color: #B45309;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.seg-tab:focus-visible {
  outline: 2px solid #F59E0B;
  outline-offset: 2px;
}

/* Only the active panel takes up space (no blank gap under a short tab) */
.seg-panels {
  min-width: 0; /* a wide table scrolls inside .table-wrap instead of widening the page */
}

.seg-panels > [role="tabpanel"] {
  display: none;
}

.seg-panels > [role="tabpanel"].is-active {
  display: block;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

/* Calculator → sample reservation hand-off */
.calc-transfer-btn {
  width: 100%;
  margin-top: 16px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
}

@media (max-width: 600px) {
  .seg-tab {
    font-size: 0.8rem;
    padding: 9px 8px;
  }
  .batch-summary-grid {
    grid-template-columns: 1fr 1fr;
  }
  .batch-summary-grid .form-group:first-child {
    grid-column: 1 / -1;
  }
}

/* Below 1080px the six links no longer fit beside the logo and CTAs: they move into the menu
   button's panel, and the secondary CTA drops out */
/* Seven menu links + two CTAs only fit on wide screens; Bulk Supply stays a section on the page */
@media (max-width: 1360px) {
  .nav-links .header-cta.btn-secondary {
    display: none;
  }
}

@media (max-width: 1080px) {
  .nav-menu-links {
    display: none !important;
  }
  /* Phone/tablet menu: a button opens the links as a panel under the sticky header */
  .nav-toggle {
    display: inline-flex;
  }
  .nav-links {
    margin-left: auto;
  }
  nav.menu-open .nav-menu-links {
    display: flex !important;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0 !important;
    padding: 4px 20px 12px;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
  }
  nav.menu-open .nav-menu-links a {
    padding: 14px 4px;
    font-size: 1rem !important;
    border-bottom: 1px solid var(--border);
  }
  nav.menu-open .nav-menu-links a:last-child {
    border-bottom: none;
  }
  .nav-menu-links a::after {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    gap: 32px;
  }
  .hero h1 {
    font-size: 2.3rem;
  }
  .nav-links {
    gap: 12px;
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .cards-grid.cards-4 {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }
  .story-container {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .calc-card {
    grid-template-columns: 1fr;
    padding: 24px;
  }
  .timeline-card {
    grid-template-columns: 1fr;
  }
  .notes-grid {
    grid-template-columns: 1fr;
  }
  .form-grid-2 {
    grid-template-columns: 1fr;
  }
  .form-card {
    padding: 24px;
  }
  .footer-top {
    flex-direction: column;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 36px 0 32px;
  }
  .hero h1 {
    font-size: 1.85rem;
    line-height: 1.22;
  }
  .hero-sub {
    font-size: 1rem;
    line-height: 1.55;
    margin-bottom: 20px;
  }
  .section-pad {
    padding: 44px 0;
  }
  .section-head h2, h2 {
    font-size: 1.65rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
    min-height: 44px;
  }
  .nav-links {
    display: flex !important;
  }
  nav .nav-content {
    gap: 8px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .nav-links {
    min-width: 0;
  }
  .header-cta-group {
    gap: 6px;
  }
  .nav-links .btn {
    padding: 7px 10px !important;
    font-size: 0.74rem !important;
    min-height: 36px;
  }
  .logo,
  .logo-img {
    height: 42px !important;
    max-height: 42px !important;
    width: auto !important;
    flex-shrink: 0;
  }
  .hero-visual-card {
    padding: 20px 16px;
  }
  .hero-stat-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 0;
  }
  .hero-stat-row > span:first-child {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
  }
  .hero-stat-row > span:last-child {
    text-align: left;
    width: 100%;
    font-size: 0.95rem;
  }
  .calc-card,
  .form-card,
  .story-container,
  .timeline-card,
  .note-card,
  .faq-item {
    padding: 20px 16px;
  }
  .res-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* Very narrow phones: stack the two header actions under the logo */
@media (max-width: 370px) {
  nav .nav-content {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .nav-toggle {
    order: 1;
    margin-left: auto;
  }
  .nav-links {
    order: 2;
  }
  .nav-links,
  .header-cta-group {
    width: 100%;
  }
  .header-cta-group .btn {
    flex: 1;
  }
}
