/* =============================================
   Dolci e Cucina — Design System v2
   Palette: Forest Green, Clean Neutrals
   ============================================= */

:root {
  /* Greens */
  --g900: #0d2b1e;
  --g800: #1b4332;
  --g700: #2d6a4f;
  --g600: #40916c;
  --g500: #52b788;
  --g200: #d8f3dc;
  --g100: #eef7f1;

  /* Neutrals */
  --n900: #111827;
  --n700: #374151;
  --n500: #6b7280;
  --n300: #d1d5db;
  --n100: #f9fafb;
  --white: #ffffff;

  /* Semantic */
  --primary:   var(--g700);
  --primary-d: var(--g800);
  --primary-l: var(--g500);
  --text:      var(--n900);
  --text-lt:   var(--n500);
  --border:    var(--n300);
  --bg:        #f8faf8;
  --bg-s:      var(--g100);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 16px rgba(0,0,0,.07), 0 2px 6px rgba(0,0,0,.04);
  --shadow-lg: 0 10px 40px rgba(0,0,0,.10), 0 4px 12px rgba(0,0,0,.05);
  --radius-sm: 8px;
  --radius:    14px;
  --radius-lg: 20px;

  /* Typography */
  --font-h: 'Playfair Display', Georgia, serif;
  --font-b: 'Lato', system-ui, -apple-system, sans-serif;
}

/* ---- RESET ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .18s; }
a:hover { color: var(--primary-d); }
ul { list-style: none; }

/* ===================================================
   HEADER
   =================================================== */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.logo-link { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-img { height: 46px; width: auto; }
.site-tagline {
  font-size: .82rem;
  color: var(--text-lt);
  font-style: italic;
  font-family: var(--font-h);
  max-width: 180px;
  line-height: 1.25;
  display: none; /* shown at wider breakpoints */
}
@media (min-width: 1100px) { .site-tagline { display: block; } }

/* Search */
.header-search {
  flex: 1;
  max-width: 360px;
  margin-left: auto;
  display: flex;
  align-items: center;
  background: var(--n100);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s;
}
.header-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(45,106,79,.12);
}
.header-search input {
  flex: 1;
  padding: 9px 16px;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--font-b);
  font-size: .9rem;
  color: var(--text);
}
.header-search input::placeholder { color: var(--n500); }
.header-search button {
  background: none;
  border: none;
  padding: 0 14px;
  cursor: pointer;
  color: var(--n500);
  display: flex;
  align-items: center;
  transition: color .18s;
}
.header-search button:hover { color: var(--primary); }
.header-search button svg { width: 17px; height: 17px; }

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}
.main-nav > ul {
  display: flex;
  align-items: center;
  gap: 2px;
}
.main-nav > ul > li { position: relative; }
.main-nav > ul > li > a {
  display: block;
  padding: 8px 14px;
  color: var(--n700);
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: .2px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.main-nav > ul > li > a:hover,
.main-nav > ul > li > a.active {
  background: var(--g100);
  color: var(--primary);
}

/* ── Dropdown ──────────────────────────────────────────────────────── */
/*  top:100% + padding-top = invisible bridge → hover non si perde mai */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  padding-top: 8px;   /* bridge invisibile che copre il gap */
  z-index: 200;
  min-width: 220px;
}
/* Pannello visibile dentro il bridge */
.dropdown > * { /* sia <ul> che wrapper futuri */
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  list-style: none;
}
/* JS controls open/close via style.display */
.dropdown li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  color: var(--n700);
  font-size: .875rem;
  border-radius: var(--radius-sm);
  transition: background .12s, color .12s;
  white-space: nowrap;
}
.dropdown li a:hover { background: var(--g100); color: var(--primary); }

/* ── Dropdown toggle button (freccia) ── */
.dropdown-toggle {
  display: none; /* visibile solo su mobile via media query */
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--n500);
  line-height: 1;
  transition: color .15s, transform .2s;
  vertical-align: middle;
}
.dropdown-toggle:hover { color: var(--primary); }
.has-dropdown.open .dropdown-toggle {
  color: var(--primary);
  transform: rotate(180deg);
}

/* ── Hamburger toggle ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  flex-direction: column;
  gap: 5px;
  margin-left: auto;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--n700);
  border-radius: 2px;
  transition: all .2s;
}

/* ===================================================
   HERO
   =================================================== */
