/* ==========================================================================
   AI SEARCH
   Porting in CSS del layout Nuxt (assets/css/ai-search.scss + gli stili dei
   componenti Ai, Product e Article). Le variabili SASS sono state risolte
   nelle variabili CSS del sito (style.css) o nei token locali qui sotto,
   i mixin respond-below/above nelle rispettive media query:

     respond-below('mobile-xs') -> max-width:  639px
     respond-below('mobile')    -> max-width:  767px
     respond-below('tablet')    -> max-width: 1023px
     respond-below('desktop')   -> max-width: 1279px
     respond-above('mobile')    -> min-width:  768px
     respond-above('tablet')    -> min-width: 1024px
   ========================================================================== */

:root {
  /* token della palette Nuxt non presenti in style.css */
  --ai-black: #1d1d1d;
  --ai-grey: #6c757d;
  --ai-light-grey: #fafafa;
  --ai-white: #ffffff;
  /* altezza della navbar sticky, valorizzata da ai-search.js */
  --ai-navbar-height: 0px;
}

/* --------------------------------------------------------------------------
   SEZIONE
   -------------------------------------------------------------------------- */

.section-ai-search {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  background-repeat: no-repeat;
  position: relative;
  font-family: var(--text);
  color: var(--ai-black);
}

.section-ai-search .heading {
  font-weight: 700;
  text-transform: uppercase;
  color: var(--ai-grey);
}

.section-ai-search h1 {
  font-family: 'Roboto', sans-serif;
  font-size: 36px;
  font-weight: 700;
  line-height: 120%;
  color: var(--ai-black);
  margin-bottom: 0;
}

.section-ai-search h1 b {
  color: var(--blue);
}

@media (min-width: 1024px) {
  .section-ai-search h1 {
    font-size: 64px;
    line-height: 120%;
  }
}

.section-ai-search:has(.has-results) .reset-search {
  display: flex;
}

/* --------------------------------------------------------------------------
   CONTAINER
   -------------------------------------------------------------------------- */

