/* CSS RESET & NORMALIZE */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
main, menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure, 
footer, header, hgroup, main, menu, nav, section {
  display: block;
}
body {
  line-height: 1.5;
  background: #FFFFFF;
  color: #232918;
  font-family: 'Roboto', Arial, sans-serif;
  font-size: 16px;
}
img {
  max-width: 100%;
  height: auto;
  border: 0;
}
ul, ol {
  list-style: none;
}
a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}
button {
  font-family: "Roboto", Arial, sans-serif;
  font-size: 16px;
  background: none;
  border: none;
  outline: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

/* BRAND VARIABLES / FALLBACKS */
:root {
  --color-primary: #355C2D;
  --color-primary-dark: #27431f;
  --color-secondary: #FFFFFF;
  --color-bg-card: #F6EBE0;
  --color-accent: #A06600;
  --color-accent-light: #B98428;
  --color-text: #232918;
  --color-heading: #355C2D;
  --color-border: #E3D9C3;
  --color-shadow: rgba(53,92,45,0.08);
}

/* TYPOGRAPHY */
body {
  font-family: 'Roboto', Arial, sans-serif;
  color: var(--color-text);
}
h1, h2, h3, h4, h5, h6 {
  font-family: 'Montserrat', Arial, sans-serif;
  color: var(--color-heading);
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 20px;
  line-height: 1.2;
}
h1 {
  font-size: 2.5rem;
  margin-bottom: 24px;
}
h2 {
  font-size: 2rem;
  margin-bottom: 18px;
}
h3 {
  font-size: 1.375rem;
  margin-bottom: 16px;
}
p, li, address {
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 10px;
}
strong {
  font-weight: 700;
}

/* LAYOUT CONTAINERS */
.container {
  width: 100%;
  max-width: 1200px;
  padding-left: 20px;
  padding-right: 20px;
  margin-left: auto;
  margin-right: auto;
}
main {
  margin-top: 0;
  margin-bottom: 0;
}

/* SPACING & ALIGNMENT PATTERNS */
.section {
  margin-bottom: 60px;
  padding: 40px 20px;
}
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.card {
  background: var(--color-bg-card);
  box-shadow: 0 2px 12px var(--color-shadow);
  border-radius: 14px;
  padding: 32px 24px;
  margin-bottom: 20px;
  position: relative;
  min-width: 220px;
  flex: 1 1 300px;
  border: 1px solid var(--color-border);
  transition: transform 0.18s, box-shadow 0.18s;
}
.card:hover {
  box-shadow: 0 4px 24px rgba(53,92,45,0.18);
  transform: translateY(-4px);
}
.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  background: var(--color-bg-card);
  box-shadow: 0 2px 12px var(--color-shadow);
  border-radius: 16px;
  gap: 20px;
  padding: 20px 28px;
  margin-bottom: 24px;
  border-left: 4px solid var(--color-primary);
  min-width: 220px;
  transition: box-shadow 0.15s;
}
.testimonial-card strong {
  color: var(--color-primary);
}
.testimonial-card span {
  font-size: 0.93em;
  color: #6E725D;
}
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

/* PAGE-SPECIFIC GRIDS/LISTS */
.features-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}
.features-grid li {
  background: var(--color-bg-card);
  border-radius: 12px;
  box-shadow: 0 1px 8px var(--color-shadow);
  border: 1px solid var(--color-border);
  padding: 24px 18px;
  flex: 1 1 220px;
  max-width: 320px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: box-shadow 0.17s, border-color 0.17s;
}
.features-grid li:hover {
  box-shadow: 0 4px 18px rgba(53,92,45,0.15);
  border-color: var(--color-primary);
}
.features-grid img {
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
}

