:root {
  --dark-grey: #333;
  --light-grey: #f4f4f4;
  --primary-bg-color: #262626;
  --secondary-bg-color: #383838;
  --text-color-light: #f0f0f0;
  --text-color-dark: #cccccc;
  --accent-orange: #ff7800;
  --accent-orange-hover: #e06a00;
  --white: #ffffff;
  --primary-dark-grey: #262626;
  --primary-light-grey: #cccccc;
  --primary-white: #ffffff;
  --secondary-grey: #383838;
}

/* Reset base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background-color: var(--dark-grey);
  color: white;
  line-height: 1.6;
  overflow-x: hidden;
}

.hero-content h3 {
  position: relative;
  z-index: 1500;
}

a:focus,
button:focus,
.add-to-cart-btn-v2:focus {
  outline: 2px solid var(--accent-orange);
  outline-offset: 2px;
}

hr {
  margin: 30px 0;
  border: none;
  height: 2px;
  background-color: #ccc;
}

/* Header & Menu */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--dark-grey);
  border-bottom: 1px solid #444;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

.nav-menu {
  display: none;
  flex-direction: column;
  width: 100%;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--dark-grey);
  list-style: none;
  padding: 1rem 0;
  border-bottom: 1px solid #444;
  z-index: auto;
}

.nav-menu.active {
  display: flex;
  z-index: 1501;
}

.nav-menu li {
  text-align: center;
  margin: 10px 0;
}

.nav-menu a {
  color: white;
  text-decoration: none;
  padding: 5px 10px;
  display: block;
}

.hamburger-button {
  display: block;
  cursor: pointer;
  border: none;
  background: transparent;
}

.bar {
  width: 25px;
  height: 3px;
  background-color: white;
  margin: 5px 0;
}

/* Sottomenù nascosto di default */
.submenu {
  display: none;
  flex-direction: column;
  position: static;
  width: 100%;
  list-style-type: none;
  margin: 0;
  padding-left: 1rem;
  background-color: #444;
  z-index: 999;
}
.submenu-toggle {
  display: block;
  padding: 5px 10px;
  color: white;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}
.nav-menu a,
.submenu-toggle {
  font-size: 1rem;
  font-weight: normal;
}
.submenu li {
  margin: 0;
}
.submenu a {
  padding: 10px;
  border-top: 1px solid #555;
  color: white;
  text-align: left;
}
.nav-menu li.active .submenu {
  display: flex;
  flex-direction: column;
}
.arrow {
  display: inline-block;
  margin-left: 5px;
  transition: transform 0.3s ease;
}
/* Rotazione quando il genitore ha classe active */
.has-submenu.active .arrow {
  transform: rotate(180deg);
}

/* Hero Section */
.hero-home {
  position: relative;
  width: 100%;
  height: 100vh;
  background-image: url("https://dolcepixel.it/modules/tvcmsslider/views/img/b7ef1c0cd05aab1b4e42_biscotti-personalizzati-onl.jpg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  padding: 2rem;
  overflow: hidden;
}

.hero-content {
  text-align: center;
  margin: auto;
  max-width: 90%;
  padding-right: 0;
}

.hero-home h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: 1rem;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-home h2 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-button {
  background-color: var(--accent-orange);
  color: white;
  border: none;
  padding: 12px 25px;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s ease;
}

.hero-button:hover {
  background-color: var(--accent-orange-hover);
}

/* Main Content */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 2rem;
}

.text-div,
.banner-div {
  width: 90%;
  margin: 0 auto;
}

.banner-div {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.banner {
  background-color: #555;
  padding: 1.5rem;
  text-align: center;
}

/* Footer */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem;
  background-color: #222;
  border-top: 1px solid #444;
}

.footer-column {
  width: 90%;
  margin: 1rem 0;
}

.footer-column h3 {
  margin-bottom: 1rem;
}

.footer-column ul {
  list-style: none;
}

.footer-column a {
  color: white;
  text-decoration: none;
}

/* Media Queries Desktop */