.ai-search-container {
  min-height: calc(100vh - var(--ai-navbar-height));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 0 20px;
  width: 100%;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-search-container.has-results {
  padding: 84px 20px 0;
  justify-content: space-between;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (max-width: 767px) {
  .ai-search-container.has-results {
    padding: 40px 20px 0;
  }
}

/* --------------------------------------------------------------------------
   LAYOUT INPUT
   -------------------------------------------------------------------------- */

.ai-content-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 0 100px;
}

.ai-input-wrapper {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  justify-content: center;
  width: 100%;
  max-width: 900px;
  text-align: center;
  margin-bottom: 2.3em;
}

@media (max-width: 1023px) {
  .ai-input-wrapper {
    margin-bottom: 2rem;
  }
}

.ai-input-wrapper .search-title.heading {
  font-size: 16px;
}

.ai-input-wrapper h1.search-title {
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

@media (min-width: 1024px) {
  .ai-input-wrapper h1.search-title {
    margin-bottom: 1.25rem;
  }
}

/* stato "con risposta": la barra di ricerca diventa sticky a fondo pagina */
.has-results .search-title {
  display: none;
}

.has-results .ai-content-layout {
  position: sticky;
  bottom: 0;
  width: 100%;
  z-index: 10;
  background: linear-gradient(to bottom, transparent, var(--ai-white) 30%, var(--ai-white) 100%);
  padding: 15px 15px 60px;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  margin: 0;
  pointer-events: none;
}

@media (max-width: 1279px) {
  .has-results .ai-content-layout {
    padding: 15px 15px 40px;
  }
}

.has-results .ai-input-wrapper {
  margin-top: 5rem;
  margin-bottom: 0;
  max-width: 800px;
  pointer-events: all;
}

.has-results .ai-input-group {
  margin: 0 auto;
  width: 100%;
}

/* --------------------------------------------------------------------------
   CAMPO DI RICERCA
   -------------------------------------------------------------------------- */

.ai-input-group {
  display: flex;
  padding: 0 0.75rem;
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  /* Quasi opaco: il campo resta sopra la risposta che scorre, e vedere il
     testo passare in trasparenza distrae. */
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid var(--ai-white);
  box-shadow: 0 4px 30px rgba(29, 29, 29, 0.1);
  /* riga singola: i bottoni restano centrati sul testo (vedi .is-multiline) */
  align-items: center;
  gap: 1.5rem;
}

@media (max-width: 1023px) {
  .ai-input-group {
    gap: 0.5rem;
  }
}

.ai-input-group input,
.ai-input-group textarea {
  width: 100%;
  background: transparent;
  border: none;
  box-shadow: none !important;
  padding: 1.3rem;
  font-size: 1.25rem;
  color: var(--ai-black);
}

.ai-input-group input:focus,
.ai-input-group textarea:focus {
  box-shadow: none !important;
  outline: none !important;
}

@media (max-width: 1023px) {
  .ai-input-group input,
  .ai-input-group textarea {
    padding: 1rem;
  }

  .ai-input-group input {
    font-size: 1rem;
  }
}

.ai-input-group textarea {
  display: block;
  resize: none;
  overflow-y: auto;
  line-height: 1.4;
  font-family: inherit;
  /* cresce con la query (l'altezza la imposta il JS): qui il tetto oltre il
     quale compare lo scroll, più basso su mobile per non occupare lo schermo */
  max-height: 200px;
  box-sizing: border-box;
}

@media (max-width: 1023px) {
  .ai-input-group textarea {
    font-size: 1rem;
    /* a campo vuoto (rows="1") è su una riga sola: il placeholder viene
       troncato con i puntini invece di andare a capo. Il nowrap viene tolto
       al focus / quando il campo cresce (.is-multiline) così il testo digitato
       può andare a capo */
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow-x: hidden;
  }

  .ai-input-group textarea:focus {
    white-space: pre-wrap;
    overflow-x: auto;
  }
}

/* campo cresciuto: i bottoni scendono in basso, allineati all'ultima riga di
   testo grazie all'offset pari al padding inferiore della textarea */
.ai-input-group.is-multiline {
  align-items: flex-end;
}

.ai-input-group.is-multiline .ai-input-actions {
  margin-bottom: 1.5rem;
}

.ai-input-group.is-multiline textarea {
  white-space: pre-wrap;
  overflow-x: auto;
}

.ai-input-group span {
  display: block;
  visibility: hidden;
  overflow: hidden;
  color: var(--ai-white);
  transition: all 0.3s ease-in-out;
}

.ai-input-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ai-input-group .submit-search {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  line-height: 100%;
  border-radius: 1.2rem;
  background: var(--blue);
  border: 0;
  padding: 10px;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  font-weight: 700;
  transition: all 0.3s ease-in-out;
}

.ai-input-group .submit-search img {
  margin: 0 8px;
  width: 25px;
  height: 25px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  transition: all 0.3s ease-in-out;
}

.ai-input-group .submit-search:hover {
  width: 150px;
  border-radius: 1.2rem;
  background: var(--ai-grey);
  transition: all 0.3s ease-in-out;
}

.ai-input-group .submit-search:hover img {
  margin: 0 8px 0 0;
  transition: all 0.3s ease-in-out;
}

.ai-input-group .submit-search:hover span {
  visibility: visible;
  transition: all 0.3s ease-in-out;
}

.ai-input-group:focus-within {
  border-color: var(--blue);
  box-shadow: 0 10px 30px rgba(0, 148, 207, 0.1);
  background: var(--ai-white);
}

.ai-input-group:focus-within .submit-search {
  width: 150px;
  border-radius: 1.2rem;
  transition: all 0.3s ease-in-out;
}

.ai-input-group:focus-within .submit-search:hover {
  background: var(--ai-grey);
}

.ai-input-group:focus-within .submit-search img {
  margin: 0 8px 0 0;
  transition: all 0.3s ease-in-out;
}

.ai-input-group:focus-within .submit-search span {
  visibility: visible;
  transition: all 0.3s ease-in-out;
}

@media (max-width: 1023px) {
  .ai-input-group .submit-search,
  .ai-input-group:focus-within .submit-search {
    padding: 5px;
    width: 35px;
    height: 35px;
  }

  .ai-input-group .submit-search img,
  .ai-input-group:focus-within .submit-search img {
    width: 20px;
    height: 20px;
    margin: 0;
  }

  .ai-input-group .submit-search span,
  .ai-input-group:focus-within .submit-search span {
    display: none;
  }

  .ai-input-group .submit-search:hover,
  .ai-input-group:focus-within .submit-search {
    width: 35px;
    border-radius: 50%;
  }

  .ai-input-group .submit-search:hover img {
    margin: 0;
  }

  .ai-input-group .submit-search:hover span {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   BOTTONE RIPRISTINA
   -------------------------------------------------------------------------- */

.reset-search {
  display: none;
  align-items: center;
  justify-content: flex-start;
  overflow: hidden;
  line-height: 100%;
  border-radius: 1.2rem;
  background: var(--ai-white);
  border: 2px solid var(--blue);
  padding: 10px;
  width: 50px;
  height: 50px;
  flex-shrink: 0;
  font-weight: 500;
  transition: all 0.3s ease-in-out;
}

.reset-search img {
  position: relative;
  left: 2px;
  width: 25px;
  height: 25px;
  object-fit: contain;
  transition: all 0.3s ease-in-out;
}

.reset-search span {
  margin-left: 8px;
  display: block;
  visibility: hidden;
  overflow: hidden;
  color: var(--ai-white);
  transition: all 0.3s ease-in-out;
}

.reset-search:hover,
.reset-search:focus-within {
  width: 130px;
  border-radius: 1.2rem;
  border-color: var(--ai-grey);
  background: var(--ai-grey);
  transition: all 0.3s ease-in-out;
}

.reset-search:hover img,
.reset-search:focus-within img {
  filter: brightness(0) invert(1);
  transition: all 0.3s ease-in-out;
}

.reset-search:hover span,
.reset-search:focus-within span {
  visibility: visible;
  transition: all 0.3s ease-in-out;
}

@media (max-width: 1023px) {
  .reset-search {
    padding: 5px;
    width: 35px;
    height: 35px;
  }

  .reset-search img {
    width: 21px;
    height: 21px;
    position: static;
  }

  .reset-search span {
    display: none;
  }

  .reset-search:hover,
  .reset-search:focus-within {
    width: 35px;
    border-radius: 1.2rem;
  }

  .reset-search:hover img,
  .reset-search:focus-within img {
    margin: 0;
  }

  .reset-search:hover span,
  .reset-search:focus-within span {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   RICERCHE SUGGERITE
   -------------------------------------------------------------------------- */

.suggested-searches-wrapper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  margin: auto;
}

.suggested-searches-wrapper .w-full {
  width: 100%;
}

.suggested-searches-wrapper .suggested-searches {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  transition: all 0.4s ease;
}

@media (max-width: 1023px) {
  .suggested-searches-wrapper .suggested-searches {
    gap: 8px;
  }
}

.suggested-searches-wrapper .heading {
  font-size: 16px;
}

.suggested-card {
  /* Completamente opaca, bordo compreso: la pill è sticky sopra la risposta. */
  background: var(--ai-white);
  border: 1px solid #cce9f5;
  border-radius: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  padding: 1rem;
  gap: 12px;
  flex: 0 0 auto;
  box-shadow: 0 4px 20px rgba(29, 29, 29, 0.05);
}

.suggested-card:hover {
  background: var(--ai-white);
  transform: translateY(-5px);
  border-color: var(--blue);
  box-shadow: 0 10px 20px rgba(0, 148, 207, 0.1);
}

.suggested-card p {
  color: var(--ai-black);
  font-weight: 500;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 120%;
  text-align: left;
  white-space: nowrap;
}

.suggested-card img {
  height: 20px;
  object-fit: contain;
}

@media (max-width: 1023px) {
  .suggested-card {
    align-items: center;
    padding: 0.5rem;
    gap: 8px;
  }

  .suggested-card:hover {
    transform: translateY(0);
  }

  .suggested-card p {
    font-size: 14px;
    line-height: 100%;
  }
}

.has-results .suggested-searches-wrapper {
  overflow: visible;
  margin: 0 auto;
  justify-content: flex-start;
  padding-top: 20px;
  transition: all 0.4s ease;
  pointer-events: all;
}

.has-results .suggested-searches-wrapper .suggested-searches {
  gap: 8px;
  justify-content: flex-start;
  transition: all 0.4s ease;
}

@media (max-width: 767px) {
  .has-results .suggested-searches-wrapper {
    display: none;
  }
}

.has-results .suggested-card {
  padding: 0.5rem;
  gap: 8px;
}

.has-results .suggested-card p {
  font-size: 14px;
}

.has-results .suggested-card img {
  height: 16px;
}

/* --------------------------------------------------------------------------
   RISPOSTA
   -------------------------------------------------------------------------- */

.ai-response-wrapper {
  opacity: 0;
  height: fit-content;
  transform: translateY(20px);
  max-width: 800px;
  width: 100%;
  transition: all 0.5s ease;
}

.has-results .ai-response-wrapper {
  display: flex !important;
  flex-direction: column;
  gap: 24px;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.3s ease;
  animation: aiSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-question-card {
  background: var(--blue);
  border: none;
  border-radius: 12px 12px 0px 12px;
  max-width: 70%;
  width: fit-content;
  margin: 0 0 0 auto;
  padding: 0.75rem 1rem;
}

@media (min-width: 768px) {
  .ai-question-card {
    padding: 0.75rem 1.25rem;
  }
}

.ai-question-card p {
  color: var(--ai-white);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 0;
}

.ai-response-card {
  background-color: var(--ai-light-grey);
  border: none;
  border-radius: 12px 12px 12px 0px;
  width: 100%;
  overflow: hidden;
  padding: 2rem 1.25rem;
}

@media (min-width: 768px) {
  .ai-response-card {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
}

@media (min-width: 1024px) {
  .ai-response-card {
    padding-right: 6rem;
    padding-left: 2.5rem;
  }
}

.ai-response-card .video-container {
  margin: 20px 0;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(29, 29, 29, 0.1);
  background-color: var(--ai-black);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ai-response-card .video-container iframe {
  animation: aiFadeIn 0.3s ease-in-out;
}

.ai-answer-videos {
  margin-top: 1rem;
}

.error-message {
  color: var(--blue);
}

/* --------------------------------------------------------------------------
   STATI DI CARICAMENTO
   -------------------------------------------------------------------------- */

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  animation: aiPulse 1.5s infinite ease-in-out;
}

.ai-loading {
  display: flex;
  align-items: center;
  padding: 10px 0;
}

.loading-phrase {
  margin-left: 0.5rem;
  font-size: 0.9rem;
  transition: opacity 0.4s ease;
}

.ai-stream-indicator {
  display: flex;
  align-items: center;
  margin-top: 1.5rem;
  color: var(--ai-grey);
}

.ai-stream-indicator span {
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

/* --------------------------------------------------------------------------
   DOMANDE SUGGERITE (post risposta)
   -------------------------------------------------------------------------- */

.ai-next-questions {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--ai-grey);
  border: 1px solid rgba(0, 148, 207, 0.1);
  border-radius: 0.75rem;
}

.ai-next-questions h4 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--ai-white);
}

.ai-next-questions h4 img {
  user-select: none;
}

.ai-next-questions .question-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.ai-next-questions .question-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  background: var(--ai-white);
  border: 1px solid var(--blue);
  border-radius: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s ease-in-out;
}

.ai-next-questions .question-btn:hover {
  border-color: var(--blue);
  color: var(--blue);
  transition: all 0.2s ease-in-out;
}

/* --------------------------------------------------------------------------
   FONTI
   -------------------------------------------------------------------------- */

.ai-sources {
  margin-top: 1.25rem;
}

.ai-sources .sources-heading {
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.ai-sources .sources-list {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ai-sources .source-item {
  display: flex;
}

.ai-sources .source-link {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.5rem;
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--ai-light-grey);
  border-radius: 0.5rem;
  background-color: var(--ai-white);
  box-shadow: 0 0px 10px rgba(29, 29, 29, 0.05);
  color: var(--ai-black);
  transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.ai-sources .source-link:hover {
  border-color: var(--blue);
}

.ai-sources .source-link img {
  position: relative;
  top: 3px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.ai-sources .source-link span {
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   TESTO DELLA RISPOSTA (markdown)
   -------------------------------------------------------------------------- */

.ai-answer-text h2 {
  font-size: 28px;
  font-weight: 700;
  line-height: 120%;
  color: var(--ai-black);
  margin-bottom: 1rem;
  font-family: 'Google Sans Flex', 'Roboto', sans-serif;
}

.ai-answer-text h3 {
  font-size: 22px;
  font-weight: 700;
  line-height: 120%;
  color: var(--ai-black);
  margin: 1rem 0;
  font-family: 'Google Sans Flex', 'Roboto', sans-serif;
}

.ai-answer-text h4 {
  font-size: 18px;
  font-weight: 700;
  line-height: 120%;
  color: var(--ai-black);
  margin: 1rem 0;
  font-family: 'Google Sans Flex', 'Roboto', sans-serif;
}

@media (max-width: 639px) {
  .ai-answer-text h2 {
    font-size: 20px;
  }

  .ai-answer-text h3 {
    font-size: 18px;
  }

  .ai-answer-text h4 {
    font-size: 16px;
  }
}

.ai-answer-text p {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 1rem;
}

.ai-answer-text p:last-child {
  margin-bottom: 0;
}

.ai-answer-text ul {
  list-style: disc;
  padding-left: 40px;
  margin-bottom: 1rem;
}

.ai-answer-text ol {
  list-style: decimal;
  padding-left: 40px;
  margin-bottom: 1rem;
}

.ai-answer-text li {
  font-size: 18px;
  margin-bottom: 0.5rem;
}

.ai-answer-text li::marker {
  color: var(--blue);
  font-weight: 700;
  font-size: 20px;
}

.ai-answer-text ol li::marker {
  font-size: inherit;
}

@media (max-width: 639px) {
  .ai-answer-text p,
  .ai-answer-text li {
    font-size: 16px;
  }

  .ai-answer-text ul,
  .ai-answer-text ol {
    padding-left: 24px;
  }
}

.ai-answer-text a {
  color: var(--blue);
  text-decoration: underline;
  transition: all 0.2s ease-in-out;
}

.ai-answer-text a:hover {
  color: var(--ai-black);
  transition: all 0.2s ease-in-out;
}

.ai-answer-text hr {
  margin: 2.5rem 0;
  border-color: var(--ai-grey);
  height: 1px;
}

@media (max-width: 639px) {
  .ai-answer-text hr {
    margin: 2rem 0;
  }
}

.ai-answer-text > img,
.ai-answer-text p > img,
.ai-answer-text li > img {
  max-width: 100%;
  max-height: 400px;
  margin: 2rem 0;
  border-radius: 12px;
  object-fit: cover;
  overflow: hidden;
}

@media (max-width: 767px) {
  .ai-answer-text > img,
  .ai-answer-text p > img,
  .ai-answer-text li > img {
    aspect-ratio: 3 / 4;
  }
}

/* immagini: segnaposto shimmer finché il preload non è completo */
.img-placeholder {
  width: 100%;
  min-height: 220px;
  margin: 2rem 0;
  border-radius: 12px;
  /* grigio pieno, più scuro del fondo della card così il segnaposto si legge
     come elemento a sé (equivale a darken(#fafafa, 9%)) */
  background-color: #e3e3e3;
  /* banda chiara che scorre: morbida, senza bordi netti */
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 20%,
    rgba(255, 255, 255, 0.55) 50%,
    rgba(255, 255, 255, 0) 80%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: aiShimmer 2.4s infinite ease-in-out;
}

.img-revealed {
  max-width: 100%;
  max-height: 400px;
  margin: 2rem 0;
  border-radius: 12px;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.img-revealed.img-loaded {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   SCHEDA PRODOTTO
   -------------------------------------------------------------------------- */

.product-card {
  display: flex;
  flex-direction: column;
  border: 0;
  text-decoration: none;
  color: var(--ai-black);
  transition: all 0.3s ease-in-out;
}

.product-card:hover {
  text-decoration: none;
}

.product-card:hover .product-card__name {
  color: var(--blue);
  transition: all 0.3s ease-in-out;
}

.product-card:hover .product-card__image {
  box-shadow: 0 0px 24px rgba(0, 54, 75, 0.18);
}

.product-card:hover .product-card__image-wrapper {
  border-color: var(--blue);
}

.product-card__image-wrapper {
  width: 100%;
  box-shadow: 0 0px 14px rgba(0, 54, 75, 0.08);
  border: 1px solid transparent;
}

.product-card__image {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  border-radius: 7px;
  background-color: var(--blue);
  transition: box-shadow 0.3s ease-in-out;
}

.product-card__image--fallback {
  padding: 70px 40px;
  background-color: var(--light-blue);
}

.product-card__body {
  padding: 12px 10px;
}

.product-card__category {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue);
}

.product-card__name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  text-transform: none;
  color: inherit;
  line-height: 130%;
  font-family: var(--text);
  transition: all 0.3s ease-in-out;
}

.product-card__description {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 150%;
  color: var(--ai-grey);
  /* clamp per mantenere le card della stessa altezza nello slider */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   SCHEDA BRAND
   Nessuna immagine: la scheda è solo testo, quindi il peso visivo è dato
   dal bordo e dall'etichetta.
   -------------------------------------------------------------------------- */

.brand-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--ai-white);
  border: 1px solid rgba(0, 54, 75, 0.08);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ai-black);
  box-shadow: 0 2px 10px rgba(0, 54, 75, 0.04);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.brand-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 54, 75, 0.14);
  border-color: rgba(0, 148, 207, 0.4);
  text-decoration: none;
}

.brand-card:hover .brand-card__title {
  color: var(--blue);
}

.brand-card:hover .brand-card__cta {
  gap: 10px;
  color: var(--blue);
}

.brand-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px 20px;
}

.brand-card__label {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background-color: var(--light-blue);
  border-radius: 999px;
}

.brand-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 130%;
  text-transform: none;
  color: inherit;
  font-family: var(--text);
  transition: color 0.3s ease-in-out;
}

.brand-card__description {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 155%;
  color: var(--ai-grey);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.brand-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-black);
  transition: gap 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* --------------------------------------------------------------------------
   SCHEDA ARTICOLO
   -------------------------------------------------------------------------- */

.article-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--ai-white);
  border: 1px solid rgba(0, 54, 75, 0.08);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--ai-black);
  box-shadow: 0 2px 10px rgba(0, 54, 75, 0.04);
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(0, 54, 75, 0.14);
  border-color: rgba(0, 148, 207, 0.4);
  text-decoration: none;
}