.services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.services-list > div {
  background: var(--color-bg-card);
  border-radius: 12px;
  box-shadow: 0 1px 8px var(--color-shadow);
  border: 1px solid var(--color-border);
  flex: 1 1 320px;
  padding: 28px 20px;
  min-width: 220px;
  margin-bottom: 20px;
  transition: box-shadow 0.17s;
}
.services-list > div:hover {
  box-shadow: 0 4px 16px rgba(53,92,45,0.12);
}

.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  margin-bottom: 28px;
}
.category-grid > div {
  background: #FFF;
  border-radius: 12px;
  box-shadow: 0 1px 10px var(--color-shadow);
  border: 1px solid var(--color-border);
  flex: 1 1 250px;
  min-width: 180px;
  padding: 22px 16px;
  transition: box-shadow 0.16s;
}
.category-grid > div:hover {
  box-shadow: 0 3px 12px rgba(53,92,45,0.15);
}

.news-list {
  display: flex;
  flex-direction: column;
  gap: 32px;
}
.news-list article {
  background: var(--color-bg-card);
  border-radius: 10px;
  box-shadow: 0 1px 8px var(--color-shadow);
  padding: 20px 18px;
  border-left: 3px solid var(--color-accent);
  margin-bottom: 12px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 30px;
}
.contact-details img {
  margin-right: 8px;
  vertical-align: middle;
  height: 20px;
  width: 20px;
}
.cta-section {
  margin-top: 20px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.text-section {
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* HERO */
.hero {
  background: linear-gradient(120deg, #F6EBE0 90%, #FFFFFF 100%);
  padding: 40px 0 60px 0;
  margin-bottom: 0;
}
.hero .content-wrapper {
  align-items: flex-start;
}
.hero h1 {
  color: var(--color-primary);
}
.hero p {
  font-size: 1.17rem;
  margin-bottom: 32px;
  color: #516047;
}

/* CTA BUTTONS */
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.9em 2em;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: 32px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-weight: 700;
  font-size: 1.09rem;
  letter-spacing: 0.04em;
  box-shadow: 0 2px 8px var(--color-shadow);
  transition: background 0.2s, transform 0.13s, box-shadow 0.13s;
  cursor: pointer;
  margin-right: 10px;
  text-align: center;
  margin-bottom: 16px;
}
.cta:hover, .cta:focus {
  background: var(--color-accent);
  color: #FFF;
  box-shadow: 0 4px 16px rgba(160,102,0,0.13);
  transform: translateY(-2px) scale(1.03);
}

/* NAVIGATION (DESKTOP) */
header {
  background: #FFF;
  border-bottom: 1.5px solid var(--color-border);
  box-shadow: 0 1px 8px var(--color-shadow);
  z-index: 100;
  position: relative;
}
header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  padding-bottom: 18px;
  gap: 14px;
}
header nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
header nav a {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--color-primary);
  border-radius: 8px;
  padding: 6px 13px;
  transition: background 0.15s, color 0.15s;
}
header nav a:hover, header nav a:focus {
  background: var(--color-bg-card);
  color: var(--color-accent);
}
header img[alt="AgriNova Soluzioni"] {
  height: 48px;
  margin-right: 18px;
}

/* MOBILE NAVIGATION */
.mobile-menu-toggle {
  display: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 2rem;
  border-radius: 6px;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  z-index: 102;
  transition: background 0.15s;
  margin-left: 8px;
}
.mobile-menu-toggle:focus,
.mobile-menu-toggle:hover {
  background: var(--color-accent);
}
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(246,235,224,0.97);
  z-index: 200;
  display: flex;
  flex-direction: column;
  transform: translateX(-100vw);
  transition: transform 0.35s cubic-bezier(.76,0,.24,1);
  will-change: transform;
  pointer-events: none;
}
.mobile-menu.active {
  transform: translateX(0);
  pointer-events: auto;
}
.mobile-menu-close {
  align-self: flex-end;
  margin: 22px 24px 8px 0;
  font-size: 2.2rem;
  color: var(--color-primary);
  background: none;
  border-radius: 8px;
  width: 48px;
  height: 48px;
  transition: background 0.1s;
}
.mobile-menu-close:focus,
.mobile-menu-close:hover {
  background: var(--color-bg-card);
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: 40px 34px;
}
.mobile-nav a {
  font-size: 1.22rem;
  color: var(--color-primary);
  font-family: 'Montserrat', Arial, sans-serif;
  padding: 12px 6px;
  border-radius: 8px;
  font-weight: 600;
  width: 100%;
  box-sizing: border-box;
  transition: background 0.14s;
}
.mobile-nav a:focus, .mobile-nav a:hover {
  background: var(--color-accent-light);
  color: #fff;
}

