/* =========================================================
   Carrinho lateral Castrelli & Co. (off-canvas pela direita)
   ========================================================= */
.alv-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  background: rgba(0, 0, 0, .45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
}
.alv-cart-overlay.is-open { opacity: 1; visibility: visible; }

.alv-cart {
  --azul: var(--brand, #155C6B);
  --verde: #00aa00;
  --texto: #1a1a1a;
  --suave: #6b6b6b;
  --linha: #ececec;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10011;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  width: 90%;
  max-width: 400px;
  height: 100vh;
  height: 100dvh;
  background: #fff;
  box-shadow: -6px 0 28px rgba(0, 0, 0, .16);
  color: var(--texto);
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .3s ease, visibility .3s ease;
}
.alv-cart.is-open {
  transform: translateX(0);
  visibility: visible;
  transition: transform .3s ease, visibility 0s; /* visível na hora, para receber o foco */
}
.alv-cart:focus { outline: none; }
.alv-cart *, .alv-cart *::before, .alv-cart *::after { box-sizing: border-box; }
body.alv-cart-open { overflow: hidden !important; }

.alv-cart__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 12px 14px 20px;
  border-bottom: 1px solid var(--linha);
}
.alv-cart__title { margin: 0; color: var(--texto); font-family: inherit; font-size: 18px; font-weight: 600; }
.alv-cart__title span { color: var(--suave); font-size: 14px; font-weight: 400; }
.alv-cart__btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--azul);
  cursor: pointer;
}
.alv-cart__btn-icon:hover { background: rgba(21, 92, 107, .08); }
.alv-cart__btn-icon svg { width: 22px; height: 22px; }

.alv-cart__notice {
  margin: 12px 20px 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: rgba(21, 92, 107, .06);
  color: var(--azul);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}
.alv-cart__notice svg { width: 18px; height: 18px; flex-shrink: 0; }

.alv-cart__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px; }
.alv-cart__list { margin: 0; padding: 0; list-style: none; }
.alv-cart__item {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--linha);
}
.alv-cart__img { width: 72px; height: 72px; border-radius: 10px; background: #f3f4f6; object-fit: cover; }
.alv-cart__info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.alv-cart__name {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--texto);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.alv-cart__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.alv-cart__price { color: var(--verde); font-size: 15px; font-weight: 600; white-space: nowrap; }
.alv-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e1e3e4;
  border-radius: 8px;
  overflow: hidden;
}
.alv-cart__qty button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: #fff;
  color: var(--texto);
  cursor: pointer;
}
.alv-cart__qty button:hover { background: rgba(0, 0, 0, .04); }
.alv-cart__qty button:disabled { opacity: .35; cursor: default; }
.alv-cart__qty svg { width: 10px; height: 10px; }
.alv-cart__qty span { min-width: 28px; color: var(--texto); font-size: 14px; font-weight: 500; text-align: center; }
.alv-cart__remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--suave);
  font-family: inherit;
  font-size: 12px;
  text-decoration: underline;
  cursor: pointer;
}
.alv-cart__remove:hover { color: #c62828; }
.alv-cart__remove svg { width: 14px; height: 14px; }

.alv-cart__empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 56px 12px; text-align: center; }
.alv-cart__empty svg { width: 48px; height: 48px; color: #c3c7cf; }
.alv-cart__empty p { margin: 0; color: var(--suave); font-size: 15px; }

.alv-cart__foot { padding: 16px 20px 20px; border-top: 1px solid var(--linha); background: #fff; }
.alv-cart__line { display: flex; justify-content: space-between; margin: 0 0 6px; color: var(--suave); font-size: 14px; }
.alv-cart__line strong { color: var(--texto); font-weight: 600; }
.alv-cart__line--total { margin-bottom: 14px; color: var(--texto); font-size: 16px; }
.alv-cart__line--total strong { font-size: 18px; }
.alv-cart__free { color: var(--verde); font-weight: 500; }
.alv-cart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #12b812 0%, var(--verde) 100%);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}
.alv-cart__checkout:hover { background: linear-gradient(180deg, var(--verde) 0%, #008f00 100%); color: #fff; }
.alv-cart__checkout svg { width: 18px; height: 18px; }
.alv-cart__continue {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--azul);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
}
.alv-cart__msg { margin: 10px 0 0; color: #c62828; font-size: 13px; text-align: center; }
.alv-cart button:focus-visible, .alv-cart a:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .alv-cart, .alv-cart-overlay { transition: none; }
}
