:root {
  --checkout-accent: #3d1d37;
  --checkout-tint: #f7f4f7;
  --checkout-border: #dfdce3;
}

#cart-preview {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(100vw, 465px);
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ink);
  background: #fff;
}
#cart-preview[open] {
  display: flex;
  flex-direction: column;
  animation: cart-open 220ms var(--enter) both;
}
#cart-preview::backdrop { background: #110a1b65; }
@keyframes cart-open { from { transform: translateX(100%); } }
.cart-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--checkout-border);
}
.cart-preview-head h2 { margin: 0; font-size: 23px; }
.cart-preview-head .x { width: 38px; height: 38px; font-size: 25px; }
.cart-preview-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 22px; }
.cart-preview-footer { padding: 10px 22px 22px; border-top: 1px solid var(--checkout-border); }
.cart-preview-footer[hidden] { display: none; }
.cart-empty { margin: 26px 0 10px; color: var(--muted); }
.cart-continue, .checkout-back { text-decoration: underline; text-underline-offset: 4px; }
.cart-lines { list-style: none; padding: 0; margin: 0; }
.cart-line {
  display: grid;
  grid-template-columns: 62px minmax(0,1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--checkout-border);
  font-size: 13px;
}
.cart-line:last-child { border-bottom: 0; }
.cart-photo {
  display: block;
  width: 62px;
  height: 72px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--soft);
}
.cart-photo img { width: 100%; height: 100%; object-fit: cover; }
.cart-item a { font-weight: 650; }
.cart-item a:hover { text-decoration: underline; }
.cart-item p { margin: 4px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.cart-quantity { display: flex; align-items: center; gap: 7px; margin-top: 8px; flex-wrap: wrap; }
.cart-quantity button {
  min-width: 29px;
  min-height: 29px;
  padding: 0 5px;
  border: 1px solid var(--checkout-border);
  border-radius: 5px;
  background: #fff;
}
.cart-quantity button:disabled { color: #8a8592; cursor: default; }
.cart-quantity .cart-remove { border-color: transparent; text-decoration: underline; color: var(--muted); }
.cart-totals { display: grid; gap: 8px; margin: 12px 0 16px; font-size: 14px; }
.cart-totals div { display: flex; justify-content: space-between; gap: 8px; }
.cart-totals dd { margin: 0; text-align: right; }
.cart-totals .cart-total {
  padding-top: 12px;
  margin-top: 5px;
  border-top: 1px solid var(--checkout-border);
  font-size: 20px;
  font-weight: 700;
}
.cart-total small { font-size: 11px; font-weight: 500; color: var(--muted); }
.checkout-primary {
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 48px;
  padding: 10px 18px;
  border: 0;
  border-radius: 8px;
  background: var(--checkout-accent);
  color: #fff;
  font-weight: 650;
  text-align: center;
}
.checkout-primary:hover { background: #532849; }
.checkout-primary:disabled { background: #e7dfe7; color: #574758; cursor: default; }
.checkout-mode #store-header, .checkout-mode > footer, .checkout-mode #totop { display: none; }
.checkout-mode { background: #fff; }
.checkout-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 75px;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid var(--checkout-border);
}
.checkout-header .brand-mark { width: 77px; height: 42px; }
.checkout-header .checkout-cart-link {
  position: absolute;
  right: max(18px,calc((100vw - 1160px) / 2));
}
.checkout-cart-link {
  padding: 5px 0;
  border: 0;
  color: var(--checkout-accent);
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0,1.13fr) minmax(0,1fr);
  min-height: calc(100dvh - 75px);
  background: linear-gradient(90deg,#fff 53%,var(--checkout-tint) 53%);
}
.checkout-main, .checkout-summary { width: 100%; padding: 32px clamp(20px,4vw,55px) 48px; }
.checkout-main { max-width: 660px; justify-self: end; }
.checkout-main h1 { font-size: clamp(28px,3.5vw,41px); letter-spacing: -.035em; margin: 8px 0 22px; line-height: 1.1; }
.checkout-back { color: var(--muted); font-size: 13px; }
.checkout-main fieldset { border: 0; padding: 0; margin: 0 0 23px; }
.checkout-main legend { padding: 0; margin-bottom: 9px; font-size: 20px; font-weight: 700; }
.checkout-main label { display: grid; gap: 4px; margin-bottom: 10px; font-size: 13px; font-weight: 550; }
.checkout-main label span { font-weight: 400; color: var(--muted); }
.checkout-main label .checkout-field-label { font-weight: inherit; color: inherit; }
.checkout-field-label small { font-size: inherit; color: var(--muted); }
.checkout-main label input:not([type="checkbox"]), .checkout-main select {
  width: 100%;
  min-height: 45px;
  padding: 8px 11px;
  border: 1px solid var(--checkout-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
}
.checkout-main label input[readonly] { background: var(--checkout-tint); }
.checkout-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.checkout-main .checkout-choice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 10px;
  background: var(--checkout-tint);
  border-radius: 7px;
}
.checkout-choice input { accent-color: var(--checkout-accent); margin: 3px 0 0; }
.checkout-provider {
  display: grid;
  gap: 3px;
  border: 1px solid #b193ab;
  border-radius: 8px;
  padding: 11px 13px;
  background: var(--checkout-tint);
}
.checkout-provider span, .checkout-feedback { font-size: 13px; color: var(--muted); }
.checkout-feedback:empty { display: none; }
.checkout-summary { max-width: 565px; background: var(--checkout-tint); border-left: 1px solid #eeeaef; }
.checkout-summary-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.checkout-summary-title h2 { font-size: 21px; margin: 0; }
.checkout-summary .cart-lines { padding: 8px 0; border-bottom: 1px solid var(--checkout-border); }
.checkout-result { max-width: 560px; margin: 70px auto; padding: 0 22px; }
.checkout-result h1 { font-size: 34px; line-height: 1.13; }
.checkout-reference { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.checkout-result-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.checkout-result-actions .checkout-primary { width: auto; }
.checkout-result-actions .checkout-primary[hidden] { display: none; }

@media (max-width: 700px) {
  .campaign-home header { column-gap: 6px; }
  .campaign-home .hicons .icon { width: 32px; height: 40px; }
  .campaign-home .hicons .icon svg { width: 18px; }
  .checkout-layout { display: flex; flex-direction: column-reverse; background: #fff; }
  .checkout-main, .checkout-summary { max-width: none; padding: 22px 16px 26px; }
  .checkout-summary { border-left: 0; border-bottom: 1px solid var(--checkout-border); }
  .cart-preview-head, .cart-preview-body, .cart-preview-footer { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  #cart-preview[open] { animation: none; }
}