/* FOOTER */
footer {
  background: #F6EBE0;
  border-top: 1.5px solid var(--color-border);
  padding: 30px 0;
}
footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 36px;
  align-items: flex-start;
  justify-content: space-between;
}
footer nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}
footer nav a {
  color: var(--color-primary);
  font-weight: 500;
  transition: color 0.13s;
  padding: 4px 0;
  border-radius: 6px;
}
footer nav a:hover {
  color: var(--color-accent);
  background: #fff;
}
footer address {
  color: #746728;
  font-style: normal;
  margin-bottom: 10px;
  font-size: 0.98rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
footer address img {
  vertical-align: middle;
  height: 18px;
  width: 18px;
  margin-right: 7px;
}
footer p {
  flex-basis: 100%;
  margin-top: 22px;
  color: #857747;
  font-size: 0.96rem;
}

/* TESTIMONIALS */
.testimonials {
  padding: 60px 0 60px 0;
  background: #FFF;
}
.testimonial-slider {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 10px;
}

.testimonial-card p {
  color: #3D392B;
  font-size: 1.12rem;
  margin-bottom: 9px;
  font-style: italic;
}

/* UTILITIES */
.gap-20 { gap:20px; }
.gap-30 { gap:30px; }
.text-center { text-align: center; }
.mb-20 { margin-bottom: 20px!important; }

/* COOKIE CONSENT BANNER */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  box-shadow: 0 -2px 16px rgba(53,92,45,0.07);
  border-top: 2px solid var(--color-border);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 18px;
  gap: 22px;
  font-size: 1rem;
  animation: fadeInUp 0.53s ease;
}
.cookie-banner__msg {
  color: #474C3B;
  max-width: 600px;
  flex: 1 1 auto;
}
.cookie-banner__actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.cookie-btn {
  background: var(--color-primary);
  color: #fff;
  border-radius: 28px;
  border: none;
  padding: 8px 28px;
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1rem;
  margin-right: 4px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px var(--color-shadow);
}
.cookie-btn--settings {
  background: var(--color-bg-card);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.cookie-btn:focus, .cookie-btn:hover {
  background: var(--color-accent);
  color: #fff;
}
.cookie-btn--settings:hover, .cookie-btn--settings:focus {
  background: var(--color-primary);
  color: #fff;
}

/* COOKIE SETTINGS MODAL */
.cookie-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  background: #fff;
  box-shadow: 0 4px 32px rgba(53,92,45,.25);
  border-radius: 20px;
  padding: 36px 30px;
  min-width: 320px;
  max-width: 95vw;
  width: 410px;
  transform: translate(-50%, -54%) scale(0.93);
  opacity: 0;
  z-index: 350;
  display: flex;
  flex-direction: column;
  gap: 22px;
  pointer-events: none;
  transition: opacity 0.22s, transform 0.32s cubic-bezier(.7,.1,.22,1);
}
.cookie-modal.active {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -53%) scale(1);
}
.cookie-modal__title {
  font-family: 'Montserrat', Arial, sans-serif;
  font-size: 1.26rem;
  color: var(--color-primary);
  font-weight: 700;
  margin-bottom: 10px;
}
.cookie-category {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 8px;
}
.cookie-category label {
  font-size: 1rem;
  color: var(--color-text);
}
.cookie-modal .switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 23px;
}
.cookie-modal .switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.cookie-modal .slider {
  position: absolute;
  cursor: pointer;
  background-color: #E3D9C3;
  border-radius: 30px;
  top: 0; left: 0; right: 0; bottom: 0;
  transition: background .16s;
}
.cookie-modal .slider:before {
  position: absolute;
  content: "";
  height: 19px;
  width: 19px;
  left: 2px;
  bottom: 2px;
  border-radius: 50%;
  background: var(--color-primary);
  transition: transform .18s, background .18s;
}
.cookie-modal .switch input:checked + .slider {
  background-color: #DDF3E7;
}
.cookie-modal .switch input:checked + .slider:before {
  transform: translateX(21px);
}

