/* ============================
   Gelato Sicily Milano – Stili
   ============================ */

/* --- Reset & Variabili --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette colori */
  --crema:       #FDF6EC;
  --avorio:      #F5EFE0;
  --sabbia:      #E8DCC8;
  --espresso:    #3B2314;
  --marrone:     #5C3A1E;
  --terracotta:  #C1694F;
  --oliva:       #6B7C4E;
  --dorato:      #C9A84C;
  --bianco:      #FFFFFF;
  --grigio-chiaro: #F9F6F1;

  /* Font */
  --font-serif:  'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans:   'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Spacing */
  --container-max: 1140px;
  --section-py:    5rem;
  --gap:           1.5rem;

  /* Transizioni */
  --transition: 0.3s cubic-bezier(.4, 0, .2, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  color: var(--espresso);
  background: var(--crema);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Container --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* --- Header / Navigazione --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: transparent;
  transition: background var(--transition), box-shadow var(--transition);
}

.header--scrolled {
  background: rgba(253, 246, 236, 0.96);
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 20px rgba(59, 35, 20, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bianco);
  transition: color var(--transition);
}

.header--scrolled .nav__logo {
  color: var(--espresso);
}

.nav__logo-icon {
  font-size: 1.6rem;
}

.nav__menu {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav__link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--bianco);
  opacity: 0.9;
  transition: opacity var(--transition), color var(--transition);
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--dorato);
  transition: width var(--transition);
}

.nav__link:hover::after,
.nav__link:focus::after {
  width: 100%;
}

.nav__link:hover {
  opacity: 1;
}

.header--scrolled .nav__link {
  color: var(--espresso);
}

/* Hamburger */
.nav__toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav__toggle span {
  width: 24px;
  height: 2px;
  background: var(--bianco);
  border-radius: 2px;
  transition: all var(--transition);
}

.header--scrolled .nav__toggle span {
  background: var(--espresso);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    url('https://images.unsplash.com/photo-1765478006783-2df9698dfef6?w=1600&h=900&fit=crop') center/cover no-repeat;
  color: var(--bianco);
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(59, 35, 20, 0.75) 0%,
    rgba(59, 35, 20, 0.50) 50%,
    rgba(92, 58, 30, 0.60) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 6rem 1.25rem 4rem;
}

.hero__title {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.hero__subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  font-weight: 300;
  opacity: 0.9;
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Pulsante CTA */
.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  border-radius: 50px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  text-align: center;
}

.btn--primary {
  background: var(--terracotta);
  color: var(--bianco);
  box-shadow: 0 4px 15px rgba(193, 105, 79, 0.4);
}

.btn--primary:hover {
  background: var(--marrone);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(59, 35, 20, 0.3);
}

/* --- Sezioni comuni --- */
.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--espresso);
}

.section-subtitle {
  text-align: center;
  color: var(--marrone);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
  max-width: 550px;
  margin-left: auto;
  margin-right: auto;
}

.section-title--light {
  color: var(--bianco);
}

/* --- Sezione Menù --- */
.menu-section {
  padding: var(--section-py) 0;
  background: var(--bianco);
}

/* Tabs / Filtri */
.menu__tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 2.5rem;
}

.menu__tab {
  padding: 0.55rem 1.4rem;
  border-radius: 50px;
  border: 2px solid var(--sabbia);
  background: transparent;
  color: var(--marrone);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.menu__tab:hover {
  border-color: var(--terracotta);
  color: var(--terracotta);
}

.menu__tab--active,
.menu__tab[aria-selected="true"] {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: var(--bianco);
}

.menu__tab:focus-visible {
  outline: 2px solid var(--dorato);
  outline-offset: 2px;
}

/* Griglia Prodotti */
.menu__grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: var(--gap);
}

