/* ==========================================================================
   ZEVYRO · cart (owner: commerce) — drawer + the shared cart view (/cart reuses it)
   The drawer shell is .z-drawer (zevyro.css §13). Lines are rendered by zevyro-cart.js.
   ========================================================================== */

/* -------------------------------------------------------------- drawer shell */
.z-cart-drawer__panel {
  width: min(100%, 468px);
  overflow: hidden;              /* the view scrolls inside; the summary stays at the foot */
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(201, 166, 91, .05), transparent 60%),
    var(--z-onyx);
}
.z-cart-drawer__head { flex: 0 0 auto; }
.z-cart-drawer__title:focus { outline: none; }
.z-cart-drawer__title {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0;
  font: inherit;
  outline-offset: 6px;
}
.z-cart-drawer__name {
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-eyebrow);
  font-weight: 400;
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  color: var(--z-gold);
}
.z-cart-drawer__count {
  font-family: var(--z-font-text);
  font-size: var(--z-fs-xs);
  color: var(--z-ivory-2);
  letter-spacing: .02em;
}
.z-cart-drawer__panel > .z-microprint { flex: 0 0 auto; border-top: 0; }

/* The view: main (scrolls) + summary (foot) */
.z-cart-view--drawer { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.z-cart-view--drawer .z-cart-view__main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 4px max(var(--z-gutter), env(safe-area-inset-right, 0px)) var(--z-space-l) max(var(--z-gutter), env(safe-area-inset-left, 0px));
  scrollbar-width: thin;
  scrollbar-color: var(--z-graphite) transparent;
  /* the list fades under the summary, so a longer bag reads as "scroll for more" */
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
  mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
}
.z-cart-view--drawer .z-cart-view__summary {
  flex: 0 0 auto;
  position: relative;
  padding: 18px max(var(--z-gutter), env(safe-area-inset-right, 0px)) calc(14px + env(safe-area-inset-bottom, 0px)) max(var(--z-gutter), env(safe-area-inset-left, 0px));
  border-top: 1px solid var(--z-line);
  background: var(--z-onyx);
  box-shadow: 0 -28px 36px -26px rgba(0, 0, 0, .85);
}

/* Before the first /cart.js answer, do not flash the empty state (the server cart may be stale). */
.z-js [data-z-cart-root]:not([data-ready]) .z-cart__empty { opacity: 0; }
.z-cart__empty { transition: opacity var(--z-dur-base) var(--z-ease-out); }

/* ----------------------------------------------------------------- the lines */
.z-cart__lines { list-style: none; margin: 0; padding: 0; }
.z-cart-line {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-bottom: 1px solid var(--z-line-soft);
  transition: opacity var(--z-dur-base) var(--z-ease-out), transform var(--z-dur-slow) var(--z-ease-out);
}
.z-cart-line:last-child { border-bottom-color: var(--z-line); }
/* The thumbnail is the card itself: the render is cropped to the card face (front renders: the card spans
   70.6 % of the width, centred at 37 % of the height), so it reads as a small object with its own radius. */
.z-cart-line__media {
  position: relative;
  display: block;
  align-self: start;
  margin-top: 2px;
  aspect-ratio: 85.6 / 54;
  overflow: hidden;
  border-radius: 4px;
  background: var(--z-tier-foil, var(--z-graphite));
  box-shadow: 0 14px 22px -14px rgba(0, 0, 0, .95), 0 0 0 1px rgba(243, 238, 227, .06);
}
.z-cart-line__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 15%;
  transform: scale(1.47);
  transition: transform var(--z-dur-epic) var(--z-ease-out);
}
.z-cart-line[data-tier="colecao"] .z-cart-line__media { border-radius: 0; background: var(--z-obsidian); box-shadow: none; }
.z-cart-line[data-tier="colecao"] .z-cart-line__media img { transform: scale(1.1); }
.z-cart-line__media::after {             /* a breath of light across the face, like the brushed finish */
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 250, 236, 0) 30%, rgba(255, 250, 236, .14) 48%, rgba(255, 250, 236, 0) 62%) 120% 0 / 260% 100% no-repeat;
  transition: background-position 1.4s var(--z-ease-out);
  pointer-events: none;
}
@media (hover: hover) {
  .z-cart-line__media:hover::after { background-position: -20% 0; }
}
.z-cart-line__main { min-width: 0; display: flex; flex-direction: column; }
.z-cart-line__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.z-cart-line__title {
  margin: 0;
  font-family: var(--z-font-caps);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--z-ivory);
}
.z-cart-line__title a { color: inherit; text-decoration: none; transition: color var(--z-dur-base); }
.z-cart-line__title a:hover { color: var(--z-gold-hi); }
.z-cart-line__price {
  flex: 0 0 auto;
  font-size: var(--z-fs-base);
  font-weight: 500;
  color: var(--z-ivory);
  white-space: nowrap;
}
.z-cart-line__sub {
  margin-top: 4px;
  font-family: var(--z-font-display);
  font-size: 1.0625rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.3;
  color: var(--z-ivory-2);
}
.z-cart-line__each { margin-top: 2px; font-size: var(--z-fs-xs); color: var(--z-ivory-2); }
.z-cart-line__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 8px; margin-top: auto; padding-top: 14px; }
.z-cart-line__qty { grid-template-columns: 40px 3.2ch 40px; border-color: var(--z-line); }
.z-cart-line__qty button[disabled] { color: var(--z-ivory-3); cursor: default; }
.z-cart-line__qty button[disabled]:hover { color: var(--z-ivory-3); }
.z-cart-line__qty input { font-size: .9375rem; font-weight: 500; }
.z-cart-line__qty input:focus-visible { outline: 1px solid var(--z-gold); outline-offset: -1px; }
.z-cart-line__remove {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-micro);
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  color: var(--z-ivory-2);
  text-decoration: none;
  background: linear-gradient(var(--z-gold), var(--z-gold)) 0 calc(50% + .95em) / 0 1px no-repeat;
  transition: color var(--z-dur-base), background-size var(--z-dur-slow) var(--z-ease-out);
}
.z-cart-line__remove:hover, .z-cart-line__remove:focus-visible { color: var(--z-ivory); background-size: calc(100% - .3em) 1px; }
.z-cart-line__static-qty { font-size: var(--z-fs-sm); color: var(--z-ivory-2); }

