/* Font Plus Jakarta Sans: caricato con <link> + preconnect nell'<head> delle pagine (un @import qui lo scaricava solo dopo questo file, bloccando la pagina più a lungo). */

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Telefono: niente scorrimento orizzontale della pagina se un elemento
     sborda (clip non crea un contenitore di scroll: l'header sticky resta). */
  overflow-x: clip;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product card */
.shop-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.shop-card:hover {
  border-color: #bbf0d0;
  box-shadow: 0 10px 25px -8px rgba(26, 143, 76, 0.18);
  transform: translateY(-2px);
}

.shop-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: .625rem;
  background: #1a8f4c;
  color: #fff;
  font-weight: 600;
  font-size: .8125rem;
  padding: .55rem 1rem;
  border: 1px solid #157a41;
  cursor: pointer;
  transition: background .15s ease, transform .15s ease;
}
.shop-btn-primary:hover { background: #136b3a; }
.shop-btn-primary:disabled { opacity: .5; cursor: not-allowed; }

.shop-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  border-radius: .625rem;
  background: #fff;
  color: #1a8f4c;
  font-weight: 600;
  font-size: .8125rem;
  padding: .55rem 1rem;
  border: 1px solid #bbf0d0;
  cursor: pointer;
  transition: background .15s ease;
}
.shop-btn-secondary:hover { background: #f0fdf5; }

/* Logo marca sull'immagine della card prodotto (shop/includes/product-card.php). */
.shop-card-brand-logo {
  position: absolute;
  top: .5rem;
  left: .5rem;
  display: flex;
  align-items: center;
  padding: .25rem .4rem;
  border-radius: .375rem;
  background: rgba(255,255,255,.92);
  box-shadow: 0 1px 3px rgba(15,23,42,.12);
  pointer-events: none;
}
.shop-card-brand-logo img {
  display: block;
  height: 1.25rem;
  width: auto;
  max-width: 5.5rem;
  object-fit: contain;
}

.shop-badge-outofstock {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.shop-toast {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 60;
  background: #0f172a;
  color: #fff;
  padding: .75rem 1.1rem;
  border-radius: .75rem;
  font-size: .8125rem;
  font-weight: 500;
  box-shadow: 0 10px 25px rgba(0,0,0,.2);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.shop-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Categorie homepage: card con foto a tutta larghezza e sfumatura colore da sinistra */
.shop-cat-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 1.5rem;
  transition: transform .2s ease, box-shadow .2s ease;
}
.shop-cat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.15);
}
.shop-cat-photo {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center right;
}
.shop-cat-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, var(--fade-color, #e2dad7) 0%, var(--fade-color, #e2dad7) 38%, transparent 80%);
}

