/* =========================================================
   HOME.CSS OTTIMIZZATO
   - Duplicati rimossi mantenendo la regola più recente
   - Regole raggruppate per famiglia
   - Media query riordinate: tablet, mobile, small mobile
========================================================= */

/* =========================================================
   BASE HOME
========================================================= */
#index #wrapper {
  padding-top: 0 !important;
  padding-bottom: 0;
  background: #fff;
}

#home-formati {
  scroll-margin-top: 50px;
}

/* =========================================================
   HEADER HOME
========================================================= */
/* Header home in alto: totalmente trasparente */
body#index #header:not(.scrolled) {
  background: rgba(51, 51, 51, 0) !important;
  border-bottom-color: transparent !important;
  box-shadow: none;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

/* Header home dopo scroll: uguale all'header standard */
body#index #header.scrolled {
  background: rgb(75 75 75 / 72%) !important;
  border-bottom-color: transparent !important;
  box-shadow: 0 2px 20px rgba(0, 0, 0, .18);
      backdrop-filter: blur(4px) saturate(120%);
    -webkit-backdrop-filter: blur(4px) saturate(120%);
}

/* =========================================================
   HERO HOME
========================================================= */
.hero-full {
  position: relative;
  width: 100vw;
  min-height: 650px;
  margin-left: calc(50% - 50vw);
  padding: 80px 0 50px;
  overflow: hidden;
  background: none;
  clip-path: ellipse(120% 100% at 50% 0%);
}

/* Sfondo animato cardbg */
.hero-full::after {
  content: "";
  position: absolute;
  inset: -15%;
  z-index: 0;
  background:
    linear-gradient(
      rgba(51, 51, 51, .95) 0%,
      rgba(51, 51, 51, .25) 35%,
      rgba(51, 51, 51, 0) 100%
    ),
    url("../../img/home/cardbg.webp") center center / cover no-repeat;
  animation: cardBgFloat 10s ease-in-out infinite;
  transform-origin: center center;
}

/* Mani hero desktop/tablet */
.hero-full::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("../../img/herohands.webp") center center / cover no-repeat;
  animation: heroHandsFloat 10s ease-in-out infinite;
}

.hero-mobile-image {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 13;
  width: 600px;
  margin: 0;
  padding: 80px 50px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  color: #fff;
  text-align: left;
}

.hero-content h1 {
  margin: 0 0 20px;
  font-size: clamp(42px, 6vw, 74px);
  line-height: 1.05;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .22);
}

.hero-content .btn.btn-primary {
  width: 100%;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 25px !important;
}

/* Animazioni hero */
@keyframes heroHandsFloat {
  0%, 100% {
    transform: scale(1.02) translateX(0);
  }

  50% {
    transform: scale(1.04) translateX(-12px);
  }
}

@keyframes cardBgFloat {
  0%, 100% {
    transform: scale(1.15) translate(0, 0);
  }

  50% {
    transform: scale(1.28) translate(-25px, -15px);
  }
}

/* =========================================================
   HERO SEARCH
========================================================= */
.hero-search {
  width: 100%;
  margin-top: 14px;
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .15);
  background: rgba(255, 255, 255, .10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-search:hover {
  background: rgba(255, 255, 255, .20);
}

.hero-search input {
  flex: 1;
  height: 58px;
  padding: 0 22px;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
}

.hero-search input::placeholder {
  color: rgba(255, 255, 255, .72);
}

.hero-search button {
  width: 64px;
  height: 58px;
  border: 0;
  background: transparent;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: .25s ease;
}

.hero-search button:hover {
  background: rgba(255, 255, 255, .10);
}

.hero-search .material-icons {
  font-size: 24px;
}

/* =========================================================
   SHIPPING DISCLAIMER HERO
========================================================= */
.shipping-disclaimer {
  margin: 14px 0 0;
}

.shipping-disclaimer a {
  display: block;
  width: 100%;
  padding: 10px 20px;
  box-sizing: border-box;
  text-align: center;
  color: #fff !important;
  text-decoration: none;
  line-height: 1.7;
  font-size: 13px;
  background: rgba(255, 255, 255, .10);
  border-radius: 50px;
  border: 1px solid rgba(255, 255, 255, .20);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: all .3s ease;
}

.shipping-disclaimer a::before {
  content: "💡";
  margin-right: 5px;
  font-size: 18px;
  line-height: 1;
}

.shipping-disclaimer a:hover {
  color: #fff !important;
  text-decoration: none;
  background: rgba(255, 255, 255, .20);
}

.shipping-disclaimer-small {
  display: inline-block;
  margin-top: 4px;
  font-size: .95em;
}

/* =========================================================
   HOME FORMATI
========================================================= */
.home-formati {
  padding: 50px 20px 80px;
  margin-top: 50px;
  text-align: center;
}

.home-formati h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 50px;
  font-size: 36px;
}

