:root {
  --terracotta: #f07e01;
  --terracotta-dark: #c96900;
  --legno: #1a1a1a;
  --crema: #f7f7f7;
  --crema-dark: #e7e7e7;
  --testo: #1a1a1a;
  --testo-chiaro: #6b6b6b;
  --font-titoli: 'Fraunces', serif;
  --font-testo: 'Work Sans', sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-testo);
  color: var(--testo);
  background: var(--crema);
  line-height: 1.6;
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-titoli);
  font-weight: 600;
  color: var(--legno);
  margin-top: 0;
}

h1 { font-size: 2.8rem; line-height: 1.15; }
h2 { font-size: 2rem; margin-bottom: 1.5rem; }

a { color: inherit; text-decoration: none; }

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 64px 0; }

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--terracotta);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.lead { font-size: 1.15rem; color: var(--testo-chiaro); max-width: 60ch; }

/* Bottoni */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 4px;
  font-weight: 600;
  transition: all 0.2s ease;
  border: 2px solid transparent;
}
.btn-primary {
  background: var(--terracotta);
  color: #fff;
}
.btn-primary:hover {
  background: var(--terracotta-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(240, 126, 1, 0.3);
}
.btn-outline {
  border-color: var(--legno);
  color: var(--legno);
}
.btn-outline:hover {
  background: var(--legno);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
}

/* Header */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--crema-dark);
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
}
.logo {
  display: flex;
  align-items: center;
  font-family: var(--font-titoli);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--legno);
}
.logo span { color: var(--terracotta); }
.logo-img { height: 48px; width: auto; display: block; }
.header-social {
  position: absolute;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 10px;
}
.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--legno);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.social-icon:hover { background: var(--terracotta); transform: translateY(-2px); }
.main-nav {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: 12px 24px;
  border-top: 1px solid var(--crema-dark);
}
.main-nav a {
  font-weight: 500;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s ease;
}
.main-nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--terracotta);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.25s ease;
}
.main-nav a:hover { color: var(--terracotta); }
.main-nav a:hover::after { transform: scaleX(1); transform-origin: left; }
.menu-toggle {
  display: none;
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero */
.hero { padding: 80px 0; }
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero-image img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.hero-mosaic, .mosaic-wide {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  grid-template-areas:
    "a b c"
    "a d e";
  gap: 10px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.hero-mosaic { height: 420px; }
.mosaic-wide { height: 520px; margin: 0 0 64px; }
.hero-mosaic img, .mosaic-wide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
  box-shadow: none;
}
.hero-mosaic img:nth-child(1), .mosaic-wide img:nth-child(1) { grid-area: a; }
.hero-mosaic img:nth-child(2), .mosaic-wide img:nth-child(2) { grid-area: b; }
.hero-mosaic img:nth-child(3), .mosaic-wide img:nth-child(3) { grid-area: c; }
.hero-mosaic img:nth-child(4), .mosaic-wide img:nth-child(4) { grid-area: d; }
.hero-mosaic img:nth-child(5), .mosaic-wide img:nth-child(5) { grid-area: e; }
.hero-text h1 { margin-bottom: 20px; }
.hero-text .lead { margin-bottom: 28px; }

/* Values */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}
.value-card {
  background: #fff;
  padding: 32px;
  border-radius: 8px;
  border-top: 3px solid var(--terracotta);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.14);
}
.value-card p { color: var(--testo-chiaro); margin-bottom: 0; }

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-bottom: 40px;
}
.products-grid-full {
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  margin-bottom: 0;
}
.products-grid-full .product-card-body { padding: 28px; }
.products-grid-full .product-card-body h3 { font-size: 1.5rem; }
.products-grid-full .product-card-body p { font-size: 1rem; }
.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}
.product-card img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover img { transform: scale(1.06); }
.product-card-body { padding: 20px; }
.product-card-body p { color: var(--testo-chiaro); font-size: 0.95rem; }
.product-card-cta { margin-top: 8px; }

/* Photo gallery inside a product card (Prodotti page) */
.photo-slider {
  position: relative;
  overflow: hidden;
}
.photo-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.photo-track::-webkit-scrollbar { display: none; }
.photo-track img {
  flex: 0 0 100%;
  width: 100%;
  height: 320px;
  object-fit: cover;
  scroll-snap-align: start;
}
.photo-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--legno);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  z-index: 2;
}
.photo-arrow:hover:not(:disabled) { background: var(--terracotta); color: #fff; }
.photo-arrow:disabled { opacity: 0; pointer-events: none; }
.photo-arrow-left { left: 12px; }
.photo-arrow-right { right: 12px; }
.photo-dots {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 2;
}
.photo-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}
.photo-dot.active { background: #fff; transform: scale(1.3); }

/* Product detail page */
.back-link {
  display: inline-block;
  font-weight: 500;
  color: var(--testo-chiaro);
  transition: color 0.2s ease;
}
.back-link:hover { color: var(--terracotta); }
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}
.product-detail-photo {
  border-radius: 12px;
}
.product-detail-photo .photo-track img { height: 460px; border-radius: 12px; cursor: pointer; }
.product-detail-info h1 { margin-bottom: 16px; }
.product-detail-info .lead { margin-bottom: 28px; }
.share-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--crema-dark);
}
.share-label { font-weight: 500; color: var(--testo-chiaro); font-size: 0.9rem; }
.share-buttons { display: flex; gap: 10px; }
.share-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--legno);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}
.share-btn:hover { background: var(--terracotta); transform: translateY(-2px); }
.share-feedback {
  font-size: 0.85rem;
  color: var(--terracotta);
  font-weight: 500;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.share-feedback.visible { opacity: 1; }

/* Product slider (home) */
.product-slider {
  position: relative;
  margin-bottom: 40px;
}
.product-slider-track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.product-slider-track::-webkit-scrollbar { display: none; }
.product-slider-track .product-card-link {
  display: block;
  flex: 0 0 380px;
  scroll-snap-align: start;
}
.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--legno);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
  z-index: 2;
}
.slider-arrow:hover:not(:disabled) {
  background: var(--terracotta);
  color: #fff;
  transform: translateY(-50%) scale(1.08);
}
.slider-arrow:disabled { opacity: 0.3; cursor: default; }
.slider-arrow-left { left: -22px; }
.slider-arrow-right { right: -22px; }