/* states */
.z-cart-line.is-busy { opacity: .5; pointer-events: none; }
.z-cart-line.is-busy::after {            /* a gold hairline runs along the line while the cart answers */
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--z-gold), transparent) 0 0 / 40% 100% no-repeat;
  animation: z-cart-run 1.1s var(--z-ease-inout) infinite;
}
.z-cart-line.is-leaving { opacity: 0; transform: translate3d(18px, 0, 0); }
@keyframes z-cart-run { from { background-position: -60% 0; } to { background-position: 160% 0; } }

/* entrance: the lines rise in after the panel slides (only when the drawer opens) */
.is-entering .z-cart-line,
.is-entering .z-cart__upsell:not([hidden]),
.is-entering .z-cart__empty > * {
  animation: z-cart-rise var(--z-dur-reveal) var(--z-ease-out) both;
  animation-delay: calc(260ms + var(--z-i, 0) * 80ms);
}
.is-entering .z-cart__upsell { --z-i: 3; }
.is-entering .z-cart__empty > :nth-child(2) { --z-i: 1; }
.is-entering .z-cart__empty > :nth-child(3) { --z-i: 2; }
.is-entering .z-cart__empty > :nth-child(4) { --z-i: 3; }
.is-entering .z-cart__empty > :nth-child(5) { --z-i: 4; }
@keyframes z-cart-rise { from { opacity: 0; transform: translate3d(0, 16px, 0); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------ notices */
.z-cart__notice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 16px;
  padding: 10px 14px;
  border: 1px solid var(--z-line);
  background: rgba(201, 166, 91, .04);
  font-size: var(--z-fs-sm);
  line-height: 1.5;
  color: var(--z-ivory);
  animation: z-cart-rise var(--z-dur-slow) var(--z-ease-out) both;
}
.z-cart__notice.is-error { border-color: var(--z-error); color: var(--z-error); background: rgba(226, 164, 147, .05); }
.z-cart__undo {
  min-height: 36px;
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-micro);
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  color: var(--z-gold-hi);
  text-decoration: underline;
  text-decoration-color: var(--z-line);
  text-underline-offset: .5em;
}
.z-cart__undo:hover { text-decoration-color: var(--z-gold); }

/* ----------------------------------------------------------- Coleção nudge */
.z-cart__upsell {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 24px;
  padding: 16px 18px 16px 16px;
  border: 1px solid var(--z-line);
  background: linear-gradient(120deg, rgba(201, 166, 91, .07), rgba(201, 166, 91, 0) 55%);
}
.z-cart__upsell::before {                /* engraved corner flourishes, like the card borders */
  content: "";
  position: absolute;
  inset: -1px;
  pointer-events: none;
  background: var(--z-gold);
  opacity: .7;
  -webkit-mask: var(--z-corner-tl) top left / 14px no-repeat, var(--z-corner-tr) top right / 14px no-repeat, var(--z-corner-bl) bottom left / 14px no-repeat, var(--z-corner-br) bottom right / 14px no-repeat;
  mask: var(--z-corner-tl) top left / 14px no-repeat, var(--z-corner-tr) top right / 14px no-repeat, var(--z-corner-bl) bottom left / 14px no-repeat, var(--z-corner-br) bottom right / 14px no-repeat;
}
.z-cart__upsell[data-variant="one"] [data-when="two"],
.z-cart__upsell[data-variant="two"] [data-when="one"] { display: none; }
.z-cart__upsell-media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--z-obsidian); }
.z-cart__upsell-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; transform: scale(1.3); }
.z-cart__upsell-text {
  font-family: var(--z-font-display);
  font-size: 1.125rem;
  font-style: italic;
  font-weight: 400;
  line-height: 1.32;
  color: var(--z-ivory);
}
.z-cart__upsell-cta { margin-top: 10px; color: var(--z-gold-hi); }
.z-cart__upsell-cta svg { width: 1em; height: 1em; }

