/* On-store checkout page — mirrors Shopify's one-page checkout. */
:root {
  --co-accent: #005bd1;
  --co-text: #000;
  --co-muted: #707070;
  --co-border: #dedede;
  --co-aside: #f5f5f5;
  --co-selected: #f0f5ff;
  --co-error: #dd1d1d;
  --co-radius: 12px;
  --co-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
}
*, *::before, *::after { box-sizing: border-box; }
html, body.co-body { margin: 0; padding: 0; background: #fff; }
body.co-body { font-family: var(--co-font); font-size: 14px; line-height: 1.45; color: var(--co-text); -webkit-font-smoothing: antialiased; }
.co [hidden] { display: none !important; }
.co-muted { color: var(--co-muted); }
.co-link { color: var(--co-accent); text-decoration: underline; text-underline-offset: 2px; font-size: 14px; }

/* ------------------------------------------------ header */
.co-header { border-bottom: 1px solid var(--co-border); background: #fff; }
.co-header__inner { max-width: 980px; margin: 0 auto; height: 64px; padding: 0 0; display: flex; align-items: center; justify-content: space-between; }
.co-logo { font-size: 21px; font-weight: 600; color: var(--co-text); text-decoration: none; letter-spacing: -0.01em; }
.co-logo img { display: block; height: 32px; width: auto; }
.co-cart-link { color: var(--co-accent); display: inline-flex; padding: 8px; margin-right: -8px; }

/* ------------------------------------------------ layout */
.co-layout { display: grid; grid-template-columns: minmax(0, calc(50% + 50px)) minmax(0, 1fr); min-height: calc(100vh - 65px); }
.co-main { padding: 38px 40px 0 20px; }
.co-main__inner { max-width: 500px; margin-left: auto; }
.co-aside { background: var(--co-aside); border-left: 1px solid var(--co-border); padding: 40px 20px 40px 40px; }
.co-aside__inner { max-width: 400px; position: sticky; top: 40px; }
.co-summary-toggle { display: none; }

/* ------------------------------------------------ type */
.co-section { margin-bottom: 28px; }
.co-section__head { display: flex; align-items: baseline; justify-content: space-between; }
.co-h2 { font-size: 20px; font-weight: 600; margin: 0 0 14px; line-height: 1.3; }
.co-h3 { font-size: 16px; font-weight: 600; margin: 0 0 12px; line-height: 1.3; }
.co-sub { margin: -10px 0 14px; }

/* ------------------------------------------------ fields (floating labels) */
.co-field { position: relative; margin-bottom: 12px; flex: 1; min-width: 0; }
.co-input {
  display: block; width: 100%; height: 48px; padding: 20px 12px 6px;
  font: inherit; font-size: 14px; color: var(--co-text); background: #fff;
  border: 1px solid var(--co-border); border-radius: var(--co-radius);
  outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .15s, box-shadow .15s;
}
.co-input:focus { border-color: var(--co-accent); box-shadow: 0 0 0 1px var(--co-accent); }
.co-field label {
  position: absolute; left: 13px; top: 15px; color: var(--co-muted); font-size: 14px;
  pointer-events: none; transition: top .12s, font-size .12s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: calc(100% - 26px);
}
.co-input:placeholder-shown { padding: 13px 12px; }
.co-input:focus:placeholder-shown { padding: 20px 12px 6px; }
.co-input:not(:placeholder-shown) + label,
.co-input:focus + label,
.co-field--select label { top: 6px; font-size: 12px; }
.co-field--select .co-input { padding: 20px 34px 6px 12px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%23707070' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
.co-field--select.is-empty label { top: 15px; font-size: 14px; }
.co-field--select.is-empty .co-input { color: transparent; }
.co-field.has-error .co-input { border-color: var(--co-error); box-shadow: 0 0 0 1px var(--co-error); }
.co-field__error { color: var(--co-error); font-size: 12px; margin-top: 4px; }
.co-row { display: flex; gap: 10px; }
.co-row--3 > .co-field { flex: 1; }

.co-check { display: flex; align-items: center; gap: 10px; cursor: pointer; margin-top: 2px; }
.co-check input, .co-radio input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none; width: 18px; height: 18px;
  border: 1px solid var(--co-border); background: #fff; cursor: pointer; transition: border-color .15s, background .15s;
}
.co-check input { border-radius: 5px; }
.co-check input:checked { background: var(--co-accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.5l4.5-5' fill='none' stroke='white' stroke-width='1.8'/%3E%3C/svg%3E") center/12px no-repeat; border-color: var(--co-accent); }
.co-radio input { border-radius: 50%; }
.co-radio input:checked { border: 6px solid var(--co-accent); }
.co-check input:focus-visible, .co-radio input:focus-visible { outline: 2px solid var(--co-accent); outline-offset: 2px; }

/* ------------------------------------------------ shipping rates + radio groups */
.co-placeholder { background: var(--co-aside); border-radius: var(--co-radius); padding: 16px; text-align: center; color: var(--co-muted); }
.co-placeholder--flat { border-radius: 0; background: transparent; padding: 18px 16px; }
.co-placeholder--error { color: var(--co-error); }
.co-radio-group { border: 1px solid var(--co-border); border-radius: var(--co-radius); overflow: hidden; }
.co-radio { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; border-top: 1px solid var(--co-border); font-weight: 600; }
.co-radio:first-child { border-top: 0; border-top-left-radius: var(--co-radius); border-top-right-radius: var(--co-radius); }
.co-radio:last-child { border-bottom-left-radius: var(--co-radius); border-bottom-right-radius: var(--co-radius); }
.co-radio.is-selected { background: var(--co-selected); box-shadow: inset 0 0 0 1px var(--co-accent); }
.co-radio span { flex: 1; }
.co-radio .co-rate-price { flex: none; font-weight: 600; }
.co-rate-loading { opacity: .55; pointer-events: none; }

/* ------------------------------------------------ payment box */
.co-pay { border: 1px solid var(--co-accent); border-radius: var(--co-radius); overflow: hidden; }
.co-pay__head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--co-selected); border-bottom: 1px solid var(--co-accent); }
.co-pay__title { font-weight: 600; }
.co-cards { display: inline-flex; gap: 4px; }
.co-card { width: 38px; height: 24px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 800; letter-spacing: .02em; color: #fff; }
.co-card--visa { background: #1a1f71; font-style: italic; font-size: 10px; }
.co-card--mc { background: #252525; position: relative; }
.co-card--mc i { width: 12px; height: 12px; border-radius: 50%; display: block; }
.co-card--mc i:first-child { background: #eb001b; margin-right: -4px; }
.co-card--mc i:last-child { background: #f79e1b; opacity: .9; }
.co-card--amex { background: #1f72cd; }
.co-pay__body { background: var(--co-aside); }
.co-commas { background: var(--co-aside); padding: 4px 6px; }
.co-commas iframe { width: 100% !important; border: 0; display: block; }
.co-pay.is-loading .co-pay__body { min-height: 120px; }

/* ------------------------------------------------ pay button + alerts */
.co-alert { border: 1px solid #f1b3b3; background: #fff4f4; color: #8c1414; border-radius: var(--co-radius); padding: 12px 14px; margin: 0 0 14px; }
.co-pay-btn {
  position: relative; display: block; width: 100%; height: 56px; margin: 6px 0 0; border: 0; border-radius: var(--co-radius);
  background: var(--co-accent); color: #fff; font: inherit; font-size: 16px; font-weight: 600; cursor: pointer;
  transition: filter .15s;
}
.co-pay-btn:hover { filter: brightness(.92); }
.co-pay-btn:focus-visible { outline: 2px solid var(--co-accent); outline-offset: 3px; }
.co-pay-btn[disabled] { cursor: progress; filter: none; }
.co-spinner { display: none; }
.co-pay-btn.is-busy .co-pay-btn__label { visibility: hidden; }
.co-pay-btn.is-busy .co-spinner, .co-spinner.is-on {
  display: block; position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; border-radius: 50%; animation: co-spin .7s linear infinite;
}
.co-spinner--dark { position: static !important; margin: 12px auto !important; display: block; border-color: #ccc !important; border-top-color: #555 !important; }
@keyframes co-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .co-pay-btn.is-busy .co-spinner, .co-spinner.is-on { animation-duration: 2s; } }

.co-footer { border-top: 1px solid var(--co-border); margin-top: 40px; padding: 18px 0 28px; display: flex; flex-wrap: wrap; gap: 10px 18px; }
.co-footer .co-link { font-size: 13px; }

/* ------------------------------------------------ summary */
.co-items { list-style: none; margin: 0 0 20px; padding: 0; }
.co-item { display: flex; align-items: center; gap: 14px; padding: 6px 0; }
.co-item__thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: var(--co-radius); background: #fff; border: 1px solid var(--co-border); }
.co-item__thumb img { width: 100%; height: 100%; object-fit: contain; border-radius: var(--co-radius); }
.co-item__qty { position: absolute; top: -8px; right: -8px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: #000; color: #fff; font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.co-item__info { flex: 1; min-width: 0; }
.co-item__title { display: block; }
.co-item__variant { display: block; color: var(--co-muted); font-size: 12px; }
.co-item__price { white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-discount { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 8px; }
.co-discount .co-field { margin-bottom: 0; }
.co-discount__btn { height: 48px; padding: 0 16px; border-radius: var(--co-radius); border: 1px solid var(--co-border); background: #ebebeb; color: var(--co-muted); font: inherit; font-weight: 600; cursor: pointer; }
.co-discount__btn:not([disabled]) { background: var(--co-accent); color: #fff; border-color: var(--co-accent); }
.co-discount-msg { font-size: 13px; margin-bottom: 12px; }
.co-discount-msg.is-error { color: var(--co-error); }
.co-totals { padding-top: 6px; }
.co-totals__row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-variant-numeric: tabular-nums; }
.co-totals__total { font-size: 19px; font-weight: 600; padding-top: 10px; align-items: baseline; }
.co-totals__total strong { font-weight: 600; }
.co-currency { font-size: 12px; color: var(--co-muted); font-weight: 400; margin-right: 2px; }
.co-done { text-align: center; padding: 30px 0; }

/* ------------------------------------------------ mobile */
@media (max-width: 999px) {
  .co-header__inner { padding: 0 20px; height: 60px; }
  .co-layout { display: flex; flex-direction: column-reverse; }
  .co-layout { min-height: 0; }
  .co-main { padding: 22px 20px 0; }
  .co-main__inner { max-width: 560px; margin: 0 auto; }
  .co-aside { border-left: 0; border-bottom: 1px solid var(--co-border); padding: 16px 20px; display: none; }
  .co-aside.is-open { display: block; }
  .co-aside__inner { position: static; max-width: 560px; margin: 0 auto; }
  .co-summary-toggle {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; background: var(--co-aside); border: 0; border-bottom: 1px solid var(--co-border);
    font: inherit; font-size: 14px; color: var(--co-accent); cursor: pointer;
  }
  .co-summary-toggle__label { display: inline-flex; align-items: center; gap: 6px; }
  .co-summary-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .co-summary-toggle__total { color: var(--co-text); font-size: 17px; font-weight: 600; }
}
@media (max-width: 480px) {
  .co-row--3 { flex-wrap: wrap; }
  .co-row--3 > .co-field:first-child { flex-basis: 100%; }
}

/* Vaelemae logo (the shop's header: black badge with "v" + name) */
.vm-logo { display: inline-flex; align-items: center; gap: 8px; font: 700 20px/1 Inter, system-ui, sans-serif; color: #0b0b0c; letter-spacing: -0.02em; }
.vm-logo__mark { width: 28px; height: 28px; border-radius: 8px; background: #0b0b0c; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 16px; }
