/*
 * od-base.css — fondamenta del restyle di novembre 2026 (riferimento: tema Malva, basato su Dawn).
 * Caricato da head.tpl dopo custom.css e prima di od-header/od-category/od-product.
 * Qui SOLO token e correzioni globali: lo stile delle singole aree sta nei loro file.
 */

:root {
  /* Colori brand (stessi valori di custom.css, nomi brevi) */
  --od-orange: #f26a1b;
  --od-orange-dark: #cc5613;
  --od-yellow: #ffc94d;
  --od-teal: #1b4b43;
  --od-teal-dark: #123530;
  --od-ink: #292b2c;          /* testo principale */
  --od-muted: #6b6f72;        /* testo secondario, etichette */
  --od-line: #e6e2db;         /* bordi e separatori sottili */
  --od-surface: #ffffff;
  --od-surface-alt: #f6f3ee;  /* sfondo card, pillole neutre (equivalente del #eef0ec di Malva) */
  --od-overlay: rgba(18, 22, 20, 0.5);

  /* Spaziature (scala 4px) */
  --od-space-1: 4px;
  --od-space-2: 8px;
  --od-space-3: 12px;
  --od-space-4: 16px;
  --od-space-5: 24px;
  --od-space-6: 32px;
  --od-space-7: 48px;
  --od-space-8: 64px;
  --od-gutter: 16px;          /* margine laterale pagina su mobile */

  /* Scala tipografica: poche misure, sempre queste */
  --od-font: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --od-text-xs: 12px;         /* etichette maiuscole, meta */
  --od-text-sm: 14px;         /* testo secondario, controlli */
  --od-text-md: 16px;         /* testo base */
  --od-text-lg: 18px;         /* nomi prodotto in card, prezzi */
  --od-text-xl: 24px;         /* titoli di sezione */
  --od-text-2xl: clamp(28px, 4vw, 44px); /* H1 pagina (categoria, prodotto) */
  --od-label-tracking: 0.08em;

  /* Forme e movimento */
  --od-radius-sm: 8px;
  --od-radius: 12px;
  --od-radius-lg: 18px;
  --od-radius-pill: 999px;
  --od-shadow: 0 8px 24px rgba(41, 43, 44, 0.08);
  --od-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --od-fast: 180ms ease;

  /* Altezze di riferimento */
  --od-header-h: 72px;        /* aggiornata da od-header.js con l'altezza reale */
  --od-control-h: 44px;       /* bottoni, select, input: target touch minimo */
  --od-valen-bar-h: 0px;      /* altezza della barra Valen fissa in basso (mobile) */
}

@media (max-width: 1023.98px) {
  /* La barra "Chiedi qualunque cosa" di Valen e' fissa in basso su mobile/tablet:
     senza questo spazio copre il fondo di ogni pagina (bottone Filtro, prezzo, ecc.). */
  :root { --od-valen-bar-h: 88px; }
  body { padding-bottom: var(--od-valen-bar-h); }
}

body {
  font-family: var(--od-font);
  color: var(--od-ink);
  overflow-x: clip; /* nessuno scorrimento orizzontale da elementi che sbordano */
}

/* Residui dell'azzurro di Classic (#24b9d7) -> arancione brand, ovunque. */
a:hover, a:focus { color: var(--od-orange-dark); }
.page-item.active .page-link,
.pagination .current a { color: var(--od-orange); }
.btn-primary,
.btn-primary:not(:disabled):not(.disabled):active {
  background-color: var(--od-orange);
  border-color: var(--od-orange);
}
.btn-primary:hover, .btn-primary:focus { background-color: var(--od-orange-dark); border-color: var(--od-orange-dark); }

/* L'hero CTA sta su sfondo arancione: la regola .btn-primary sopra la rendeva invisibile
   (arancione su arancione). Specificita' piu' alta per vincere sempre, qui o in custom.css. */
.orangeduke-hero-cta.btn-primary,
.orangeduke-hero-cta.btn-primary:not(:disabled):not(.disabled):active {
  background-color: #fff;
  border: 2px solid #fff;
  color: var(--od-orange-dark);
  font-weight: 700;
}
.orangeduke-hero-cta.btn-primary:hover,
.orangeduke-hero-cta.btn-primary:focus {
  background-color: transparent;
  border-color: #fff;
  color: #fff;
}
.form-control:focus, .custom-select:focus { border-color: var(--od-orange); box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.15); outline: none; }
input[type="checkbox"]:checked, input[type="radio"]:checked { accent-color: var(--od-orange); }
.custom-checkbox input[type="checkbox"] + span .checkbox-checked { color: var(--od-orange); }

/* Focus visibile e coerente per la tastiera */
:focus-visible { outline: 2px solid var(--od-orange); outline-offset: 2px; }