.article-card:hover .article-card__image {
  transform: scale(1.05);
}

.article-card:hover .article-card__title {
  color: var(--blue);
}

.article-card:hover .article-card__cta {
  gap: 10px;
  color: var(--blue);
}

.article-card__image-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background-color: var(--light-blue);
}

.article-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.4s ease-in-out;
}

.article-card__image--fallback {
  object-fit: contain;
  padding: 48px 40px;
  background-color: var(--light-blue);
}

.article-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px 20px 22px;
}

.article-card__category {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--blue);
  background-color: var(--light-blue);
  border-radius: 999px;
}

.article-card__title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 135%;
  text-transform: none;
  color: inherit;
  font-family: var(--text);
  transition: color 0.3s ease-in-out;
  /* titoli ad altezza prevedibile: le card restano allineate nello slider */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__description {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 155%;
  color: var(--ai-grey);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.article-card__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(0, 54, 75, 0.06);
  font-size: 13px;
  font-weight: 600;
  color: var(--ai-black);
  transition: gap 0.3s ease-in-out, color 0.3s ease-in-out;
}

/* --------------------------------------------------------------------------
   SLIDER (prodotti / brand / articoli)
   -------------------------------------------------------------------------- */

.product-slider,
.brand-slider,
.article-slider {
  position: relative;
}