/* ------------------------------------------------------------- empty state */
.z-cart__empty { display: grid; justify-items: center; text-align: center; padding-block: var(--z-space-xl) var(--z-space-m); }
.z-cart__seal { --z-seal-size: 54px; margin-bottom: 22px; }
.z-cart__empty-title {
  font-family: var(--z-font-display);
  font-size: var(--z-fs-display-s);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.01em;
  color: var(--z-ivory);
}
.z-cart__empty-text { max-width: 30ch; margin-top: 12px; font-size: var(--z-fs-sm); color: var(--z-ivory-2); }
.z-cart__empty .z-cart__tiers { list-style: none; margin: 30px 0 0; padding: 0; width: 100%; border-top: 1px solid var(--z-line-soft); text-align: left; }
.z-cart__tiers li { border-bottom: 1px solid var(--z-line-soft); }
.z-cart__tier {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto 16px;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 2px;
  color: var(--z-ivory);
  text-decoration: none;
  transition: background-color var(--z-dur-base);
}
.z-cart__tier-media {
  display: block;
  aspect-ratio: 85.6 / 54;
  overflow: hidden;
  border-radius: 3px;
  background: var(--z-tier-foil, var(--z-foil));
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(243, 238, 227, .1);
}
.z-cart__tier-media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 15%; transform: scale(1.47); }
.z-cart__tier-text { display: grid; gap: 2px; min-width: 0; }
.z-cart__tier-name { font-family: var(--z-font-caps); font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; }
.z-cart__tier-tag { font-family: var(--z-font-display); font-size: 1rem; font-style: italic; color: var(--z-ivory-2); }
.z-cart__tier-price { font-size: var(--z-fs-sm); color: var(--z-ivory); }
.z-cart__tier-arrow { width: 16px; height: 16px; color: var(--z-gold); transition: transform var(--z-dur-slow) var(--z-ease-out); }
@media (hover: hover) {
  .z-cart__tier:hover { background: rgba(201, 166, 91, .035); }
  .z-cart__tier:hover .z-cart__tier-name { color: var(--z-gold-hi); }
  .z-cart__tier:hover .z-cart__tier-arrow { transform: translateX(4px); }
}
.z-cart__empty-actions { display: grid; justify-items: center; gap: 14px; width: 100%; margin-top: 28px; }
.z-cart__empty-link { color: var(--z-ivory-2); }

/* ------------------------------------------------------------------ summary */
.z-cart__summary-title {
  margin-bottom: 18px;
  font-family: var(--z-font-caps);
  font-size: var(--z-fs-eyebrow);
  font-weight: 400;
  letter-spacing: var(--z-track-caps);
  text-transform: uppercase;
  color: var(--z-gold);
}
.z-cart__ship {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--z-fs-xs);
  line-height: 1.45;
  color: var(--z-ivory);
}
.z-cart__ship-icon { width: 18px; height: 18px; color: var(--z-gold); }
.z-cart__totals { margin: 10px 0 0; }
.z-cart__row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 2px 0; font-size: var(--z-fs-sm); color: var(--z-ivory-2); }
.z-cart__row dd { margin: 0; }
.z-cart__row--total {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--z-line-soft);
  color: var(--z-ivory);
}
.z-cart__row--total dt { font-family: var(--z-font-caps); font-size: var(--z-fs-eyebrow); letter-spacing: var(--z-track-caps); text-transform: uppercase; color: var(--z-gold); }
.z-cart__row--total dd { font-size: 1.375rem; font-weight: 500; letter-spacing: .01em; }
.z-cart__legal { margin-top: 10px; font-size: .75rem; line-height: 1.55; color: var(--z-ivory-2); }
.z-cart__legal-links { white-space: nowrap; }
.z-cart__legal a { color: var(--z-ivory); text-decoration-color: var(--z-line); text-underline-offset: .2em; }
.z-cart__legal a:hover { text-decoration-color: var(--z-gold); }
.z-cart__checkout { margin-top: 12px; }
.z-cart__pay { margin-top: 10px; font-size: .71875rem; letter-spacing: .04em; color: var(--z-ivory-2); text-align: center; }
.z-cart__continue { display: table; margin: 2px auto 0; padding-block: 10px 2px; font-size: var(--z-fs-xs); color: var(--z-ivory-2); }
.z-cart__continue:hover { color: var(--z-ivory); }

/* Short phones: tighter summary so two lines stay visible above it. */
@media (max-height: 700px) {
  .z-cart-view--drawer .z-cart-view__summary { padding-top: 14px; }
  .z-cart-view--drawer .z-cart__legal { font-size: .71875rem; }
  .z-cart-view--drawer .z-cart__row:not(.z-cart__row--total) { display: none; }
  .z-cart-view--drawer .z-cart__row--total { margin-top: 6px; }
}

/* ---------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  .is-entering .z-cart-line, .is-entering .z-cart__upsell:not([hidden]), .is-entering .z-cart__empty > *, .z-cart__notice { animation: none; }
  .z-cart-line.is-leaving { transform: none; }
  .z-cart-line__media img { transition: none; }
}
