/* Barra fissa, da telefono e da scrivania.
   Nascosta finche' l'header vero e' ancora a schermo: due barre insieme sono
   rumore. Compare solo dopo che l'header e' passato. */

.uncle-sticky {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 95;
  display: block;
  visibility: hidden;
  transform: translateY(-100%);
  transition: transform .28s cubic-bezier(.2, .7, .2, 1), visibility .28s;
  background: rgb(18 39 24 / .94);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgb(251 243 223 / .16);
  box-shadow: 0 10px 30px rgb(0 0 0 / .34);
}
.uncle-sticky.is-visibile { visibility: visible; transform: translateY(0); }

.uncle-sticky__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 9px clamp(18px, 4.5vw, 40px);
}

.uncle-sticky__brand { display: block; flex: none; line-height: 0; }
/* `body.uncleitaly-site img{height:auto}` di global.css ha la stessa
   specificita' e vinceva sul pareggio: il marchio veniva alto 50px e la
   striscia cresceva di conseguenza. */
body.uncleitaly-site .uncle-sticky__brand img,
.uncle-sticky__brand img {
  display: block;
  width: 96px;
  height: 48px;
  max-width: none;
  object-fit: contain;
  padding: 0;
  background: transparent;
}

.uncle-sticky__azioni { display: flex; align-items: center; gap: 10px; }

/* Il carrello e' lo stesso componente della testata: stesse classi, cosi'
   WooCommerce aggiorna il numero in tutte e due le copie con un colpo solo. */
.uncle-sticky .uncle-cart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  margin: 0;
  padding: 0;
  color: #fbf3df;
  background: rgb(20 12 5 / .4);
  border: 2px solid rgb(251 243 223 / .72);
  text-decoration: none;
  transition: border-color .2s, color .2s;
}
.uncle-sticky .uncle-cart:hover { color: #e3b94f; border-color: #e3b94f; }
.uncle-sticky .uncle-cart__mark { position: relative; display: grid; place-items: center; }
.uncle-sticky .uncle-cart__icon { display: block; width: 22px; height: 22px; }
.uncle-sticky .uncle-cart__label { display: none; }
.uncle-sticky .uncle-cart-count {
  position: absolute;
  top: -9px;
  right: -11px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  color: #2b1d12;
  background: #e8b33c;
  border: 2px solid #2b1d12;
  font-family: var(--ui-sans, inherit);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

.uncle-sticky__menu {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 18px;
  color: #fbf3df;
  background: transparent;
  border: 2px solid rgb(251 243 223 / .72);
  border-radius: 0;
  font-family: var(--ui-sans, inherit);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color .2s, border-color .2s;
}
.uncle-sticky__menu:hover { color: #e3b94f; border-color: #e3b94f; }
.uncle-sticky__righe { display: grid; gap: 4px; width: 18px; }
.uncle-sticky__righe span { display: block; height: 2px; background: currentColor; }

/* Con il menu aperto la striscia sparisce: sotto il pannello non serve, e
   lasciarla sotto creerebbe due bersagli «Menu» a schermo. */
html.menu-is-open .uncle-sticky { visibility: hidden; transform: translateY(-100%); }

body.admin-bar .uncle-sticky { top: 32px; }

@media (prefers-reduced-motion: reduce) {
  .uncle-sticky { transition: none; }
}

/* Da telefono la striscia si stringe: lo schermo e' poco e una barra alta come
   quella da scrivania mangerebbe mezza schermata. */
@media (max-width: 820px) {
  .uncle-sticky__inner { padding: 7px 12px; gap: 10px; }
  body.uncleitaly-site .uncle-sticky__brand img,
  .uncle-sticky__brand img { width: 84px; height: 42px; }
  .uncle-sticky .uncle-cart { width: 42px; height: 42px; min-width: 42px; }
  .uncle-sticky .uncle-cart__icon { width: 20px; height: 20px; }
  /* Solo le righe, come nell'header: la parola non ci sta e non serve. */
  .uncle-sticky__menu {
    gap: 0;
    width: 46px;
    min-width: 46px;
    padding: 0;
    justify-content: center;
    font-size: 0;
    letter-spacing: 0;
  }
  .uncle-sticky__righe { font-size: 12px; width: 17px; }
}