@media (min-width: 768px) {
  .menu__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .menu__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Scheda Prodotto */
.product-card {
  background: var(--grigio-chiaro);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: fadeUp 0.4s ease both;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 40px rgba(59, 35, 20, 0.12);
}

.product-card__image {
  position: relative;
  width: 100%;
  padding-top: 100%;
  overflow: hidden;
  background: var(--sabbia);
}

.product-card__image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card__image img {
  transform: scale(1.08);
}

.product-card__body {
  padding: 1.1rem 1.25rem 1.3rem;
}

.product-card__name {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--espresso);
}

.product-card__desc {
  font-size: 0.88rem;
  color: var(--marrone);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}

.product-card__price {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--terracotta);
}

.product-card__price::before {
  content: '€ ';
  font-size: 0.85rem;
  font-weight: 400;
}

/* Animazione entrata */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stato vuoto */
.menu__empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--marrone);
  font-size: 1.1rem;
}

/* --- Sezione Chi Siamo --- */
.about-section {
  padding: var(--section-py) 0;
  background: var(--crema);
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .about__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.about__image img {
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(59, 35, 20, 0.1);
  width: 100%;
  height: 350px;
  object-fit: cover;
}

.about__text .section-title {
  text-align: left;
}

.about__text p {
  margin-bottom: 1rem;
  color: var(--marrone);
  font-size: 1.02rem;
  line-height: 1.75;
}

.about__text strong {
  color: var(--espresso);
}

.about__text em {
  color: var(--terracotta);
  font-style: italic;
}

/* --- Sezione Contatti --- */
.contacts-section {
  padding: var(--section-py) 0;
  background: var(--espresso);
  color: var(--bianco);
}

.contacts__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}

@media (min-width: 768px) {
  .contacts__grid {
    grid-template-columns: 1fr 1fr;
  }
}

.contacts__item {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  align-items: flex-start;
}

.contacts__icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.contacts__item h3 {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: var(--dorato);
}

.contacts__item p,
.contacts__item a {
  font-size: 0.95rem;
  opacity: 0.9;
  transition: opacity var(--transition);
}

.contacts__item a:hover {
  opacity: 1;
  text-decoration: underline;
}

.contacts__social {
  display: flex;
  gap: 1.2rem;
  margin-top: 1rem;
}

.social-link {
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  transition: background var(--transition);
}

.social-link:hover {
  background: rgba(255, 255, 255, 0.15);
}

.contacts__map iframe {
  width: 100%;
  min-height: 300px;
}

/* --- Footer --- */
.footer {
  background: #2A180E;
  padding: 1.5rem 0;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.85rem;
}

.footer__inner p {
  margin-bottom: 0.3rem;
}

.footer__note {
  font-size: 0.78rem;
  opacity: 0.6;
}

/* --- Responsive / Mobile --- */
@media (max-width: 767px) {
  .nav__menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    max-width: 300px;
    height: 100vh;
    background: var(--crema);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    transition: right var(--transition);
    z-index: 999;
  }

  .nav__menu--open {
    right: 0;
  }

  .nav__menu .nav__link {
    color: var(--espresso);
    font-size: 1.1rem;
  }

  .nav__toggle {
    display: flex;
    z-index: 1001;
  }

  .nav__toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .nav__toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
  }

  .nav__toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .hero__content {
    padding: 8rem 1rem 3rem;
  }

  .menu__tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
  }

  .about__image img {
    height: 260px;
  }
}

/* Overlay mobile menu */
.menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition);
}

.menu-overlay--active {
  opacity: 1;
  visibility: visible;
}

/* --- Accessibilità --- */
:focus-visible {
  outline: 2px solid var(--dorato);
  outline-offset: 2px;
}

/* Riduci animazioni se l'utente preferisce */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Stampa */
@media print {
  .header, .hero__overlay, .menu__tabs, .contacts__map, .nav__toggle {
    display: none !important;
  }

  .hero {
    min-height: auto;
    padding: 2rem;
    background: none;
    color: #000;
  }

  .hero__title {
    text-shadow: none;
    color: #000;
  }

  body {
    background: #fff;
  }
}