.home-formati h2::before,
.home-formati h2::after {
  content: "";
  flex: 1;
  max-width: 250px;
  height: 2px;
  background: #f0f0f0;
}

.home-formati-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  box-sizing: border-box;
}

.home-formato-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 26px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
  text-decoration: none;
  border-bottom: 5px solid #d4af37;
  transition: transform .35s ease;
}

.home-formato-card:hover {
  transform: translateY(-5px);
}

/* Overlay superiore oro */
.home-formato-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(212, 175, 55, .35) 0%,
    rgba(212, 175, 55, .15) 25%,
    rgba(212, 175, 55, 0) 60%
  );
  pointer-events: none;
}

/* Overlay base disponibile per effetti futuri */
.home-formato-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* Posizione sfondo per le 4 card desktop */
.home-formato-card-1 {
  background-position: 0% 85%;
}

.home-formato-card-2 {
  background-position: 33.33% 85%;
}

.home-formato-card-3 {
  background-position: 66.66% 85%;
}

.home-formato-card-4 {
  background-position: 100% 85%;
}

.home-formato-product {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 58px;
  width: 78%;
  max-height: 72%;
  object-fit: contain;
  opacity: 0;
  transform: translate(-50%, 45px);
  transition: transform .8s ease, opacity .8s ease;
}

.home-formato-title {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 20px;
  z-index: 3;
  text-align: center;
}

.home-formato-title span,
.home-formato-card span {
  position: relative;
  z-index: 3;
  display: block;
  width: 100%;
  opacity: 0;
  transform: translateY(35px);
  transition: transform .8s ease, opacity .8s ease;
}

span.hfspan1 {
  text-align: center;
  font-size: 15px;
  line-height: 1.15;
  font-weight: 500;
}

span.hfspan2 {
  text-align: center;
  color: #333;
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
}

.hfspan2 sup {
  position: relative;
  top: -.4em;
  font-size: .45em;
}

/* Attivazione animazione card */
.home-formato-card.is-visible .home-formato-product,
.home-formato-card.is-visible span {
  opacity: 1;
  transform: translateY(0);
}

.home-formato-card.is-visible .home-formato-product {
  transform: translate(-50%, 0);
}

/* =========================================================
   HOME GRANI / DETTAGLIO NESPRESSO
========================================================= */
.home-grani {
  padding: 40px 0;
  display: flex;
  justify-content: center;
}

.home-grani-inner {
  width: 100%;
  max-width: 1100px;
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 40px;
  border: 1px solid #eee;
  border-radius: 10px;
  background: #f9f9f9;
}

.home-grani-text,
.home-grani-image {
  flex: 1;
}

.home-grani-text h2 {
  margin: 0 0 15px;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 700;
}

.home-grani-text p {
     font-style: italic;
    font-weight: 100;
}

.home-feabox-p span {
    display: inline !important;
    font-weight: 500;
}

.home-feabox-p span {
    line-height: 1.2;
    margin: 0 0 20px;
  font-size: 18px;
  color: #555;
}

span.home-feabox-p-span2 {
background: transparent;
    margin-left: 10px;
    padding: 5px 10px 5px 10px;
    border-radius: 5px;
    color: #333;
    border-top: 1px solid #d4af37;
    border-bottom: 1px solid #d4af37;
}

.home-grani-text span {
    display: block;
}
span.home-feabox-span1 {
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
}
.home-feabox-span2 sup {
    font-size: 0.35em;
    vertical-align: super;
    line-height: 0;
    position: relative;
    top: -0.6em;
}
span.home-feabox-span3 {
    line-height: 1.5;
    font-size: 35px;
    font-weight: 300;
        font-style: italic;

}
a.btn.btn-primary.feaboxbtn {
    font-size: 25px;
    margin-top: 15px;
}
.home-grani-image a {
  display: block;
  overflow: hidden;
  border-radius: 6px;
}

.home-grani-image img {
  width: 100%;
  height: auto;
  transition: transform .4s ease, filter .4s ease;
}

.home-grani-image a:hover img {
  transform: scale(1.06);
  filter: brightness(.95);
}

.home-nespresso-det .home-grani-inner {
  flex-direction: row;
}

/* =========================================================
   HOME SERVICES
========================================================= */
.home-services {
  padding: 35px 0;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
}

.home-services-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 28px;
  align-items: center;
}

/* =========================================================
   CATEGORY HERO
========================================================= */
.ac-category-hero-overlay {
  min-height: 350px;
  display: flex;
  align-items: center;
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, .78) 0%,
    rgba(0, 0, 0, .45) 50%,
    rgba(0, 0, 0, .78) 100%
  );
}

.ac-category-hero-inner {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 60px 25px;
}

/* =========================================================
   TABLET GENERICO
========================================================= */
@media (max-width: 1024px) {
  .hero-content {
    padding: 70px 25px;
  }

  .home-formati-grid,
  .home-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .home-formati-grid {
    gap: 16px;
  }
}

