/* Checkout (functions/checkout.php). Summary left, form + payment right; one column on phones,
   summary first. Theme tokens only, no colour literals. */

.itk-co-page { padding-top: 40px; padding-bottom: 64px; }
.itk-co-head { max-width: 1120px; margin: 0 auto 28px; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; }
.itk-co-title.k-h1 { font-size: clamp(32px, 4vw, 48px); }
.itk-co-secure { margin: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.itk-co-body { max-width: 1120px; margin: 0 auto; }

/* ---- Grid ---------------------------------------------------- */
.itk-co-body form.woocommerce-checkout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.itk-co-body form.woocommerce-checkout > wc-order-attribution-inputs { display: none; } /* hidden inputs only; they still submit */
@media (min-width: 900px) {
  .itk-co-body form.woocommerce-checkout { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 56px; align-items: start; }
  .itk-co-summary { position: sticky; top: 24px; }
}

.itk-co-h { margin: 0 0 16px; font-family: var(--sans); font-size: 20px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); }
.itk-co-h--pay { margin-top: 12px; }

/* ---- Summary (left) ------------------------------------------ */
.itk-co-summary { background: var(--panel); border: 1px solid var(--rule); padding: 24px; }
.itk-co-items { list-style: none; margin: 0 0 16px; padding: 0; }
.itk-co-item { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; }
.itk-co-item + .itk-co-item { margin-top: 14px; }
.itk-co-item__img { display: block; width: 76px; height: 76px; background: var(--white); border: 1px solid var(--rule); }
.itk-co-item__img img { display: block; width: 100%; height: 100%; object-fit: contain; }
.itk-co-item__name { display: block; font-size: 16px; line-height: 1.3; color: var(--ink); }
.itk-co-item__fmt { display: block; margin-top: 4px; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.itk-co-item__price { font-weight: 700; color: var(--ink); white-space: nowrap; }

/* The WooCommerce table (refreshed by AJAX): only the totals rows, the item is shown above. */
.itk-co-summary table.shop_table { width: 100%; margin: 0; border: 0; border-top: 1px solid var(--rule); border-collapse: collapse; background: none; }
.itk-co-summary table.shop_table thead,
.itk-co-summary table.shop_table tbody { display: none; }
.itk-co-summary table.shop_table th,
.itk-co-summary table.shop_table td { padding: 10px 0; border: 0; background: none; font-weight: 400; color: var(--body); text-align: left; }
.itk-co-summary table.shop_table td { text-align: right; }
.itk-co-summary table.shop_table tr.order-total th,
.itk-co-summary table.shop_table tr.order-total td { border-top: 1px solid var(--rule); padding-top: 14px; font-size: 18px; font-weight: 700; color: var(--ink); }
.itk-co-summary table.shop_table tr.order-total td strong { font-weight: 700; }

.itk-co-promise { list-style: none; margin: 18px 0 0; padding: 16px 0 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--body); }
.itk-co-promise li { position: relative; padding-left: 24px; }
.itk-co-promise li + li { margin-top: 6px; }
.itk-co-promise li::before { content: ""; position: absolute; left: 2px; top: .3em; width: 10px; height: 6px; border-left: 2px solid var(--green); border-bottom: 2px solid var(--green); transform: rotate(-45deg); }

/* ---- Express buttons (Stripe) -------------------------------- */
.itk-co-express { margin: 0 0 8px; }
.itk-co-express__label { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--body); }
.itk-co-body #wc-stripe-express-checkout-element { margin: 0 !important; gap: 10px; }
.itk-co-body #wc-stripe-express-checkout-element > div { min-width: 150px; }
.itk-co-express__skel { display: none; gap: 10px; }
.itk-co-express__skel span { flex: 1; height: 48px; border-radius: 4px; background: linear-gradient(90deg, var(--panel) 0%, var(--rule-lt) 50%, var(--panel) 100%); background-size: 200% 100%; animation: itk-co-shimmer 1.2s linear infinite; }
.itk-co-express.is-loading .itk-co-express__skel { display: flex; }
/* Stripe wraps its buttons at 150px each: phones get two rows (most phones offer 3 wallets), so the placeholder does too. */
@media (max-width: 599px) { .itk-co-express.is-loading .itk-co-express__skel { display: grid; grid-template-columns: 1fr 1fr; } }
.itk-co-express.is-loading #wc-stripe-express-checkout-element { position: absolute !important; visibility: hidden; width: 100%; }
.itk-co-express.is-loading { position: relative; }
.itk-co-express.is-ready #wc-stripe-express-checkout-element { animation: itk-co-fade .25s ease-out; }
.itk-co-express.is-empty { display: none; }
@keyframes itk-co-shimmer { to { background-position: -200% 0; } }
@keyframes itk-co-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .itk-co-express__skel span, .itk-co-express.is-ready #wc-stripe-express-checkout-element { animation: none; } }