.center-cta { text-align: center; }

.cta-band {
  background: var(--legno);
  color: #fff;
  text-align: center;
}
.cta-band h2 { color: #fff; }
.cta-band p { max-width: 50ch; margin: 0 auto 28px; opacity: 0.9; }

/* About page */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 48px;
  align-items: center;
}
.about-grid img { width: 100%; height: 380px; object-fit: cover; border-radius: 12px; }
.about-photo-slider { border-radius: 12px; overflow: hidden; }
.about-grid-rev { grid-template-columns: 1.2fr 1fr; }

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0);
  transition: box-shadow 0.3s ease;
  border: none;
  background: none;
  padding: 0;
  margin: 0;
  font: inherit;
  cursor: pointer;
}
.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gallery-item:hover {
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.gallery-item:hover::after { opacity: 1; }
.gallery-grid img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.1); }

/* Legal / Privacy */
.legal-content { max-width: 74ch; }
.legal-content h2 { font-size: 1.4rem; margin-top: 40px; margin-bottom: 12px; }
.legal-content h2:first-child { margin-top: 0; }
.legal-content p { color: var(--testo-chiaro); margin-bottom: 14px; }
.legal-content ul { color: var(--testo-chiaro); padding-left: 22px; margin-bottom: 14px; }
.legal-content li { margin-bottom: 6px; }
.legal-content a { color: var(--terracotta); text-decoration: underline; }

/* Contatti */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  margin-bottom: 40px;
}
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.contact-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 500; }
.contact-form input, .contact-form textarea {
  padding: 12px 14px;
  border: 1px solid var(--crema-dark);
  border-radius: 4px;
  font-family: var(--font-testo);
  font-size: 1rem;
}
.contact-form button { align-self: flex-start; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.map-wrapper iframe { border-radius: 8px; width: 100%; height: 400px; border: 0; display: block; }
.map-placeholder {
  background: #fff;
  border: 1px solid var(--crema-dark);
  border-radius: 8px;
  padding: 48px 24px;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  text-align: center;
}
.map-placeholder p { color: var(--testo-chiaro); max-width: 50ch; margin: 0; }
.map-placeholder-link { font-weight: 600; color: var(--terracotta); }
.map-placeholder-link:hover { text-decoration: underline; }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--legno);
  color: #fff;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 200;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-text { flex: 1 1 400px; }
.cookie-banner-text p { margin: 0; font-size: 0.9rem; color: #f0e8dd; }
.cookie-banner-text a { text-decoration: underline; color: #fff; }
.cookie-banner-actions { display: flex; gap: 12px; flex-shrink: 0; }
.cookie-banner .btn-outline { border-color: #fff; color: #fff; }
.cookie-banner .btn-outline:hover { background: #fff; color: var(--legno); }
@media (max-width: 640px) {
  .cookie-banner { flex-direction: column; align-items: stretch; text-align: center; }
  .cookie-banner-actions { justify-content: center; }
}

/* Footer */
.site-footer { background: var(--crema); color: var(--testo); padding: 36px 0 0; }
.footer-inner {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-bottom: 28px;
}
.footer-logo-link { display: inline-block; margin-bottom: 14px; }
.footer-logo-img {
  height: 72px;
  width: auto;
  display: block;
}
.footer-social { display: flex; gap: 10px; margin-top: 4px; }
.site-footer a:hover { color: var(--terracotta); }
.footer-bottom {
  border-top: 1px solid var(--crema-dark);
  text-align: center;
  padding: 12px;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Lightbox (Gallery) */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox-image {
  max-width: 88vw;
  max-height: 82vh;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}
.lightbox-close,
.lightbox-arrow {
  position: absolute;
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.2s ease;
}
.lightbox-close:hover,
.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.28); }
.lightbox-close {
  top: 20px;
  right: 24px;
  width: 44px;
  height: 44px;
  font-size: 1.8rem;
}
.lightbox-arrow {
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  font-size: 2rem;
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #f0e8dd;
  font-size: 0.9rem;
  opacity: 0.85;
}
@media (max-width: 640px) {
  .lightbox-arrow { width: 40px; height: 40px; font-size: 1.5rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* Responsive */
@media (max-width: 860px) {
  .hero-inner, .about-grid, .contact-grid, .product-detail-grid { grid-template-columns: 1fr; }
  .product-detail-photo .photo-track img { height: 320px; }
  .hero-mosaic { height: 300px; }
  .mosaic-wide { height: 340px; }
  .values-grid, .products-grid, .footer-inner { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .product-slider-track .product-card { flex: 0 0 calc((100% - 28px) / 2); }
  .slider-arrow-left { left: -8px; }
  .slider-arrow-right { right: -8px; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    padding: 16px 24px;
    gap: 16px;
    border-top: none;
    border-bottom: 1px solid var(--crema-dark);
  }
  .main-nav.open { display: flex; }
  .menu-toggle { display: block; }
}

@media (max-width: 560px) {
  .product-slider-track .product-card { flex: 0 0 85%; }
}
