/* Barra di acquisto mobile (0.6.0, 12/11/2026) — vedi includes/class-gwc-buybar.php.
   Colori e font dai token condivisi (--gwc-color-*); il pulsante prende le classi del
   pulsante vero della pagina, quindi lo stile del tema. */

.gwc-buybar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9996; /* sotto pulsante flottante (9997) e mini cart (9998/9999) */
  display: flex;
  align-items: center;
  gap: var(--gwc-space-sm);
  /* 0.6.3: 4px sopra e sotto (prima 12px): barra 57px invece di 73, il pulsante resta 48px. */
  padding: 0.25rem 1rem calc(0.25rem + env(safe-area-inset-bottom, 0px));
  background: var(--gwc-color-bg, #ffffff);
  border-top: 1px solid var(--gwc-color-border);
  box-shadow: 0 -0.25rem 1rem rgba(0, 0, 0, 0.06);
  font-family: var(--gwc-font-family);
  color: var(--gwc-color-text);
}
.gwc-buybar[hidden] {
  display: none;
}

.gwc-buybar-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  line-height: 1.25;
}
.gwc-buybar-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 0.875rem;
}
.gwc-buybar-price {
  font-size: 0.875rem;
  font-weight: 500;
}
/* graffio-prezzi-per-paese: nella barra solo l'importo convertito, nota e selettore
   valuta restano sotto il prezzo della pagina. */
.gwc-buybar-price .gpp-notice {
  display: none !important;
}
.gwc-buybar-price del {
  color: var(--gwc-color-text-muted);
  font-weight: 400;
}

/* Aspetto copiato dal pulsante vero da buybar.js (stile inline); questi sono i valori di riserva. */
.gwc-buybar-button {
  flex: 0 0 auto;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  white-space: nowrap;
  padding: 0.75rem 1.25rem;
  border: 0;
  background: var(--gwc-color-primary);
  color: var(--gwc-color-primary-contrast);
  font: inherit;
}
/* Altezza fissa 48px (area di tocco minima Material Design 3): buybar.js copia in linea il
   padding del pulsante vero (spesso 16px sopra e sotto), che qui si annulla in verticale. */
.gwc-buybar .gwc-buybar-button {
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  height: 3rem;
  min-height: 3rem;
}

/* Spazio in fondo alla pagina, così la barra non copre il footer; il pulsante
   flottante del mini cart sale sopra la barra. --gwc-buybar-h lo scrive buybar.js. */
body.gwc-buybar-visible {
  padding-bottom: var(--gwc-buybar-h, 4.5rem);
}
body.gwc-buybar-visible .gwc-minicart-default-trigger {
  bottom: calc(var(--gwc-buybar-h, 4.5rem) + 0.75rem);
}
/* Icona flottante delle preferenze cookie di iubenda (in basso, sopra a tutto): sale
   sopra la barra invece di coprire il prezzo. Visto su FP il 12/11/2026. */
body.gwc-buybar-visible .iubenda-tp-btn.iubenda-tp-btn[data-tp-float][data-tp-float^="bottom"] { /* più specifica della regola iubenda, anch'essa !important */
  bottom: calc(var(--gwc-buybar-h, 4.5rem) + 0.5rem) !important;
}

/* Pulsante WhatsApp di WP Chat App (wp-whatsapp, stile inline bottom 30px/102px): sale
   sopra la barra invece di coprire il pulsante Aggiungi. FP, 18/11/2026. */
body.gwc-buybar-visible .wa__btn_popup {
  bottom: calc(var(--gwc-buybar-h, 4.5rem) + 1rem) !important;
}
body.gwc-buybar-visible .wa__popup_chat_box {
  bottom: calc(var(--gwc-buybar-h, 4.5rem) + 5.5rem) !important;
}

/* Con mini cart o un popup aperto (es. richiesta di graffio-prodotto-su-richiesta) la barra si toglie di mezzo. */
body.gwc-minicart-open .gwc-buybar,
body:has(dialog[open]) .gwc-buybar {
  display: none;
}

/* Variante da scegliere: evidenziata dopo il tocco sulla barra. */
.gwc-buybar-highlight {
  outline: 2px solid var(--gwc-color-primary);
  outline-offset: 0.5rem;
  transition: outline-color 0.3s;
}

@media (prefers-reduced-motion: reduce) {
  .gwc-buybar-highlight {
    transition: none;
  }
}

/* 0.6.4 — prodotti variabili: un selettore per gruppo sopra, miniatura a sinistra. */
.gwc-buybar.gwc-buybar--varianti { flex-wrap: wrap; row-gap: 0.375rem; column-gap: 0.625rem; }
.gwc-buybar--varianti .gwc-buybar-info { flex: 1 1 0; min-width: 0; }
.gwc-buybar--varianti .gwc-buybar-name { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gwc-buybar--varianti .gwc-buybar-button { flex: 0 0 auto; }
.gwc-buybar-gruppi { order: -1; width: 100%; display: flex; gap: 0.375rem; }
.gwc-buybar-gruppo {
  flex: 1 1 0; min-width: 0; height: 2.25rem; padding: 0 0.625rem !important; line-height: 1 !important; text-transform: none !important; letter-spacing: normal !important; border-radius: 0 !important;
  display: flex; align-items: center; justify-content: space-between; gap: 0.25rem;
  border: 1px solid #d6d0c8; background: #fff; color: inherit; font: inherit; font-size: 0.8125rem; cursor: pointer;
}
.gwc-buybar-gruppo span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gwc-buybar-gruppo i { font-style: normal; font-size: 0.625rem; }
.gwc-buybar-thumb { width: 2.5rem; height: 2.5rem; object-fit: cover; background: #f5f2ee; flex: 0 0 auto; }
.gwc-buybar-flash .gwc-buybar-thumb { animation: gwc-buybar-flash 0.6s ease; }
@keyframes gwc-buybar-flash { 40% { transform: scale(1.15); } }
@media (prefers-reduced-motion: reduce) { .gwc-buybar-flash .gwc-buybar-thumb { animation: none; } }

/* Pannello delle opzioni, dal basso. */
.gwc-sheet { position: fixed; inset: 0; z-index: 100000; background: rgba(0, 0, 0, 0.35); display: flex; align-items: flex-end; }
.gwc-sheet-box { width: 100%; background: var(--gwc-color-bg, #fff); padding: 1rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
.gwc-sheet-t { margin: 0 0 0.75rem; font-size: 0.875rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; }
.gwc-sheet-o { display: flex; flex-wrap: wrap; gap: 0.5rem; max-height: 60vh; overflow-y: auto; }
.gwc-sheet-o button { position: relative; min-height: 3rem; padding: 0 1rem; border: 1px solid #d6d0c8; background: #fff; color: inherit; font: inherit; font-size: 0.875rem; cursor: pointer; }
.gwc-sheet-o button.is-on { border: 1.5px solid currentColor; }
.gwc-sheet-o button:disabled { opacity: 0.4; cursor: not-allowed; }
.gwc-sheet-o button.is-richiesta::after { content: ""; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: #c79bb8; }
