/* ==========================================================================
   1. STILI GLOBALI, VARIABILI E RESET
   ========================================================================== */
:root {
  --bg-cream: #f6f4eb;
  --bg-light: #fcfbf9;
  --green-dark: #1b3b22;
  --green-card: #23472b;
  --green-primary: #2d5a37;
  --accent-gold: #d4a338;
  --accent-gold-hover: #b88a2a;
  
  /* Colori Categoria Prodotti */
  --color-sottolio: #70653b;
  --color-agrodolce: #9e3a30;
  
  --text-dark: #1c231e;
  --text-muted: #5e6b61;
  --card-bg: #ffffff;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-pill: 50px;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-cream);
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  overflow-x: hidden;
}

/* Utilità Layout */
.max-w-500 { max-width: 500px; }
.max-w-600 { max-width: 600px; }
.max-w-650 { max-width: 650px; }

/* Tipografia Personalizzata */
.font-cursive {
  font-family: 'Caveat', cursive;
  color: var(--accent-gold);
  font-size: 1.8rem;
  line-height: 1.1;
  display: block;
}

.font-heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  color: var(--green-dark);
}

.section-padding {
  padding: 90px 0;
}

/* ==========================================================================
   2. NAVBAR
   ========================================================================== */
.custom-navbar {
  background-color: var(--bg-cream);
  padding: 16px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.brand-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
}

.brand-logo-badge {
  border: 2px solid var(--green-dark);
  padding: 4px 12px;
  border-radius: var(--radius-md);
  background-color: var(--card-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-logo-img {
  height: 40px;
  width: auto;
  display: block;
}

.nav-link-custom {
  color: var(--green-dark);
  font-weight: 600;
  margin: 0 10px;
  transition: color 0.2s ease;
}

.nav-link-custom:hover {
  color: var(--accent-gold);
}

/* Pulsanti */
.btn-green-dark {
  background-color: var(--green-dark);
  color: #ffffff;
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-weight: 700;
  border: none;
  transition: all 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-green-dark:hover {
  background-color: var(--green-primary);
  color: #ffffff;
  transform: translateY(-2px);
}

.btn-outline-custom {
  border: 1.5px solid rgba(27, 59, 34, 0.2);
  color: var(--green-dark);
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-weight: 700;
  background-color: transparent;
  transition: all 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-outline-custom:hover {
  background-color: #ffffff;
  border-color: var(--green-dark);
  color: var(--green-dark);
}

.btn-gold {
  background-color: var(--accent-gold);
  color: var(--green-dark);
  border-radius: var(--radius-pill);
  padding: 12px 28px;
  font-weight: 800;
  border: none;
  transition: all 0.2s ease;
  display: inline-block;
  text-decoration: none;
}

.btn-gold:hover {
  background-color: var(--accent-gold-hover);
  color: var(--green-dark);
  transform: translateY(-2px);
}

/* ==========================================================================
   3. HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 60px 0 90px 0;
}

.hero-title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 24px;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 500px;
  margin-bottom: 32px;
}

.bullet-features {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-dark);
  margin-top: 30px;
}

/* Griglia Immagini Hero Generica */
.hero-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  padding: 10px;
}

.hero-card-img {
  background: transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(27, 59, 34, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  aspect-ratio: 1 / 1; /* Garantisce che sia un quadrato perfetto indipendentemente dall'immagine */
  width: 100%;
}

.hero-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Taglia l'immagine proporzionalmente mantenendola piena */
  transform: scale(1.08);
  display: block;
  transition: transform 0.3s ease;
}

.hero-card-img:nth-child(4n+1) { transform: rotate(-2deg); }
.hero-card-img:nth-child(4n+2) { transform: rotate(2deg); }
.hero-card-img:nth-child(4n+3) { transform: rotate(1deg); }
.hero-card-img:nth-child(4n+0) { transform: rotate(-1.5deg); }

.hero-card-img:hover {
  transform: translateY(-6px) rotate(0deg) !important;
  box-shadow: 0 20px 40px rgba(27, 59, 34, 0.12);
}

/* ==========================================================================
   4. TICKER / SCROLLING BANNER
   ========================================================================== */
.ticker-bar {
  background-color: var(--green-dark);
  color: #ffffff;
  padding: 16px 0;
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1px;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-content {
  display: inline-block;
  animation: ticker 25s linear infinite;
}

.ticker-item {
  display: inline-block;
  margin: 0 25px;
}

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ==========================================================================
   5. SEZIONE PRODOTTI GENERICA
   ========================================================================== */
.product-card {
  --card-accent: var(--green-primary); /* Colore accent predefinito di fallback */
  
  background-color: var(--card-bg);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(27, 59, 34, 0.1);
}

.card-top-bar {
  height: 6px;
  width: 100%;
  background-color: var(--card-accent);
}

.card-body-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-subtitle {
  font-size: 0.75rem;
  color: var(--text-dark);
  margin-top: 8px;
  margin-bottom: 0;
}

/* Wrapper Immagine Prodotto Flessibile */
.product-img-wrapper {
  background-color: #eae5d9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #eee;
  padding: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  aspect-ratio: 4 / 3; /* Ratio costante per tutti i vasetti */
  width: 100%;
  margin-bottom: 12px;
}

.product-img-wrapper img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Garantisce che il vasetto/prodotto sia visibile interamente */
  display: block;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6c757d;
}

.product-weight {
  font-weight: 800;
  color: #212529;
}

.badge-category {
  display: inline-block;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #ffffff;
  letter-spacing: 0.5px;
  background-color: var(--card-accent);
}

.product-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 15px;
  flex-grow: 1; /* Spinge il footer della card in fondo per un perfetto allineamento */
}

.card-footer-tag {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 15px;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.25px;
  text-transform: uppercase;
}

.card-footer-tag span {
  color: var(--card-accent);
}

.tag-gold-accent {
  color: var(--accent-gold) !important;
  margin-bottom: 0;
}

/* Classi opzionali per retro-compatibilità */
.card-sottolio  { --card-accent: var(--color-sottolio); }
.card-agrodolce { --card-accent: var(--color-agrodolce); }
.card-crema     { --card-accent: var(--green-primary); }
.card-vellutata { --card-accent: var(--accent-gold); }

/* ==========================================================================
   6. SEZIONE RICETTE & ABBINAMENTI
   ========================================================================== */
.bg-light-section {
  background-color: var(--bg-light);
}

.section-tagline {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--color-sottolio);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  display: block;
}

.section-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-top: 6px;
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.recipe-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.recipe-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(27, 59, 34, 0.08);
}

