/* =========================
   Global Variables & Base Styles
========================= */
:root {
  --bg-color: #fff5ee;
  --brand: #388E3C;               /* Brand primary color (green) */
  --nav_dim_start: 100px;         /* Initial navbar height */
  --nav_dim_scroll: 70px;         /* Navbar height after shrink on scroll */
  --hero_img_dim: 60vh; 
  --link_dim_bar: 50px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Open Sans', sans-serif;
  color: #333;
  line-height: 1.6;
  margin: 0;
  /* Offset to push page content below the fixed header */
  padding-top: var(--nav_dim_start);
}

h1, h2, h3 {
  font-family: 'Montserrat', sans-serif;
  margin-top: 0;
}
h1 { font-size: 2.2em; }
h2 { font-size: 1.5em; }
h3 { font-size: 1.25em; }
p { margin-bottom: 1rem; }

a {
  color: var(--brand);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Layout Containers */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* =========================
   Header & Navigation (Updated for mobile toggle outside navbar)
========================= */
header {
  background: #fff;
  border-bottom: 1px solid #ccc;
  padding: 0 0.5rem; /* leggero spazio ai bordi */
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between; /* logo/navbar a sinistra - bottone a destra */
  height: var(--nav_dim_start);
  transition: all 0.3s ease;
}

/* Navbar (logo e link centrati su desktop) */
.navbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3rem;
  flex: 1;
}


.nav-left, .nav-right {
  display: flex;
  list-style: none;
  margin: 0; padding: 0;
  gap: 1.5rem;
}




.nav-left a, .nav-right a {
  color: #333;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
}
.nav-left a:hover, .nav-right a:hover { color: var(--brand); }

/* Logo */

.logo { position: static; transform: none; }

.logo img {
  height: 70px;
  transition: height 0.3s ease;
}

/* Bottone menu (hamburger) */
.menu-toggle {
  display: none;
  position: absolute;
  right: 0.8rem; /* distanza dal bordo destro */
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-color);
  border: none;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
  z-index: 1200; /* sopra tutto */
}

/* Mobile menu */
.mobile-menu {
  display: flex;
  position: fixed;
  top: 0;
  right: 0;
  width: 75%;
  height: 100%;
  background: var(--bg-color);
  z-index: 1100;
  padding: 2rem 1.5rem;
  box-shadow: -2px 0 14px rgba(0, 0, 0, 0.3);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  flex-direction: column;
  gap: 1rem;
}

.mobile-menu.active {
  transform: translateX(0);
}

/* Overlay */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
}
.mobile-menu-overlay.active {
  display: block;
}

/* Shrink effect */
header.shrink {
  padding: 0.3rem 0;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  height: var(--nav_dim_scroll);
}

header.shrink .logo img {
  height: calc(var(--nav_dim_scroll) - 10px);
  transition: height 0.3s ease;
}

/* Mostra hamburger solo su mobile */
@media (max-width: 768px) {
  .nav-left,
  .nav-right {
    display: none;
  }

  .menu-toggle {
    display: block;
    right: 0.8rem; /* distanza dal bordo */
  }

  header {
    padding: 0 0.3rem; /* riduci padding, così è più vicino al bordo */
  }
  
  .mobile-menu ul {
  list-style: none;
  margin: 50px 0 0 0; /* ⬅️ 50px di spazio sopra */
  padding: 0;
}

}

/* Pulsante circolare "X" per chiudere il menu */
.menu-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 30px;
  height: 30px;
  background: rgba(56, 142, 60, 0.7); /* verde semitrasparente */
  color: white;
  font-size: 1.8rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1200;
  transition: background 0.2s ease, transform 0.2s ease;
}

.menu-close-btn:hover {
  background: rgba(56, 142, 60, 0.9);
  transform: scale(1.1);
}

.menu-close-btn:active {
  transform: scale(0.95);
}


/* =========================
   Hero Section
========================= */
.hero {
  position: relative;
  padding: 0;
}
.hero img {
  width: 100%;
  height: auto;
  display: block;
  max-height: var(--hero_img_dim, 60vh);  /* Use CSS variable with fallback for hero image max height */
  object-fit: contain;  /* Contain the image without cropping */
}
.hero-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  text-align: center;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.4);
  padding: 1rem 2rem;
  border-radius: 0.5rem;
  /* Ensure hero text is readable on various backgrounds */
}

/* =========================
   "Buy Online" Link Section
========================= */
.link-section {
  background-color: var(--brand);
  height: var(--link_dim_bar, 50px);
  width: 100%;
  display: flex;
  align-items: center;
}
  
.link-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.buy-link {
  color: #fff;
  font-size: 1.5rem;       /* Main call-to-action text size */
  font-weight: 700;
  text-transform: uppercase;
  margin-left: auto;
  margin-right: auto;
}
.buy-link:hover {
  text-decoration: underline;
}

