/* =========================================================
   BASE / RESET
========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root{
  --bg: #faf8f2;
  --text: #333;
  --muted: #6d5c4b;
  --brown: #5a4a3d;
  --paper: #fff;
  --sand: #e3d8c0;
  --border: #ddd;
  --shadow: 0 2px 5px rgba(0,0,0,0.10);
  --shadow-strong: 0 15px 40px rgba(0,0,0,0.15);
  --radius: 12px;
  --maxw: 1000px;
}

body {
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

img{
  max-width: 100%;
  height: auto;
  display: block;
}

/* =========================================================
   LAYOUT HELPERS
========================================================= */
.container{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1rem;
}

section{
  padding: 3rem 0;
}

h2{
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--brown);
}

/* link base (se ti serve) */
a{ color: inherit; }

/* =========================================================
   HERO
========================================================= */
.hero {
  position: relative;
  height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  background: url("img/hero.jpg") center/cover no-repeat;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.40);
}

.hero-text {
  position: relative;
  z-index: 1;
  padding: 0 1rem;
}

.hero p {
  font-size: 1.2rem;
  margin-top: 0.5rem;
}

.hero-logo {
  max-width: min(520px, 80vw);
  height: auto;
  margin: 0 auto 1rem;
}

/* =========================================================
   ABOUT (CHI SIAMO) - affiancato
========================================================= */
.about p{
  font-size: 1.05rem;
  color: var(--muted);
}

.about-flex{
  display: flex;
  align-items: center;
  gap: 50px;
}

.about-text{
  flex: 1.2;
}

.about-image{
  flex: 1;
  display: flex;
  justify-content: center;
}

.about-image img{
  width: 100%;
  max-width: 450px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-strong);
}

/* Responsive about */
@media (max-width: 900px){
  .about-flex{
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
  .about-image img{
    max-width: 360px;
  }
}

/* =========================================================
   L'ORZO - FULL WIDTH (robusto, senza calc/100vw)
========================================================= */
.barley{
  position: relative;
  min-height: 420px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0;            /* gestiamo padding nel contenuto */
}

/* sfondo */
.barley-bg{
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
  transform: scale(1.02);
}

/* overlay */
.barley::before{
  content:"";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0,0,0,0.45);
}

/* contenuto centrato */
.barley-content{
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 1rem;
}

/* tipografia dentro Orzo */
.barley-content h2{
  color: #fff;
  text-align: left;
  margin: 0 0 14px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.65);
}

.barley-content p{
  color: #fff;
  max-width: 820px;
  line-height: 1.7;
  font-size: 1.1rem;
  text-shadow: 0 2px 12px rgba(0,0,0,0.65);

  /* box leggibilità */
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 16px 18px;
  backdrop-filter: blur(2px);
}

/* Responsive Orzo */
@media (max-width: 900px){
  .barley{ min-height: 360px; }
  .barley-content{ padding: 46px 1rem; }
  .barley-content p{ font-size: 1rem; }
}

/* =========================================================
   PRODOTTI
========================================================= */
.products .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform 0.2s;
}

.card:hover { transform: translateY(-5px); }

.card img{
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.card h3 {
  margin: 0.8rem 0 0.3rem;
  color: var(--brown);
}

.card p {
  padding: 0 1rem 1rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* =========================================================
   CONTATTI
========================================================= */
.contact{
  background: var(--sand);
  border-radius: 6px;
  text-align: center;
}

.contact p{
  margin: 0.5rem 0;
  font-size: 1.05rem;
  color: var(--brown);
}

.contact a{
  color: var(--brown);
}

/* =========================================================
   FOOTER
========================================================= */
footer{
  background: var(--brown);
  color: #fff;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

.social-links{
  margin-top: 0.5rem;
}

.social-links a{
  display: inline-block;
  margin: 0 0.5rem;
  transition: transform 0.2s;
}

.social-links a:hover{ transform: scale(1.2); }

.social-links a img{
  width: 32px;
  height: 32px;
}

/* =========================================================
   MODAL GALLERY
========================================================= */
.modal-gallery{
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 99999;
}

.modal-gallery.show{ display: flex; }

.modal-wrapper{
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 90%;
  max-height: 90%;
}

.modal-wrapper img{
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

.modal-close{
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
  z-index: 100000;
}

.modal-prev, .modal-next{
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.2s;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.modal-prev:hover, .modal-next:hover{
  background: rgba(255,255,255,0.4);
}

.modal-prev{ left: -50px; }
.modal-next{ right: -50px; }

@media (max-width: 768px){
  .modal-prev{ left: 10px; }
  .modal-next{ right: 10px; }
}

body.modal-open{ overflow: hidden; }