.hero {
  background: linear-gradient(135deg, var(--g800) 0%, var(--g700) 55%, var(--g600) 100%);
  color: var(--white);
  padding: 80px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.hero-inner { position: relative; max-width: 640px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--g200);
  margin-bottom: 16px;
}
.hero h1 {
  font-family: var(--font-h);
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 18px;
}
.hero p {
  font-size: 1.1rem;
  opacity: .85;
  margin-bottom: 36px;
  line-height: 1.6;
}
.hero-stats {
  display: flex;
  gap: 0;
  justify-content: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,.06);
  max-width: 420px;
  margin: 0 auto;
}
.hero-stat {
  flex: 1;
  padding: 18px 12px;
  border-right: 1px solid rgba(255,255,255,.15);
}
.hero-stat:last-child { border-right: none; }
.hero-stat strong { display: block; font-size: 1.9rem; font-family: var(--font-h); line-height: 1; }
.hero-stat span { font-size: .78rem; opacity: .7; text-transform: uppercase; letter-spacing: .5px; }

/* ===================================================
   LAYOUT HELPERS
   =================================================== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 32px;
}

.section { padding: 64px 0; }
.section-alt { background: var(--bg-s); }

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 40px;
  gap: 16px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-h);
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.section-title small {
  display: block;
  font-family: var(--font-b);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}
.section-link {
  font-size: .85rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.section-link:hover { color: var(--primary-d); gap: 8px; }

/* ===================================================
   RECIPE GRID & CARDS
   =================================================== */
.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 24px;
}

.recipe-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform .22s ease, box-shadow .22s ease;
}
.recipe-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.recipe-card-img {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--g100);
}
.recipe-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.recipe-card:hover .recipe-card-img img { transform: scale(1.05); }
.recipe-card:hover .recipe-card-img img.recipe-placeholder-img { transform: none; }
.img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--g100), var(--g200));
}

.recipe-card-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.badge {
  font-size: .68rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 50px;
  letter-spacing: .4px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
}
.badge-veg   { background: rgba(45,106,79,.9);  color: var(--white); }
.badge-gf    { background: rgba(120,80,10,.85); color: var(--white); }
.badge-vegan { background: rgba(27,67,50,.9);   color: var(--white); }

.recipe-card-body {
  padding: 20px 22px 22px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.recipe-cat {
  font-size: .72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 7px;
}
.recipe-cat a { color: inherit; }
.recipe-cat a:hover { opacity: .75; }

.recipe-title {
  font-family: var(--font-h);
  font-size: 1.15rem;
  line-height: 1.3;
  margin-bottom: 10px;
  flex: 1;
}
.recipe-title a { color: var(--text); }
.recipe-title a:hover { color: var(--primary); }

.recipe-desc {
  font-size: .85rem;
  color: var(--text-lt);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.recipe-meta {
  display: flex;
  gap: 14px;
  font-size: .8rem;
  color: var(--text-lt);
  flex-wrap: wrap;
  align-items: center;
  margin-top: auto;
}
.recipe-meta span { display: flex; align-items: center; gap: 4px; }

/* ===================================================
   CATEGORIES GRID
   =================================================== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 14px;
}
.cat-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 12px;
  text-align: center;
  display: block;
  color: var(--text);
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
}
.cat-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  background: var(--g100);
  color: var(--primary);
}
.cat-icon { font-size: 1.9rem; margin-bottom: 10px; line-height: 1; }
.cat-name { font-size: .82rem; font-weight: 700; letter-spacing: .2px; }

/* ===================================================
   PAGE HEADER
   =================================================== */
.page-header {
  background: linear-gradient(135deg, var(--g800), var(--g700));
  color: var(--white);
  padding: 52px 32px 48px;
}
.page-header .breadcrumb { margin-bottom: 14px; opacity: .7; }
.page-header .breadcrumb a,
.page-header .breadcrumb span { color: rgba(255,255,255,.8); }
.page-header .breadcrumb a:hover { color: var(--white); opacity: 1; }
.page-header h1 {
  font-family: var(--font-h);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.2;
  margin-bottom: 8px;
}
.page-header p { opacity: .8; max-width: 560px; font-size: .95rem; }
.page-header .breadcrumb { color: rgba(255,255,255,.6); }

/* ===================================================
   BREADCRUMB
   =================================================== */
.breadcrumb {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  font-size: .82rem;
  color: var(--text-lt);
}
.breadcrumb a { color: var(--primary); }
.breadcrumb a:hover { color: var(--primary-d); }
.breadcrumb span { color: var(--n300); }

/* ===================================================
   SINGLE RECIPE
   =================================================== */
.recipe-single {
  max-width: 900px;
  margin: 0 auto;
  padding: 48px 32px 64px;
}
.recipe-hero-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 36px;
  box-shadow: var(--shadow-lg);
}
.recipe-single h1 {
  font-family: var(--font-h);
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  margin-bottom: 14px;
  color: var(--text);
}
.recipe-intro {
  font-size: 1.05rem;
  color: var(--text-lt);
  font-style: italic;
  font-family: var(--font-h);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Info bar */
.recipe-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 40px;
  overflow: hidden;
}
.info-item {
  flex: 1;
  min-width: 100px;
  padding: 16px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.info-item:last-child { border-right: none; }
.info-item strong {
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-lt);
  font-family: var(--font-b);
}
.info-item span { font-size: .95rem; font-weight: 700; color: var(--text); }
.info-item .stars { color: var(--primary); letter-spacing: 2px; }

/* Recipe content layout */
.recipe-content {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}
.ingredienti-box {
  background: var(--g100);
  border-radius: var(--radius);
  padding: 28px;
  border: 1.5px solid var(--g200);
  position: sticky;
  top: 88px;
}
.ingredienti-box h2 {
  font-family: var(--font-h);
  font-size: 1.25rem;
  color: var(--primary-d);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--g200);
}
.ingredienti-list { list-style: none; }
.ingredienti-list li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--g200);
  font-size: .9rem;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.4;
}
.ingredienti-list li::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  margin-top: 5px;
}
.ingredienti-list li strong { color: var(--primary-d); font-weight: 700; display: block; margin: 8px 0 4px; }
.ingredienti-list li:last-child { border-bottom: none; }