/* DA NOTARE CHE: 
   Se non clicco sulla voce di menù che apre il sottomenù, hover si attiva al passaggio
   del mouse e si disattiva quando il mouse esce dall'area; se invece clicco sulla voce
   di menù che apre il sottomenù, quando il sottomenù è aperto a causa dell'hover, allora
   a quel punto anche spostando la freccia il sottomenù rimane attivo! E se riclicco, torna
   al regolare funzionamento hover-noHover.
*/

@media (min-width: 769px) {
  .header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .hamburger-button {
    display: none; /* Nasconde l'hamburger su desktop */
  }

  .nav-menu {
    display: flex;
    flex-direction: row;
    width: auto;
    position: static;
    background-color: transparent;
    border: none;
    padding: 0;
  }

  .nav-menu li {
    margin: 0 10px;
  }

  .has-submenu {
    position: relative; /* serve come riferimento per il submenu */
  }

  .submenu {
    position: absolute;
    top: 100%; /* subito sotto il genitore */
    left: 0;
    background-color: #222; /* o quello che preferisci */
    display: none;
    flex-direction: column;
    min-width: 200px;
    z-index: 999;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  }

  .has-submenu:hover .submenu {
    display: flex;
  }

  .has-submenu:hover .arrow {
    transform: rotate(180deg);
  }
  /* Sottomenù non indentato */
  .submenu {
    padding-left: 0 !important; /* contrasta il padding-left: 1rem; della regola generale */
  }

  .hero-content {
    text-align: right;
    margin-left: auto;
    max-width: 50%;
    padding-right: 5%;
  }

  .hero-home h2 {
    font-size: 2rem;
  }

  .main-content {
    flex-direction: row;
    justify-content: space-between;
  }

  .text-div {
    width: 70%;
  }

  .banner-div {
    width: 25%;
  }

  .footer {
    flex-direction: row;
    text-align: left;
  }

  .footer-column {
    width: auto;
  }

  a {
    color: #ffa500;
  }

  a:hover {
    color: #ff8c00;
  }
}

/* Ecommerce Section */
.ecommerce-section-v2 {
  background-color: var(--primary-bg-color);
  padding: 3rem 2rem;
  text-align: center;
  border-radius: 10px;
  margin: 2rem auto;
  max-width: 1200px;
}

.ecommerce-header-v2 {
  margin-bottom: 2.5rem;
}

.ecommerce-header-v2 h2 {
  font-size: 2.8rem;
  color: white;
  margin-bottom: 0.8rem;
  font-weight: 700;
}

.ecommerce-header-v2 p {
  font-size: 1.2rem;
  color: var(--text-color-dark);
}

.product-grid-v2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-content: center;
}

