/* Olfère · Cart Sidebar v1 (2026-08-20) */

/* ── Sidebar container ───────────────────────────────────────── */
[data-cart-sidebar] {
  position: fixed; inset: 0; z-index: 900;
  pointer-events: none; visibility: hidden;
}
body.cart-open [data-cart-sidebar] {
  pointer-events: all; visibility: visible;
}

.cart-sidebar__overlay {
  position: absolute; inset: 0;
  background: rgba(43, 40, 35, .45);
  opacity: 0; transition: opacity .35s ease;
  cursor: pointer;
}
body.cart-open .cart-sidebar__overlay { opacity: 1; }

.cart-sidebar__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(420px, 100vw);
  background: var(--paper);
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  box-shadow: -8px 0 48px rgba(43, 40, 35, .12);
}
body.cart-open .cart-sidebar__panel { transform: translateX(0); }

/* ── Header ──────────────────────────────────────────────────── */
.cart-sidebar__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.cart-sidebar__header h2 {
  margin: 0;
  font: 600 .82rem/1 "Manrope", sans-serif;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink);
}
/* Unica saida de um painel que ocupa a tela inteira no celular:
   media 27x30 e precisa de area confortavel de toque. */
.cart-sidebar__close {
  display: grid; place-items: center;
  min-width: 44px; min-height: 44px;
  background: none; border: none; cursor: pointer; padding: 4px 8px;
  font-size: 1.4rem; line-height: 1; color: var(--muted);
  transition: color .2s; border-radius: 50%;
}
.cart-sidebar__close:focus-visible { outline: 2px solid var(--bronze-dark); outline-offset: 2px; }
.cart-sidebar__close:hover { color: var(--ink); }

/* ── Body / items ────────────────────────────────────────────── */
.cart-sidebar__body {
  flex: 1; overflow-y: auto; padding: 16px 24px;
  display: flex; flex-direction: column; gap: 16px;
}

.cart-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 48px 0; text-align: center;
  color: var(--muted); font-size: .88rem;
}
.cart-empty p { margin: 0; }
.text-link {
  color: var(--bronze); text-decoration: none;
  font-size: .82rem; font-weight: 600; letter-spacing: .04em;
}
.text-link:hover { text-decoration: underline; }

.cart-item {
  display: grid; grid-template-columns: 64px 1fr auto;
  gap: 12px; align-items: start;
  padding-bottom: 16px; border-bottom: 1px solid var(--line);
}
.cart-item:last-child { border-bottom: none; padding-bottom: 0; }

.cart-item__image {
  width: 64px; height: 64px; border-radius: 8px;
  overflow: hidden; background: var(--ivory);
  flex-shrink: 0;
}
.cart-item__image img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__image-placeholder { width: 100%; height: 100%; }

.cart-item__info { min-width: 0; }
.cart-item__name  { margin: 0; font-size: .88rem; font-weight: 600; line-height: 1.3; }
.cart-item__variant { margin: 2px 0 0; font-size: .78rem; color: var(--muted); }
.cart-item__price { margin: 4px 0 0; font-size: .88rem; font-weight: 700; color: var(--bronze); }

.cart-item__qty {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
}
.cart-item__qty button {
  background: var(--ivory); border: 1px solid var(--line);
  cursor: pointer; width: 28px; height: 28px; border-radius: 6px;
  font-size: 1rem; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s; color: var(--ink);
}
.cart-item__qty button:hover { background: var(--line); }
.cart-item__qty span { font-size: .88rem; font-weight: 600; min-width: 20px; text-align: center; }

.cart-item__remove {
  background: none; border: none; cursor: pointer; padding: 2px 4px;
  color: var(--muted); font-size: 1.1rem; line-height: 1;
  transition: color .2s; margin-top: 1px; flex-shrink: 0;
}
.cart-item__remove:hover { color: var(--ink); }

/* ── Footer ──────────────────────────────────────────────────── */
.cart-sidebar__footer {
  padding: 20px 24px; border-top: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 12px;
  flex-shrink: 0;
}
.cart-pending-order {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 14px; border: 1px solid rgba(169,139,101,.45); border-radius: 12px;
  background: rgba(169,139,101,.09); color: var(--ink); text-decoration: none;
  font-size: .76rem; line-height: 1.35;
}
.cart-pending-order strong { font-size: .78rem; }
.cart-pending-order span { color: var(--bronze-dark); white-space: nowrap; }
.cart-pending-order:hover { border-color: var(--bronze); }
.cart-total {
  display: flex; justify-content: space-between; align-items: baseline;
}
.cart-total span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.cart-total strong { font-size: 1.2rem; font-weight: 700; }

.cart-shipping-note {
  margin: 0; font-size: .78rem; color: var(--muted); text-align: center;
}
.cart-checkout-btn, .cart-continue-btn { width: 100%; justify-content: center; }
.cart-continue-btn { margin-top: 0; }
.cart-clear-btn {
  display: block; width: 100%; margin-top: 10px; padding: 6px;
  border: 0; background: transparent;
  font: 600 .72rem Manrope, sans-serif; color: var(--muted);
  letter-spacing: .04em; text-align: center; cursor: pointer;
  opacity: .7; transition: opacity .15s, color .15s;
}
.cart-clear-btn:hover { opacity: 1; color: #c0392b; }

/* ── Header cart badge (icon + tools container defined in styles.css) ── */
/* ── Withdrawal dialog (inline styles migrated for CSP) ─────── */
.order-footer-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line) }
.order-footer-note    { font-size: .78rem }

.wd-title    { font: 500 1.4rem/1.2 'Cormorant Garamond', serif; margin: 0 0 16px }
.wd-body     { font-size: .88rem; line-height: 1.7; color: var(--muted); margin: 0 0 12px }
.wd-deadline { font-size: .82rem; font-weight: 700; margin: 0 0 16px }
.wd-footer   { font-size: .82rem; line-height: 1.6; color: var(--muted); margin: 0 0 24px }
.wd-actions  { display: flex; flex-direction: column; gap: 10px }
.wd-btn      { width: 100%; justify-content: center; text-align: center }

.header-tool__badge {
  position: absolute; top: 2px; right: 2px;
  background: var(--bronze); color: #fff;
  border-radius: 999px; font-size: .6rem; font-weight: 700;
  min-width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; line-height: 1;
  pointer-events: none;
}