.link-section h2 {
  color: #fff;
  font-size: 2rem;       /* Main call-to-action text size */
  font-weight: 700;
  text-transform: uppercase;
  margin-top: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  }
  
.social-icons {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 1rem;
}
.social-icons img {
  width: 30px;
  height: 30px;
  filter: brightness(0) invert(1);  /* Make icon images white */
  transition: opacity 0.2s ease;
}
.social-icons img:hover {
  opacity: 0.8;
}

/* =========================
   Values Section (Title + Image)
========================= */
.values {
  text-align: center;
  padding: 4rem 0;
}
.values h2 {
  font-size: 2rem;
  font-weight: 700;
  color: #333;
  margin-bottom: 1.5rem;
}
.values-image {
  max-width: 600px;
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* =========================
   Products Grid / Teaser
========================= */
.product-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2rem;
  margin: 0 auto;
  max-width: 1100px;
}
.product-item {
  flex: 1 1 250px;
  max-width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
  padding: 1.5rem;
  text-align: center;
  transition: box-shadow 0.3s ease;
  overflow: hidden; /* Ensure scaled image doesn’t overflow the card */
}
.product-item h2, .product-item h3 {
  margin-top: 0.5rem;
}
.product-item p {
  font-size: 0.95em;
}

/* Hover effect for product card */
.product-item:hover {
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.15);  /* Elevate card on hover */
}
.product-link {
  display: block;
  perspective: 400px;  /* Container perspective for 3D effect */
}
.product-item img {
  display: block;
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1rem;
  transform-origin: center;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  will-change: transform;
  transition: transform 0.5s ease;
}

/* 3D tilt-wobble animation on hover */
.product-item:hover img {
  animation: tilt-wobble 600ms ease-out forwards;
}

@keyframes tilt-wobble {
  0%   { transform: scale(1)    rotateY(0deg); }
  30%  { transform: scale(1.03) rotateY(-6deg); }
  60%  { transform: scale(1.05) rotateY(6deg); }
  100% { transform: scale(1.06) rotateY(0deg); }
}

/* Reduce motion preference: disable animation for accessibility */
@media (prefers-reduced-motion: reduce) {
  .product-item:hover img {
    animation: none;
    transform: scale(1.03); /* still provide a subtle scale effect */
  }
}

/* =========================
   Product Detail Page Styles
========================= */
.product-overview .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
}
.product-overview img {
  flex: 0 0 300px;
  max-width: 100%;
  height: auto;
}
.product-overview .details {
  flex: 1 1 0;
}
.product-overview h1 {
  margin-top: 0;
}
.product-overview p {
  margin-bottom: 1rem;
}

/* Ingredients & Nutrition sections */
.ingredients, .nutrition {
  padding: 2rem 0;
}
.nutrition-table {
  border-collapse: collapse;
  width: 100%;
  max-width: 400px;
}
.nutrition-table th,
.nutrition-table td {
  border: 1px solid #ccc;
  padding: 0.5rem 0.75rem;
}
.nutrition-table th {
  text-align: left;
}
.nutrition-table td {
  text-align: right;
}

/* =========================
   "Where to Buy" Logos
========================= */
.retailers {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin: 2rem 0;
}
.retailers img {
  max-width: 150px;
  width: 100%;
  height: auto;
}

/* =========================
   Contact Form
========================= */
.contact-form {
  max-width: 600px;
  margin: 1rem auto;
}
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* =========================
   Buttons
========================= */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover {
  background: #45a049;
}

/* =========================
   Footer
========================= */
footer {
  background-color: var(--brand);
  color: #fff;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  padding: 2rem;
}
.footer-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  height: auto;
  width: 100%;
  max-width: 1100px;
}

/* Footer left/center/right sections */
.footer-left {
  flex: 1 1 250px;
}
.footer-left a {
  color: #fff;
  text-decoration: none;
}
.footer-left a:hover {
  text-decoration: underline;
}
.footer-center {
  flex: 1 1 250px;
  text-align: center;
}
.footer-right {
  flex: 1 1 250px;
  text-align: right;
}

/* Footer social icons */
footer .social-icons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 1rem;
}
footer .social-icons img {
  width: 40px;
  height: 40px;
  filter: brightness(0) invert(1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
footer .social-icons img:hover {
  opacity: 0.8;
  transform: scale(1.1);
}

/* Responsive footer (mobile) */
@media (max-width: 768px) {
  .footer-container {
    flex-direction: column;
    height: auto;
      width: 100%;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }
  .footer-left, .footer-center, .footer-right {
    text-align: center;
  }
  footer .social-icons {
    justify-content: center;
  }
}