/* =========================================================
   TABLET 768px - 1024px
========================================================= */
@media (min-width: 768px) and (max-width: 1024px) {
  .hero-full {
    min-height: 650px;
    padding: 80px 0 50px;
  }

  .hero-full::before {
    background: url("../../img/herohands.webp") center center / cover no-repeat;
  }

  .hero-content {
    width: 550px;
    padding: 80px 40px;
  }

  .hero-content h1 {
    width: 100%;
    margin-bottom: 18px;
    text-align: left;
    font-size: 42px;
    line-height: 1.08;
  }

  .shipping-disclaimer {
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
  }

  .hero-content .btn.btn-primary,
  .hero-search {
    max-width: 100%;
  }

  .hero-search input {
    font-size: 15px;
  }

  .home-formati {
    padding: 40px 0;
  }

  .home-formati-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .home-formato-card {
    border-radius: 18px;
  }

  .home-formato-product {
    bottom: 48px;
    width: 82%;
    max-height: 68%;
  }

  .home-formato-card span {
    padding: 14px 10px;
    font-size: 15px !important;
    line-height: 1.2 !important;
  }

  .home-grani {
    padding: 0 0 40px;
  }

  .home-grani-inner {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }

  .home-nespresso-det .home-grani-inner {
    display: flex;
    flex-direction: column-reverse;
  }

  .ac-category-hero-overlay {
    min-height: 340px;
  }
}

/* =========================================================
   MOBILE <= 767px
========================================================= */
@media (max-width: 767px) {
  .hero-full {
    position: relative;
    width: 100vw;
    min-height: 600px;
    margin-left: calc(50% - 50vw);
    padding: 80px 0 60px;
    overflow: hidden;
    background: none !important;
    clip-path: ellipse(159% 100% at 50% 0%);
  }

  .hero-full::before {
    display: none !important;
  }

  .hero-full::after {
    z-index: 0;
  }

  .hero-mobile-image {
    display: block !important;
    position: relative;
    z-index: 2;
    width: calc(100% + 40px);
    max-width: none;
    height: auto;
    margin-right: -20px;
    margin-bottom: 0;
    margin-left: -20px;
  }

  .hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
    margin-top: -35px;
    padding: 0 20px;
  }

  .hero-content h1 {
    width: 100%;
    margin-bottom: 18px;
    text-align: center;
    font-size: 42px;
    line-height: 1.08;
  }

  .hero-content .btn.btn-primary,
  .hero-search {
    max-width: 100%;
  }

  .hero-search input {
    font-size: 15px;
  }

  .shipping-disclaimer {
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
  }

  .shipping-disclaimer a {
    padding: 8px 14px;
    font-size: 12px;
    line-height: 1.4;
  }

  .home-formati {
    padding: 40px 0;
    margin-top: 30px;
    margin-bottom: 50px;
  }

  .home-formati h2 {
    gap: 20px;
    margin-bottom: 50px;
    font-size: 20px;
  }

  .home-formati-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .home-formato-card {
    border-radius: 18px;
    background-size: 200% 200%;
  }

  /* Posizione sfondo per griglia 2x2 mobile */
  .home-formato-card-1 {
    background-position: 0% 0%;
  }

  .home-formato-card-2 {
    background-position: 100% 0%;
  }

  .home-formato-card-3 {
    background-position: 0% 100%;
  }

  .home-formato-card-4 {
    background-position: 100% 100%;
  }

  .home-formato-product {
    bottom: 48px;
    width: 82%;
    max-height: 68%;
  }

  span.hfspan1 {
    text-align: center;
    font-size: 13px;
    line-height: 1.15;
    font-weight: 500;
  }

  span.hfspan2 {
    text-align: center;
    color: #333;
    font-size: 20px;
    line-height: 1.15;
    font-weight: 700;
  }

  .hfspan2 sup {
    position: relative;
    top: -.4em;
    font-size: .45em;
  }

  .home-grani {
    padding: 0 0 40px;
  }

  .home-grani-inner {
    flex-direction: column;
    text-align: center;
    padding: 30px 20px;
  }
.home-feabox-p span {
            display: inline !important;
            margin: 0px !important;
                    font-size: 15px;
                    font-weight: 500;
}
span.home-feabox-span2 {
    font-size: 40px;
}
span.home-feabox-p-span2 {
  margin-left: 10px !important;
  margin-top: 5px !important;
}
span.home-feabox-span3 {
    line-height: 1.5;
    font-size: 20px;
    font-weight: 300;
    font-style: italic;
}
  .home-nespresso-det .home-grani-inner {
    display: flex;
    flex-direction: column-reverse;
  }

  .ac-category-hero-overlay {
    min-height: 340px;
  }
}

/* =========================================================
   SMALL MOBILE <= 575px
========================================================= */
@media (max-width: 575px) {
  .home-services-grid {
    grid-template-columns: 1fr;
  }
}