.product-slider .swiper,
.brand-slider .swiper,
.article-slider .swiper {
  overflow: visible;
}

.product-slider .swiper-wrapper,
.brand-slider .swiper-wrapper,
.article-slider .swiper-wrapper {
  align-items: stretch;
}

.product-slider .swiper-wrapper .swiper-slide,
.brand-slider .swiper-wrapper .swiper-slide,
.article-slider .swiper-wrapper .swiper-slide {
  height: auto;
}

.product-slider .swiper-wrapper .swiper-slide > *,
.brand-slider .swiper-wrapper .swiper-slide > *,
.article-slider .swiper-wrapper .swiper-slide > * {
  height: 100%;
}

.product-slider__arrows-wrapper,
.brand-slider__arrows-wrapper,
.article-slider__arrows-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 32px;
}

.product-slider__arrows-wrapper:has(.swiper-button-lock),
.brand-slider__arrows-wrapper:has(.swiper-button-lock),
.article-slider__arrows-wrapper:has(.swiper-button-lock) {
  display: none;
}

.product-slider__arrow,
.brand-slider__arrow,
.article-slider__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue);
  cursor: pointer;
  transition: all 0.3s ease-in-out;
}

.product-slider__arrow:hover,
.brand-slider__arrow:hover,
.article-slider__arrow:hover {
  background: var(--blue);
  color: var(--ai-white);
}

.product-slider__arrow.swiper-button-disabled,
.brand-slider__arrow.swiper-button-disabled,
.article-slider__arrow.swiper-button-disabled {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.ai-products,
.ai-brands,
.ai-articles {
  margin: 2.5rem 0;
}

/* griglia usata quando le schede sono elencate invece che in slider */
.product-listing {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

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

/* --------------------------------------------------------------------------
   RIVELAZIONE PROGRESSIVA
   Sostituisce i binding :style inline dei componenti Vue.
   -------------------------------------------------------------------------- */

.ai-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.ai-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.ai-reveal--fade {
  transform: none;
  transition: opacity 0.8s ease;
}

/* --------------------------------------------------------------------------
   ANIMAZIONI
   -------------------------------------------------------------------------- */

@keyframes aiShimmer {
  0% {
    background-position: -150% 0;
  }

  100% {
    background-position: 150% 0;
  }
}

@keyframes aiFadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes aiSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes aiPulse {
  0%,
  100% {
    opacity: 0.3;
    transform: scale(0.8);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}