.recipe-badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background-color: var(--green-dark);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.recipe-img-box {
  width: 100%;
  aspect-ratio: 16 / 9; /* Formato panoramico standard per le foto delle ricette */
  overflow: hidden;
  position: relative;
  background-color: #eae5d9;
}

.recipe-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.recipe-card:hover .recipe-img-box img {
  transform: scale(1.08);
}

.recipe-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.recipe-time {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-transform: uppercase;
}

.recipe-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green-dark);
  margin-bottom: 10px;
  line-height: 1.35;
}

.recipe-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin-bottom: 20px;
  flex-grow: 1; /* Mantiene coerente l'altezza anche se il testo cambia lunghezza */
}

.recipe-footer {
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  padding-top: 14px;
}

.recipe-product-link {
  font-size: 0.78rem;
  color: var(--green-primary);
  font-weight: 600;
}

.recipe-product-link strong {
  color: var(--green-dark);
}

/* Scroll Mobile per Ricette */
@media (max-width: 767.98px) {
  .recipe-slider-mobile {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    margin-left: -15px !important;
    margin-right: -15px !important;
    padding-left: 15px;
    padding-right: 15px;
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .recipe-slider-mobile::-webkit-scrollbar {
    display: none;
  }

  .recipe-slide-item {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    scroll-snap-align: center;
  }
}

/* ==========================================================================
   7. TRE PROMESSE, STORIA E FOOTER
   ========================================================================== */
.bg-green-dark {
  background-color: var(--green-dark);
  color: #ffffff;
}

.promise-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 32px 24px;
  height: 100%;
  transition: transform 0.3s ease;
}

.promise-card:hover {
  transform: translateY(-5px);
  background: rgba(255, 255, 255, 0.08);
}

.promise-icon-bg {
  width: 50px;
  height: 50px;
  background-color: var(--accent-gold);
  color: var(--green-dark);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 20px;
}

.stat-number {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: clamp(2.5rem, 5.5vw, 4.5rem);
  color: var(--accent-gold);
  line-height: 1;
  white-space: nowrap;
}

.stat-label {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

@media (max-width: 576px) {
  .stat-label {
    font-size: 0.7rem;
  }
}

.footer-section {
  background-color: var(--green-dark);
  color: #ffffff;
  padding: 90px 0 40px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-contact-link {
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 600;
  margin-bottom: 16px;
  transition: color 0.2s ease;
}

.footer-contact-link:hover {
  color: var(--accent-gold);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 30px;
  margin-top: 60px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}