/* Pagine informative (condizioni, privacy, contatti, ...): card statica + tipografia testo */
.shop-info-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
}
.shop-prose { font-size: .875rem; line-height: 1.7; color: #334155; }
.shop-prose > * + * { margin-top: .85rem; }
.shop-prose h2 {
  margin-top: 1.75rem;
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
}
.shop-prose h2:first-child { margin-top: 0; }
.shop-prose h3 { margin-top: 1.25rem; font-size: .9rem; font-weight: 700; color: #0f172a; }
.shop-prose ul { list-style: disc; padding-left: 1.25rem; }
.shop-prose ul ul { list-style: circle; margin-top: .35rem; }
.shop-prose ol { list-style: decimal; padding-left: 1.25rem; }
.shop-prose li + li { margin-top: .35rem; }
.shop-prose strong { color: #0f172a; font-weight: 700; }
.shop-prose a { color: #1a8f4c; font-weight: 600; }
.shop-prose a:hover { text-decoration: underline; }
.shop-prose .shop-note {
  border-left: 3px solid #1a8f4c;
  background: #f0fdf5;
  border-radius: 0 .5rem .5rem 0;
  padding: .6rem .9rem;
  font-size: .8125rem;
}

/* FAQ: indice sezioni + accordion <details> */
.shop-faq-toc { display: flex; flex-wrap: wrap; gap: .5rem; }
.shop-prose .shop-faq-toc a {
  border: 1px solid #e2e8f0; border-radius: 9999px; padding: .3rem .8rem;
  font-size: .75rem; font-weight: 600; color: #475569; text-decoration: none;
}
.shop-prose .shop-faq-toc a:hover { border-color: #1a8f4c; color: #1a8f4c; text-decoration: none; }
.shop-faq-heading { scroll-margin-top: 9rem; }
.shop-faq-list { border: 1px solid #e2e8f0; border-radius: .75rem; overflow: hidden; }
.shop-faq-item + .shop-faq-item { border-top: 1px solid #e2e8f0; }
.shop-faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .85rem 1rem; cursor: pointer; list-style: none;
  font-weight: 700; color: #0f172a;
}
.shop-faq-item summary::-webkit-details-marker { display: none; }
.shop-faq-item summary::after {
  content: "+"; flex-shrink: 0; font-size: 1.1rem; line-height: 1; color: #1a8f4c; transition: transform .15s ease;
}
.shop-faq-item[open] summary::after { transform: rotate(45deg); }
.shop-faq-item summary:hover { background: #f8fafc; }
.shop-faq-item[open] summary { background: #f0fdf5; }
.shop-faq-answer { padding: .25rem 1rem 1rem; }
.shop-faq-answer > * + * { margin-top: .6rem; }

/* Banner consenso cookie */
.shop-cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  max-width: 44rem;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, 0.35);
}
.shop-switch { position: relative; display: inline-block; width: 2.25rem; height: 1.25rem; flex-shrink: 0; }
.shop-switch input { opacity: 0; width: 0; height: 0; }
.shop-switch span {
  position: absolute; inset: 0; cursor: pointer;
  background: #cbd5e1; border-radius: 9999px; transition: background .15s ease;
}
.shop-switch span::before {
  content: ""; position: absolute; left: .15rem; top: .15rem;
  width: .95rem; height: .95rem; background: #fff; border-radius: 9999px; transition: transform .15s ease;
}
.shop-switch input:checked + span { background: #1a8f4c; }
.shop-switch input:checked + span::before { transform: translateX(1rem); }
.shop-switch input:disabled + span { opacity: .6; cursor: not-allowed; }
.shop-prose a.shop-btn-primary { color: #fff; }
.shop-prose a.shop-btn-primary:hover,
.shop-prose a.shop-btn-secondary:hover { text-decoration: none; }

/* Colonne di link del footer (modificabili dal backoffice, v. includes/footer.php).
   Ogni <div> di primo livello è una colonna; altri blocchi occupano tutta la riga. */
.shop-footer-custom { display: grid; gap: 2rem; grid-template-columns: 1fr; font-size: .75rem; align-content: start; }
@media (min-width: 640px) { .shop-footer-custom { grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); } }
.shop-footer-custom > :not(div) { grid-column: 1 / -1; }
.shop-footer-custom h3, .shop-footer-custom h2, .shop-footer-custom h4 {
  margin: 0 0 .75rem; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #94a3b8;
}
.shop-footer-custom ul { list-style: none; margin: 0; padding: 0; }
.shop-footer-custom li + li { margin-top: .5rem; }
.shop-footer-custom p { margin: 0 0 .5rem; color: #94a3b8; line-height: 1.6; }
.shop-footer-custom li { color: #94a3b8; }
.shop-footer-custom a { color: #cbd5e1; transition: color .15s; }
.shop-footer-custom a:hover { color: #fff; }
.shop-footer-custom strong { color: #e2e8f0; }
/* Riga dati aziendali in fondo al footer (modificabile) */
.shop-footer-bottom p { margin: 0; }
.shop-footer-bottom p + p { margin-top: .25rem; }
.shop-footer-bottom a { color: #94a3b8; }
.shop-footer-bottom a:hover { color: #fff; }
/* Anteprima nell'editor del backoffice (TinyMCE) */
body.shop-footer-preview.shop-footer-bottom { text-align: center; font-size: 11px; color: #64748b; }
body.shop-footer-preview.shop-footer-bottom > div { outline: none; }
body.shop-footer-preview { background: #0f172a !important; color: #cbd5e1; max-width: 1000px !important; padding: 1.5rem !important; }
body.shop-footer-preview > div { outline: 1px dashed #334155; outline-offset: 6px; }

/* Campi quantità con pulsanti − / + propri (carrello, scheda prodotto):
   niente freccette su/giù del browser dentro il campo. */
.shop-qty-input { -moz-appearance: textfield; appearance: textfield; }
.shop-qty-input::-webkit-outer-spin-button,
.shop-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------------------------------------------------------------------------
   Assistente automatico (shop/includes/chatbot.php, assets/js/chatbot.js).
   CSS scritto a mano: non dipende dal Tailwind compilato.
   --------------------------------------------------------------------------- */
.shop-chat { position: fixed; right: 1rem; bottom: 1rem; z-index: 65; font-size: .875rem; }
.shop-chat-toggle {
  display: flex; align-items: center; justify-content: center; width: 3.5rem; height: 3.5rem;
  border-radius: 9999px; background: #1a8f4c; color: #fff; border: 0; cursor: pointer;
  box-shadow: 0 10px 25px -8px rgba(15, 23, 42, .45); transition: background .15s, transform .15s;
}
.shop-chat-toggle:hover { background: #136b3a; transform: translateY(-1px); }
.shop-chat-toggle .shop-chat-icon-close, .shop-chat.is-open .shop-chat-toggle .shop-chat-icon-open { display: none; }
.shop-chat.is-open .shop-chat-toggle .shop-chat-icon-close { display: block; }
.shop-chat-panel {
  position: absolute; right: 0; bottom: 4.25rem; width: min(22rem, calc(100vw - 2rem));
  height: min(32rem, calc(100vh - 7rem)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid #e2e8f0; border-radius: 1rem; overflow: hidden;
  box-shadow: 0 20px 45px -12px rgba(15, 23, 42, .35);
}
.shop-chat-panel[hidden] { display: none; }
.shop-chat-head { display: flex; align-items: center; justify-content: space-between; padding: .75rem 1rem; background: #1a8f4c; color: #fff; }
.shop-chat-title { font-weight: 700; margin: 0; }
.shop-chat-sub { margin: 0; font-size: .7rem; opacity: .85; }
.shop-chat-x { background: transparent; border: 0; color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 .25rem; }
.shop-chat-log { flex: 1; overflow-y: auto; padding: .75rem; background: #f8fafc; display: flex; flex-direction: column; gap: .5rem; }
.shop-chat-msg { max-width: 85%; padding: .5rem .75rem; border-radius: .875rem; line-height: 1.4; word-wrap: break-word; }
.shop-chat-bot { align-self: flex-start; background: #fff; border: 1px solid #e2e8f0; color: #1e293b; border-bottom-left-radius: .25rem; }
.shop-chat-user { align-self: flex-end; background: #1a8f4c; color: #fff; border-bottom-right-radius: .25rem; }
.shop-chat-typing { color: #94a3b8; }
.shop-chat-link { align-self: flex-start; font-weight: 600; color: #1a8f4c; text-decoration: none; padding: 0 .25rem; }
.shop-chat-link:hover { text-decoration: underline; }
.shop-chat-chips { display: flex; flex-wrap: wrap; gap: .375rem; }
.shop-chat-chip { border: 1px solid #1a8f4c33; background: #f0fdf5; color: #136b3a; border-radius: 9999px; padding: .3rem .7rem; font-size: .75rem; font-weight: 600; cursor: pointer; text-align: left; }
.shop-chat-chip:hover { background: #dcfce7; }
.shop-chat-form { display: flex; gap: .5rem; padding: .625rem; border-top: 1px solid #e2e8f0; background: #fff; }
.shop-chat-form input { flex: 1; min-width: 0; border: 1px solid #e2e8f0; border-radius: .625rem; padding: .5rem .75rem; font-size: .875rem; }
.shop-chat-form input:focus { outline: none; border-color: #1a8f4c; box-shadow: 0 0 0 3px #1a8f4c22; }
.shop-chat-form button { display: flex; align-items: center; justify-content: center; width: 2.5rem; border: 0; border-radius: .625rem; background: #1a8f4c; color: #fff; cursor: pointer; }
.shop-chat-form button:hover { background: #136b3a; }
.shop-chat-note { margin: 0; padding: 0 .75rem .5rem; font-size: .68rem; color: #94a3b8; background: #fff; }
.shop-chat-note a { color: #1a8f4c; }
@media print { .shop-chat { display: none; } }

/* Selettore colore nella card prodotto (product-card.php, shop.js, 2026-11-20).
   Classi proprie (non Tailwind): niente da ricompilare in tailwind.css. */
.shop-card-price { display: contents; }
.shop-colors { display: flex; flex-direction: column; gap: .35rem; margin-top: .1rem; }
.shop-colors-label { font-size: 11px; color: #64748b; line-height: 1.2; }
.shop-colors-label b { color: #0f172a; font-weight: 600; text-transform: capitalize; }
.shop-swatches { display: flex; flex-wrap: wrap; gap: .35rem; }
.shop-swatch {
  width: 1.4rem; height: 1.4rem; border-radius: 9999px; padding: 0;
  background: var(--sw, #e2e8f0);
  border: 1px solid rgba(15, 23, 42, .18);
  box-shadow: 0 0 0 2px #fff;
  cursor: pointer; transition: box-shadow .12s ease, transform .12s ease;
}
.shop-swatch:hover { transform: scale(1.08); }
.shop-swatch.is-light { border-color: #cbd5e1; }
.shop-swatch.is-multi { background: conic-gradient(#dc2626, #facc15, #16a34a, #1d4ed8, #7c3aed, #dc2626); }
.shop-swatch.is-selected { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #1a8f4c; }
.shop-swatch-text {
  font-size: 11px; line-height: 1; padding: .3rem .5rem; border-radius: .5rem;
  border: 1px solid #cbd5e1; background: #fff; color: #334155; cursor: pointer;
  text-transform: capitalize; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.shop-swatch-text:hover { border-color: #1a8f4c; }
.shop-swatch-text.is-selected { border-color: #1a8f4c; background: #f0fdf5; color: #14532d; font-weight: 600; }
.shop-swatch.is-out, .shop-swatch-text.is-out { opacity: .45; }
.shop-color-select {
  width: 100%; font-size: 12px; padding: .35rem .5rem; border-radius: .5rem;
  border: 1px solid #cbd5e1; background: #fff; color: #0f172a; text-transform: capitalize;
}
.shop-swatch:focus-visible, .shop-swatch-text:focus-visible, .shop-color-select:focus-visible { outline: 2px solid #1a8f4c; outline-offset: 2px; }

/* Banner del carosello promozioni in home (shop/index.php, 2026-11-20):
   immagine sempre intera, riquadro 12:5 (formato consigliato 1200x500);
   con proporzioni diverse i bordi si riempiono con la stessa immagine sfocata. */
.shop-promo-media {
  position: relative;
  aspect-ratio: 12 / 5;
  overflow: hidden;
  background: #f1f5f9;
}
.shop-promo-media-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(18px) saturate(1.1);
  transform: scale(1.15);
  opacity: .55;
}
.shop-promo-media-img {
  position: relative;
  display: block;
  width: 100%; height: 100%;
  object-fit: contain;
}
.shop-promo-expiry {
  display: inline-block;
  margin-bottom: .5rem;
  border-radius: .375rem;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: .2rem .55rem;
}