.cookie-modal__desc {
  font-size: 0.97rem;
  color: #4A4B35;
  margin-top: -8px;
  margin-bottom: 10px;
}
.cookie-modal__actions {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: flex-end;
}

.cookie-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  color: var(--color-primary);
  background: none;
  border-radius: 8px;
  font-size: 1.38rem;
  width: 36px; height: 36px;
  cursor: pointer;
  transition: background 0.1s;
}
.cookie-modal__close:hover,
.cookie-modal__close:focus {
  background: var(--color-bg-card);
}

@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(24px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* MEDIA QUERIES: RESPONSIVE DESIGN */
@media (max-width: 1100px) {
  .features-grid li, .services-list > div, .category-grid > div {
    flex-basis: 48%;
  }
  .footer .container { gap: 16px; }
}
@media (max-width: 900px) {
  .features-grid li, .services-list > div, .category-grid > div {
    flex-basis: 100%;
    min-width: 180px;
  }
}
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.12rem; }
  .section, .hero { padding: 28px 6px; }
  .container {
    padding-left: 10px;
    padding-right: 10px;
  }
  .features-grid, .category-grid, .services-list, .testimonial-slider, .footer .container {
    flex-direction: column;
    gap: 18px;
  }
  .text-image-section, .content-grid {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
  }
  header .container { flex-direction: row; gap: 8px; }
  .testimonial-card { padding: 15px 12px; }
  .mobile-menu-toggle {
    display: flex;
  }
  header nav, header .cta {
    display: none !important;
  }
  footer .container {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 18px;
  }
}
@media (max-width: 500px) {
  .hero { padding: 16px 0 34px 0; }
  h1 { font-size: 1.21rem; }
  .cta { font-size: 1rem; padding: 0.7em 1.6em; }
  .testimonial-card { font-size: 0.98rem; padding: 12px 6px; }
  .cookie-modal { min-width: 90vw; width: 99vw; padding: 20px 7px; }
}

/* MISC INTERACTIVE EFFECTS */
.cta:active {
  transform: scale(0.97);
  box-shadow: 0 1px 6px #B98428;
}
a:active, .cookie-btn:active {
  opacity: 0.88;
}
/* FOCUS STATES */
a:focus, .cta:focus, .cookie-btn:focus, .mobile-menu-toggle:focus, .mobile-menu-close:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Z-INDEX LAYERING & OVERLAP CONTROL */
header, .mobile-menu { z-index: 200; }
.cookie-banner { z-index: 300; }
.cookie-modal { z-index: 350; }

/* PREVENT CARD OVERLAP */
.features-grid li, .services-list > div, .category-grid > div, .testimonial-card, .card {
  margin-right: 0;
  margin-bottom: 24px;
}

/* VISUAL CLARITY */
::-webkit-input-placeholder { color: #7b806a; }
::-moz-placeholder { color: #7b806a; }
:-ms-input-placeholder { color: #7b806a; }
::placeholder { color: #7b806a; }

body {
  background: #fff; /* fallback */
}

/* Hide scroll on body when mobile menu/modal is open */
body.menu-open, body.cookie-modal-open {
  overflow: hidden;
}
