/* =============================================
   Miele Torre Bianca — Stili principali
   ============================================= */

:root {
  --color-honey: #D4920A;
  --color-honey-light: #E8B84A;
  --color-terracotta: #C4572A;
  --color-olive: #5C6B3C;
  --color-olive-light: #7A8F52;
  --color-sea: #2B6B8A;
  --color-sand: #FFF8F0;
  --color-cream: #F5E6D3;
  --color-charcoal: #1A1A1A;
  --color-charcoal-soft: #2D2D2D;
  --color-white: #FFFFFF;
  --color-text: #3A3228;
  --color-text-muted: #6B5E50;

  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;

  --header-height: 80px;
  --container-max: 1200px;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.08);
  --shadow-lg: 0 12px 48px rgba(26, 26, 26, 0.12);
  --transition: 0.3s ease;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-text);
  background-color: var(--color-sand);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-sea);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--color-terracotta);
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--color-honey);
  outline-offset: 3px;
}

address {
  font-style: normal;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Honeycomb background pattern */
.section--ape::before,
.section--products::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='100' viewBox='0 0 56 100'%3E%3Cpath d='M28 0L56 16v32L28 64 0 48V16z M28 36l28 16v32L28 100 0 84V52z' fill='%23D4920A' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 56px 100px;
  pointer-events: none;
}

/* =============================================
   Header
   ============================================= */

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--header-height);
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(12px);
  transition: height var(--transition), box-shadow var(--transition);
}

.header--scrolled {
  height: 64px;
  box-shadow: var(--shadow);
}

.header__logo-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--color-white);
  border-bottom-right-radius: var(--header-height);
  transition: border-radius var(--transition);
  pointer-events: none;
  z-index: 0;
}

.header--scrolled .header__logo-wrap {
  border-bottom-right-radius: 64px;
}

.header__inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header__logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.header__logo img {
  height: 48px;
  width: auto;
  transition: height var(--transition);
}

.header--scrolled .header__logo img {
  height: 40px;
}

.header__toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.header__toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.header__toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.header__toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.header__toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.header__nav {
  display: none;
}

.header__list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header__link {
  color: var(--color-white);
  font-weight: 500;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  position: relative;
}

.header__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-honey);
  transition: width var(--transition);
}

.header__link:hover {
  color: var(--color-honey-light);
}

.header__link:hover::after {
  width: 100%;
}

.header__link--cta {
  background: var(--color-honey);
  color: var(--color-charcoal) !important;
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
}

.header__link--cta::after {
  display: none;
}

.header__link--cta:hover {
  background: var(--color-honey-light);
  color: var(--color-charcoal) !important;
}

@media (min-width: 768px) {
  .header__toggle {
    display: none;
  }

  .header__nav {
    display: flex;
    align-items: center;
  }
}

@media (max-width: 767px) {
  .header__nav {
    position: fixed;
    inset: 0;
    top: var(--header-height);
    background: rgba(26, 26, 26, 0.98);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
  }

  .header__nav.is-open {
    opacity: 1;
    visibility: visible;
  }

  .header__list {
    flex-direction: column;
    gap: 2.5rem;
    text-align: center;
  }

  .header__link {
    font-size: 1.25rem;
  }
}

/* =============================================
   Buttons
   ============================================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  border-radius: 50px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

.btn--primary {
  background: var(--color-honey);
  color: var(--color-charcoal);
  border-color: var(--color-honey);
}

.btn--primary:hover {
  background: var(--color-honey-light);
  border-color: var(--color-honey-light);
  color: var(--color-charcoal);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(212, 146, 10, 0.35);
}

.btn--outline {
  background: transparent;
  color: var(--color-white);
  border-color: var(--color-white);
}

.btn--outline:hover {
  background: var(--color-white);
  color: var(--color-charcoal);
  transform: translateY(-2px);
}

/* =============================================
   Hero
   ============================================= */

.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
}

.hero__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(26, 26, 26, 0.75) 0%,
    rgba(45, 45, 45, 0.5) 50%,
    rgba(212, 146, 10, 0.25) 100%
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: calc(var(--header-height) + 2rem) 1.5rem 4rem;
  max-width: 800px;
}

.hero__eyebrow {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-honey-light);
  margin-bottom: 1rem;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.1;
  margin-bottom: 1.25rem;
}

.hero__subtitle {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.hero__scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.hero__scroll span {
  display: block;
  width: 24px;
  height: 40px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  position: relative;
}

.hero__scroll span::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  background: var(--color-honey);
  border-radius: 2px;
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 1; }
  50% { transform: translateX(-50%) translateY(12px); opacity: 0.3; }
}

/* =============================================
   Sections
   ============================================= */

.section {
  position: relative;
  padding: 5rem 0;
}

.section--cream {
  background: var(--color-cream);
}

.section--ape {
  background: var(--color-sand);
  overflow: hidden;
}

.section--products {
  background: linear-gradient(180deg, var(--color-cream) 0%, var(--color-sand) 100%);
  overflow: hidden;
}

.section--gallery {
  background: var(--color-sand);
}

.section--contact {
  background: var(--color-cream);
}