.product-card-v2 {
  background-color: var(--secondary-bg-color);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card-v2:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.product-image-v2 {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
}

.product-info-v2 {
  padding: 1.5rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title-v2 {
  font-size: 1.5rem;
  color: white;
  margin-bottom: 0.6rem;
  font-weight: 600;
}

.product-description-v2 {
  font-size: 0.95rem;
  color: var(--text-color-dark);
  margin-bottom: 1.2rem;
  line-height: 1.5;
  flex-grow: 1;
}

.product-price-v2 {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--accent-orange);
  margin-bottom: 1.5rem;
  align-self: flex-end;
}

.add-to-cart-btn-v2 {
  background-color: var(--accent-orange);
  color: white;
  border: none;
  padding: 1rem 1.8rem;
  font-size: 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  width: 100%;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.add-to-cart-btn-v2:hover {
  background-color: var(--accent-orange-hover);
}

@media (max-width: 768px) {
  /* Mostra sottomenù al click su mobile*/
  .nav-menu li.active .submenu {
    display: flex;
    position: static; /* nel flusso */
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  .ecommerce-section-v2 {
    padding: 2rem 1rem;
  }

  .ecommerce-header-v2 h2 {
    font-size: 2.2rem;
  }

  .product-card-v2 {
    margin-left: auto;
    margin-right: auto;
    max-width: 350px;
  }
}

/* Carosello immagini */
.carousel-container {
  position: relative;
  max-width: 800px;
  margin: 2rem auto;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.carousel-slide {
  display: none;
  width: 100%;
}

.carousel-slide img {
  width: 100%;
  height: auto;
  display: block;
}

.carousel-prev,
.carousel-next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  padding: 16px;
  margin-top: -22px;
  color: white;
  font-weight: bold;
  font-size: 20px;
  transition: 0.6s ease;
  user-select: none;
  background-color: rgba(0, 0, 0, 0.5);
  border: none;
}

.carousel-next {
  right: 0;
  border-radius: 3px 0 0 3px;
}

.carousel-prev {
  left: 0;
  border-radius: 0 3px 3px 0;
}

.carousel-prev:hover,
.carousel-next:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.carousel-dots {
  text-align: center;
  padding: 1rem 0;
  background-color: rgba(0, 0, 0, 0.3);
}

.dot {
  cursor: pointer;
  height: 15px;
  width: 15px;
  margin: 0 2px;
  background-color: #bbb;
  border-radius: 50%;
  display: inline-block;
  transition: background-color 0.6s ease;
}

.dot.active,
.dot:hover {
  background-color: #717171;
}

/* Footer a due colonne */
.site-pre-footer {
  background-color: var(--primary-dark-grey);
  color: var(--primary-light-grey);
  padding: 2rem;
}

.site-footer {
  background-color: var(--primary-dark-grey);
  color: var(--primary-light-grey);
  padding: 2rem;
  border-top: 1px solid #444;
}

.footer-column-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.footer-column {
  flex: 1;
  min-width: 200px;
  padding: 1rem;
  background-color: #444;
  border-radius: 5px;
}

.footer-column h3 {
  color: var(--primary-white);
  margin-bottom: 1rem;
  font-size: 1.2rem;
  border-bottom: 1px solid #666;
  padding-bottom: 0.5rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
}

.footer-column ul li {
  margin-bottom: 0.5rem;
}

.footer-column a {
  color: var(--primary-light-grey);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column a:hover {
  color: var(--primary-white);
}

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: #888;
}

@media (max-width: 768px) {
  .footer-column-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .footer-column {
    width: 90%;
    max-width: 400px;
    margin: 0.5rem 0;
  }
}

/* Sezione feedback stile Trustpilot */
.feedback-section {
  background-color: var(--secondary-grey);
  padding: 3rem 2rem;
  text-align: center;
  border-radius: 10px;
  margin: 2rem auto;
  max-width: 1200px;
}

.feedback-header h2 {
  font-size: 2.5rem;
  color: var(--primary-white);
  margin-bottom: 1rem;
}

.feedback-header p {
  font-size: 1.1rem;
  color: var(--primary-light-grey);
  margin-bottom: 1.5rem;
}

.trustpilot-link {
  color: #00b67a;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.trustpilot-link:hover {
  color: #008f5d;
}

.stars-rating {
  font-size: 2rem;
  color: gold;
  margin-bottom: 2rem;
}

.stars-rating .star.half {
  color: #ccc;
  position: relative;
  display: inline-block;
}

.stars-rating .star.half:before {
  content: "★";
  position: absolute;
  left: 0;
  width: 50%;
  overflow: hidden;
  color: gold;
}

.feedback-reviews-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.feedback-card {
  background-color: var(--primary-dark-grey);
  border-radius: 8px;
  padding: 1.5rem;
  text-align: left;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
  flex: 1;
  min-width: 280px;
  max-width: 350px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  border-bottom: 1px solid #555;
  padding-bottom: 0.5rem;
}

.reviewer-name {
  font-weight: bold;
  color: var(--primary-white);
  font-size: 1.1rem;
}

.review-stars {
  color: gold;
  font-size: 1.2rem;
}

.review-stars .star-icon.empty {
  color: #ccc;
}

.review-title {
  font-size: 1.25rem;
  color: var(--primary-white);
  margin-bottom: 0.8rem;
}

.review-text {
  font-size: 0.95rem;
  color: var(--primary-light-grey);
  margin-bottom: 1rem;
  flex-grow: 1;
}

.review-date {
  font-size: 0.85rem;
  color: #999;
  text-align: right;
  display: block;
  margin-top: auto;
}

@media (max-width: 768px) {
  .feedback-section {
    padding: 2rem 1rem;
  }

  .feedback-header h2 {
    font-size: 2rem;
  }

  .stars-rating {
    font-size: 1.8rem;
  }

  .feedback-card {
    max-width: 90%;
  }
}