.procedimento-box h2 {
  font-family: var(--font-h);
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--text);
}
.procedimento-text p {
  margin-bottom: 18px;
  line-height: 1.75;
  font-size: .975rem;
  color: var(--n700);
}
.procedimento-text p:last-child { margin-bottom: 0; }
.procedimento-text strong { color: var(--primary-d); }

/* Steps numbered */
.procedimento-text p { counter-increment: step; }

/* Tags */
.recipe-tags {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.tag-label { font-size: .78rem; font-weight: 700; color: var(--text-lt); text-transform: uppercase; letter-spacing: .5px; }
.tag-pill {
  background: var(--n100);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  padding: 4px 14px;
  font-size: .8rem;
  color: var(--n700);
  transition: all .15s;
}
.tag-pill:hover { background: var(--g100); border-color: var(--primary); color: var(--primary); }

/* Stars */
.stars { color: var(--primary); letter-spacing: 1px; font-size: .9rem; }

/* ===================================================
   PAGINATION
   =================================================== */
.pagination {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 52px;
  flex-wrap: wrap;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: .85rem;
  border: 1.5px solid var(--border);
  transition: all .15s;
}
.pagination a { color: var(--n700); background: var(--white); }
.pagination a:hover { border-color: var(--primary); color: var(--primary); background: var(--g100); }
.pagination span { background: var(--primary); color: var(--white); border-color: var(--primary); }

/* ===================================================
   EMPTY STATE
   =================================================== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-lt);
}
.empty-state .empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-h);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 8px;
}
.empty-state p { font-size: .95rem; }

/* ===================================================
   ABOUT
   =================================================== */
.about-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 64px 32px;
}
.about-content h2 {
  font-family: var(--font-h);
  font-size: 1.7rem;
  color: var(--primary-d);
  margin: 40px 0 16px;
}
.about-content p { margin-bottom: 18px; color: var(--n700); line-height: 1.75; }
.about-logo { max-width: 180px; margin: 0 auto 40px; }

/* ===================================================
   SEARCH
   =================================================== */
.search-info { padding: 24px 0 8px; font-size: .95rem; color: var(--text-lt); }
.search-info strong { color: var(--primary); }
.search-form-large {
  max-width: 540px;
  margin: 0 auto 44px;
}
.search-form-large .header-search {
  max-width: 100%;
  border-radius: var(--radius-sm);
  background: var(--white);
  border-width: 2px;
}
.search-form-large input { padding: 14px 20px; font-size: 1rem; }
.search-form-large button { padding: 0 22px; }