.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-honey);
  margin-bottom: 0.75rem;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-charcoal);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section__intro {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  max-width: 600px;
}

.section__header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.section__header .section__intro {
  margin: 0 auto;
}

/* =============================================
   Split layout (Chi siamo)
   ============================================= */

.split {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.split__image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.split__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

.split__content p {
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.split__content p:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

/* =============================================
   Ape Nera section
   ============================================= */

.ape-hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-lg);
}

.ape-hero__image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.ape-hero__badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: var(--color-olive);
  color: var(--color-white);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.ape-content {
  display: grid;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.ape-content__text p {
  margin-bottom: 1.25rem;
}

.ape-content__text p:last-child {
  margin-bottom: 0;
}

.ape-content__image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.ape-content__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.ape-content__caption {
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  background: var(--color-cream);
  text-align: center;
}

@media (min-width: 768px) {
  .ape-content {
    grid-template-columns: 1.2fr 1fr;
    gap: 3rem;
    align-items: start;
  }
}

/* Features grid */
.features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.feature {
  background: var(--color-white);
  padding: 2rem 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--color-honey);
  transition: transform var(--transition);
}

.feature:hover {
  transform: translateY(-4px);
}

.feature__icon {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.feature__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-charcoal);
  margin-bottom: 0.5rem;
}

.feature__text {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

@media (min-width: 768px) {
  .features {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .features {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =============================================
   Products
   ============================================= */

.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.product-card {
  background: var(--color-white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-card__image {
  overflow: hidden;
}

.product-card__image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card__image img {
  transform: scale(1.05);
}

.product-card__body {
  padding: 1.5rem;
}

.product-card__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-olive);
  margin-bottom: 0.5rem;
}

.product-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-charcoal);
  margin-bottom: 0.75rem;
}

.product-card__text {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
}

.product-card--featured {
  border: 2px solid var(--color-honey);
}

.product-card--featured .product-card__badge {
  color: var(--color-honey);
  background: rgba(212, 146, 10, 0.12);
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
}

.product-card--featured .product-card__title {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
}

@media (min-width: 768px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-card--featured {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .product-card--featured .product-card__image img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 280px;
  }
}

@media (min-width: 1024px) {
  .products {
    grid-template-columns: repeat(3, 1fr);
  }

  .product-card--featured {
    grid-column: span 2;
  }
}

/* =============================================
   Gallery
   ============================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.gallery__item {
  border: none;
  padding: 0;
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  background: none;
  position: relative;
}

.gallery__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(212, 146, 10, 0);
  transition: background var(--transition);
}

.gallery__item:hover::after {
  background: rgba(212, 146, 10, 0.2);
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery__item:hover img {
  transform: scale(1.05);
}

@media (min-width: 768px) {
  .gallery {
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
  }

  .gallery__item:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
  }

  .gallery__item:nth-child(1) img {
    aspect-ratio: auto;
    height: 100%;
    min-height: 300px;
  }
}

/* =============================================
   Contact
   ============================================= */

.contact {
  display: grid;
  gap: 3rem;
  align-items: center;
}

.contact__intro {
  color: var(--color-text-muted);
  margin-bottom: 2rem;
}

.contact__list {
  list-style: none;
}

.contact__list li {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(58, 50, 40, 0.1);
}

.contact__list li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.contact__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-honey);
  margin-bottom: 0.25rem;
}

.contact__list a {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--color-charcoal);
}

.contact__list a:hover {
  color: var(--color-terracotta);
}

.contact__list strong {
  font-size: 1.1rem;
  color: var(--color-charcoal);
}

.contact__list address {
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

.contact__visual {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.contact__visual img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

@media (min-width: 768px) {
  .contact {
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
  }
}

/* =============================================
   Footer
   ============================================= */

.footer {
  background: var(--color-charcoal);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

.footer__brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.footer__brand img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.footer__name {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
}

.footer__owner {
  font-size: 0.9rem;
  color: var(--color-honey-light);
}

.footer__copy {
  font-size: 0.85rem;
}

.footer__nav {
  display: flex;
  gap: 2rem;
}

.footer__nav a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer__nav a:hover {
  color: var(--color-honey-light);
}

@media (min-width: 768px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }

  .footer__copy {
    order: 0;
  }
}

/* =============================================
   Lightbox
   ============================================= */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(26, 26, 26, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__content {
  max-width: 90vw;
  max-height: 85vh;
}

.lightbox__content img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
}

.lightbox__close,
.lightbox__prev,
.lightbox__next {
  position: absolute;
  background: none;
  border: none;
  color: var(--color-white);
  cursor: pointer;
  font-size: 2.5rem;
  line-height: 1;
  padding: 0.5rem;
  transition: color var(--transition);
  z-index: 2001;
}

.lightbox__close:hover,
.lightbox__prev:hover,
.lightbox__next:hover {
  color: var(--color-honey);
}

.lightbox__close {
  top: 1rem;
  right: 1.5rem;
  font-size: 3rem;
}

.lightbox__prev {
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
}

/* =============================================
   Reveal animations
   ============================================= */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero__scroll span::after {
    animation: none;
  }

  .product-card:hover,
  .feature:hover {
    transform: none;
  }
}
