/* ==========================================================================
   CARRINHO — GVS Creative
   ========================================================================== */

/* Botão do carrinho no header */
.cart-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  color: var(--bone);
  transition: background 0.2s var(--ease-soft), color 0.2s var(--ease-soft);
}

.cart-trigger:hover,
.cart-trigger:focus-visible {
  background: var(--surface-card);
  color: var(--gold);
}

.cart-trigger svg { width: 21px; height: 21px; }

.cart-trigger__badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--black-pure);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Overlay + Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 8, 10, 0.6);
  backdrop-filter: blur(2px);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft);
}

.cart-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--surface-1);
  border-left: 1px solid var(--border-soft);
  z-index: 901;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s var(--ease-out);
}

.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem var(--space-container);
  border-bottom: 1px solid var(--border-soft);
}

.cart-drawer__head h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.cart-drawer__close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  color: var(--bone-dim);
}

.cart-drawer__close:hover { color: var(--gold); background: var(--surface-card); }
.cart-drawer__close svg { width: 18px; height: 18px; }

.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem var(--space-container);
}

.cart-empty {
  color: var(--bone-dim);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-empty p { color: var(--bone); font-weight: 600; }
.cart-empty span { font-size: 0.9rem; line-height: 1.5; }

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.cart-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
}

.cart-item__info { display: flex; flex-direction: column; gap: 0.3rem; }
.cart-item__name { font-weight: 600; font-size: 0.95rem; }
.cart-item__price { font-family: var(--font-mono); font-size: 0.85rem; color: var(--gold); }

.cart-item__qty {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.cart-item__qty button {
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  color: var(--bone);
}

.cart-item__qty button:hover { border-color: var(--gold); color: var(--gold); }
.cart-item__qty span { font-family: var(--font-mono); font-size: 0.85rem; min-width: 1.2rem; text-align: center; }

.cart-item__remove {
  color: var(--bone-faint);
  font-size: 0.8rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  flex-shrink: 0;
}

.cart-item__remove:hover { color: var(--gold); }

.cart-drawer__foot {
  padding: 1.25rem var(--space-container) 1.5rem;
  border-top: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-drawer__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-family: var(--font-mono);
}

.cart-drawer__total span { color: var(--bone-dim); font-size: 0.85rem; }
.cart-drawer__total strong { font-size: 1.3rem; color: var(--gold); }

.cart-drawer__note {
  font-size: 0.75rem;
  color: var(--bone-faint);
  line-height: 1.5;
}

.cart-drawer__clear {
  align-self: center;
  font-size: 0.8rem;
  color: var(--bone-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cart-drawer__clear:hover { color: var(--gold); }

/* Toast "adicionado ao carrinho" */
.cart-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translate(-50%, 12px);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  color: var(--bone);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  z-index: 950;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s var(--ease-soft), transform 0.25s var(--ease-soft);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cart-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.cart-toast::before {
  content: '✓';
  color: var(--gold);
  font-weight: 700;
}

/* Botões de adicionar ao carrinho dentro de cards */
.package-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.package-card__link {
  text-align: center;
  font-size: 0.78rem;
  color: var(--bone-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.package-card__link:hover { color: var(--gold); }

.service-avulso {
  position: relative;
  padding-right: 2.4rem;
}

.service-avulso__add {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--bone);
  font-size: 1.1rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-avulso__add:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--surface-card);
}

body.is-cart-locked { overflow: hidden; }

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