/* Utility condivise */
.od-visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.od-label {
  font-size: var(--od-text-xs);
  font-weight: 600;
  letter-spacing: var(--od-label-tracking);
  text-transform: uppercase;
  color: var(--od-muted);
}
body.od-scroll-lock { overflow: hidden; }

/* Sfondo bianco su categoria e prodotto (come Malva): il grigio #f6f6f6 di Classic restava solo li'. */
#product #wrapper { background: var(--od-surface); }

/* Home: carosello "Prodotti popolari" (ps_featuredproducts) con la card nuova di od-category.
   Le colonne Bootstrap (padding 15px) e le larghezze di custom.css (68%) tagliavano le card. */
.featured-products .products {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--od-space-5);
  margin: 0;
}
.featured-products .products > .product {
  width: auto; max-width: none; padding: 0; float: none; margin: 0;
}
@media (max-width: 1199.98px) { .featured-products .products { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .featured-products .products {
    display: flex;
    /* Classic mette "flex-wrap: wrap" su questo stesso selettore fuori da qualunque media
       query (sempre attivo): senza ribadirlo qui la proprieta' vince lei e le card vanno a
       capo una per riga invece di scorrere in orizzontale (bug reale, owner feedback). */
    flex-wrap: nowrap;
    /* justify-content:center (da Classic) in un contenitore che scorre spinge le prime card
       fuori a sinistra, dove non si raggiungono: si parte da sinistra. */
    justify-content: flex-start;
    gap: var(--od-space-3);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--od-gutter);
    padding: 0 var(--od-gutter) var(--od-space-2);
    margin: 0 calc(-1 * var(--od-gutter));
    scrollbar-width: none;
  }
  .featured-products .products::-webkit-scrollbar { display: none; }
  .featured-products .products > .product {
    flex: 0 0 64%;
    width: 64%;
    max-width: 64%;
    scroll-snap-align: start;
  }
}

/* =========================================================================
   Popup carrello ("Prodotto aggiunto al carrello", ps_shoppingcart/modal.tpl)
   L'originale di Classic non aveva stile del tema (titolo blu, bottoni
   maiuscoli di Bootstrap): qui si riscrive completamente l'aspetto, l'overlay
   di Bootstrap (.modal-backdrop, show/hide via blockcart.showModal in
   theme.js) resta invariato. class="modal" nel markup serve solo al dismiss
   di Bootstrap (.closest('.modal')): qui non arriva nessuno stile di
   Bootstrap, solo questo blocco.
   ========================================================================= */
#blockcart-modal.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: var(--od-space-3, 1rem);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
#blockcart-modal.modal.in,
#blockcart-modal.modal.show {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.od-cart-modal {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: var(--od-surface);
  border-radius: var(--od-radius-lg);
  box-shadow: 0 24px 60px rgba(18, 22, 20, 0.35);
  padding: var(--od-space-5, 1.75rem) var(--od-space-4, 1.5rem) var(--od-space-4, 1.5rem);
}

.od-cart-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--od-muted);
  border-radius: 50%;
  cursor: pointer;
}
.od-cart-modal__close:hover { background: var(--od-surface-alt); color: var(--od-ink); }

.od-cart-modal__header {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 1.25rem;
  padding-right: 1.5rem;
}
.od-cart-modal__check {
  flex: none;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--od-teal);
  color: #fff;
}
.od-cart-modal__title {
  font-size: 1.1rem;
  line-height: 1.25;
  color: var(--od-ink);
  margin: 0;
}

.od-cart-modal__product {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--od-line);
}
.od-cart-modal__img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: var(--od-radius-sm);
  background: var(--od-surface-alt);
  flex: none;
}
.od-cart-modal__info { min-width: 0; }
.od-cart-modal__name {
  font-weight: 700;
  color: var(--od-ink);
  margin: 0 0 0.25rem;
}
.od-cart-modal__attrs {
  font-size: var(--od-text-xs, 0.8rem);
  color: var(--od-muted);
  margin: 0 0 0.35rem;
}
.od-cart-modal__qty-price {
  font-weight: 600;
  color: var(--od-orange-dark);
  margin: 0;
}

.od-cart-modal__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.95rem;
  color: var(--od-ink);
  padding: 1rem 0;
}
.od-cart-modal__summary strong { font-size: 1.05rem; }

.od-cart-modal__actions {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}
.od-cart-modal__continue,
.od-cart-modal__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--od-control-h);
  border-radius: var(--od-radius-pill);
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
}
.od-cart-modal__continue {
  background: var(--od-surface);
  border: 2px solid var(--od-line);
  color: var(--od-ink);
}
.od-cart-modal__continue:hover { border-color: var(--od-ink); }
.od-cart-modal__checkout {
  background: var(--od-orange);
  border: 2px solid var(--od-orange);
  color: #fff;
}
.od-cart-modal__checkout:hover { background: var(--od-orange-dark); border-color: var(--od-orange-dark); }