/* Stripe's "— OR —" becomes a rule with words on it. */
.itk-co-body #wc-stripe-express-checkout-button-separator { margin: 22px 0 6px !important; font-size: 0; display: flex; align-items: center; gap: 12px; }
.itk-co-body #wc-stripe-express-checkout-button-separator::before,
.itk-co-body #wc-stripe-express-checkout-button-separator::after { content: ""; flex: 1; border-top: 1px solid var(--rule); }
.itk-co-body #wc-stripe-express-checkout-button-separator span { font-size: 13px; color: var(--muted); white-space: nowrap; }
.itk-co-express.is-empty + #wc-stripe-express-checkout-button-separator { display: none !important; }

/* ---- Fields --------------------------------------------------- */
.itk-co-body .col2-set { width: 100%; float: none; }
.itk-co-body .col2-set .col-1,
.itk-co-body .col2-set .col-2 { width: 100%; float: none; max-width: none; }
.itk-co-body .col2-set .col-2:not(:has(input, textarea, select)) { display: none; }
.itk-co-body .woocommerce-billing-fields > h3,
.itk-co-body .woocommerce-additional-fields > h3,
.itk-co-body .woocommerce-shipping-fields > h3 { margin: 24px 0 14px; font-family: var(--sans); font-size: 20px; font-weight: 700; text-transform: none; letter-spacing: 0; color: var(--ink); }
.itk-co-body .woocommerce-billing-fields__field-wrapper { display: flex; flex-wrap: wrap; gap: 0 16px; }
.itk-co-body form .form-row { width: 100%; float: none; margin: 0 0 16px; padding: 0; }
.itk-co-body form .form-row-first,
.itk-co-body form .form-row-last { width: calc(50% - 8px); }
@media (max-width: 480px) { .itk-co-body form .form-row-first, .itk-co-body form .form-row-last { width: 100%; } }
.itk-co-body form .form-row label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--body-2); }
.itk-co-body form .form-row .required { color: var(--red); text-decoration: none; border: 0; }
.itk-co-body form .form-row input.input-text,
.itk-co-body form .form-row textarea,
.itk-co-body form .form-row select { width: 100%; min-height: 46px; padding: 10px 12px; font-size: 16px; color: var(--ink); background: var(--white); border: 1px solid var(--rule); border-radius: var(--btn-radius); box-shadow: none; }
.itk-co-body form .form-row input.input-text:focus,
.itk-co-body form .form-row textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--focus-ring); }
.itk-co-body form .form-row.woocommerce-invalid input.input-text { border-color: var(--red); }

/* ---- Payment ------------------------------------------------- */
.itk-co-body #order_review_heading { display: none; }
.itk-co-body #payment { background: none; border-radius: 0; }
.itk-co-body #payment ul.payment_methods { padding: 0; border: 0; }
.itk-co-body #payment ul.payment_methods > li > label[for="payment_method_stripe"] { display: none; }
.itk-co-body #payment div.payment_box { margin: 0; padding: 0; background: none; color: var(--body); }
.itk-co-body #payment div.payment_box::before { display: none; }
.itk-co-body #payment fieldset.wc-upe-form { margin: 0; padding: 0; border: 0; }
.itk-co-body #payment div.form-row { padding: 0; margin-top: 20px; }
.itk-co-body .woocommerce-privacy-policy-text p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.itk-co-body #place_order { float: none; width: 100%; min-height: 54px; padding: 0 20px; font-size: 17px; font-weight: 700; color: var(--on-blue); background: var(--blue); border: 0; border-radius: 4px; cursor: pointer; }
.itk-co-body #place_order:hover { background: var(--blue-d); }
.itk-co-body #place_order:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus-ring); }

/* Notices that remain (errors): full width above the grid. */
.itk-co-body .woocommerce-NoticeGroup,
.itk-co-body .woocommerce-notices-wrapper:not(:empty) { grid-column: 1 / -1; }

/* Order bump (functions/digital-offers.php): the other guide, one click, above the payment methods. */
.itk-co-bump { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: start; margin: 0 0 18px; padding: 14px 16px; border: 2px dashed var(--blue); border-radius: 6px; background: var(--panel); }
.itk-co-bump img { width: 72px; height: 72px; object-fit: cover; border-radius: 4px; }
.itk-co-bump p { margin: 0; }
.itk-co-bump__h { font-weight: 700; font-size: 16px; color: var(--ink); line-height: 1.3; }
.itk-co-bump__h span { color: var(--blue); }
.itk-co-bump__p { font-size: 14px; line-height: 1.45; color: var(--body); margin-top: 4px !important; }
.itk-co-bump__go { display: inline-block; margin-top: 10px; background: var(--blue); color: var(--on-blue) !important; font-weight: 700; font-size: 14.5px; padding: 10px 16px; border-radius: 4px; text-decoration: none; }
.itk-co-bump__go:hover { background: var(--blue-d); }
@media (max-width: 420px) { .itk-co-bump { grid-template-columns: 56px 1fr; padding: 12px; } .itk-co-bump img { width: 56px; height: 56px; } }
.itk-co-item__remove { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 50%; color: var(--muted); font-size: 20px; line-height: 1; text-decoration: none; }
.itk-co-item__remove:hover, .itk-co-item__remove:focus-visible { color: var(--ink); border-color: var(--ink); }