/* ===================================================
   FOOTER
   =================================================== */
.site-footer {
  background: var(--g900);
  color: rgba(255,255,255,.65);
  margin-top: 80px;
}
.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 56px 32px 40px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
}
.footer-brand .footer-logo {
  height: 44px;
  filter: brightness(0) invert(1);
  opacity: .85;
  margin-bottom: 14px;
}
.footer-brand p { font-size: .875rem; line-height: 1.6; max-width: 280px; }
.footer-nav h4, .footer-links h4 {
  color: var(--white);
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.footer-nav li, .footer-links li { margin-bottom: 10px; }
.footer-nav a, .footer-links a {
  color: rgba(255,255,255,.55);
  font-size: .875rem;
  transition: color .15s;
}
.footer-nav a:hover, .footer-links a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  text-align: center;
  padding: 20px 32px;
  font-size: .8rem;
  color: rgba(255,255,255,.3);
}

/* ===================================================
   BUTTONS
   =================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  background: var(--primary);
  color: var(--white);
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  font-family: var(--font-b);
  font-size: .875rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  white-space: nowrap;
  text-decoration: none;
}
.btn:hover { background: var(--primary-d); border-color: var(--primary-d); color: var(--white); }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: var(--white); }
.btn-lg { padding: 13px 28px; font-size: .95rem; }
.btn-sm { padding: 5px 13px; font-size: .78rem; border-radius: 6px; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--primary);
  padding-left: 4px;
  padding-right: 4px;
}
.btn-ghost:hover { background: var(--g100); border-color: var(--g100); }

/* ===================================================
   RECIPE NAV FOOTER
   =================================================== */
.recipe-footer-nav {
  margin-top: 52px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===================================================
   RESPONSIVE
   =================================================== */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .recipe-content { grid-template-columns: 240px 1fr; gap: 32px; }
  .ingredienti-box { position: static; }
}

@media (max-width: 768px) {
  .container, .page-header, .about-content, .recipe-single { padding-left: 20px; padding-right: 20px; }
  .header-inner { padding: 0 20px; }
  .hero { padding: 56px 20px; }
  .section { padding: 48px 0; }

  .recipe-content { grid-template-columns: 1fr; gap: 28px; }
  .footer-inner { grid-template-columns: 1fr; gap: 28px; padding: 40px 20px 28px; }
  .footer-bottom { padding: 16px 20px; }
  .recipes-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }

  .info-item { min-width: 80px; padding: 12px 12px; }
}

@media (max-width: 640px) {
  .header-inner { flex-wrap: wrap; height: auto; padding: 14px 20px; gap: 12px; }
  .header-search { order: 3; max-width: 100%; flex: 1 1 100%; }
  .nav-toggle { display: flex; }

  /* Mobile nav */
  .main-nav {
    display: none;
    order: 4;
    flex: 1 1 100%;
    flex-direction: column;
    border-top: 1px solid var(--border);
    padding-top: 8px;
    margin-top: 4px;
  }
  .main-nav.open { display: flex; }
  .main-nav > ul { flex-direction: column; gap: 0; width: 100%; }
  /* li con dropdown: link + freccia sulla stessa riga */
  .main-nav > ul > li.has-dropdown {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
  }
  .main-nav > ul > li.has-dropdown > a {
    flex: 1;
    padding: 11px 8px;
    border-radius: 6px;
  }
  .main-nav > ul > li > a { padding: 11px 8px; border-radius: 6px; }
  /* Mostra il bottone freccia su mobile */
  .dropdown-toggle { display: inline-flex; align-items: center; padding: 8px 10px; }
  /* Mobile: dropdown controllato dalla classe .open sul li */
  .has-dropdown .dropdown { display: none !important; }
  .has-dropdown.open .dropdown {
    display: block !important;
    position: static;
    padding-top: 0;
    flex: 1 1 100%;
  }
  .has-dropdown.open .dropdown > * {
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0 0 4px 16px;
  }
  .has-dropdown.open .dropdown li a {
    padding: 8px 10px;
    color: var(--text-lt);
    font-size: .875rem;
  }
  .hero-stats { flex-direction: row; }
  .recipes-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .recipe-info-bar { flex-wrap: wrap; }
  .info-item { flex: 1 1 45%; border-bottom: 1px solid var(--border); }
}

/* ===================================================
   UTILITIES
   =================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }
