/* ==========================================================================
   Edukall Site — commerce: the cart, the checkout and the page after paying.
   --------------------------------------------------------------------------
   Loaded after edukall-site.css only by the pages SiteStylesheets lists for
   this family, and before the skin's own layer. A rule lives here only when
   every page that can show what it styles is in this family: a component
   another family uses too belongs in edukall-site.css.
   ========================================================================== */

/* ── Cart and checkout (shopping_cart.php, checkout.php) ──────────────────── */

.s-cart, .s-checkout { padding-top: 32px; padding-bottom: 72px; }
.s-cart__head, .s-checkout__head { display: flex; flex-direction: column; gap: 6px; margin-bottom: 28px; }
.s-cart__head p { margin: 0; }
.s-cart__layout, .s-checkout__layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.s-checkout__layout { grid-template-columns: minmax(0, 1fr) 420px; grid-template-areas: "main summary"; }
.s-checkout__main { grid-area: main; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.s-checkout__summary { grid-area: summary; }
@media (max-width: 991.98px) {
    .s-cart__layout { grid-template-columns: minmax(0, 1fr); }
    /* On a phone what is being bought comes first, then how to pay for it. */
    .s-checkout__layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "main"; gap: 24px; }
}
.s-cart__back { margin-top: 20px; }
.s-cart__empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 64px 16px; border: 1px dashed var(--s-line); border-radius: var(--s-radius-lg); text-align: center; }
.s-cart__empty > .bi { font-size: 44px; color: var(--s-accent); }
.s-cart__empty p { margin: 0; max-width: 460px; }
.s-cart__more { margin-top: 64px; display: flex; flex-direction: column; gap: 20px; }
.s-cart__suggestion .s-btn { align-self: flex-start; }
.s-site .s-cart__suggestion .s-card-link__title { color: var(--s-ink); text-decoration: none; }

/* Order lines */
.s-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.s-line { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--s-line); }
.s-line:first-child { padding-top: 0; }
.s-line__thumb img { width: 120px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--s-radius-sm); background: var(--s-tint-3); display: block; }
.s-line__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.s-line__body p { margin: 0; }
.s-line__label { font-size: 13px; font-weight: 600; color: var(--s-accent); }
.s-line__title { font-family: var(--s-font-display); font-weight: 600; font-size: 18px; line-height: 1.3; }
.s-site .s-line__title a { color: var(--s-ink); text-decoration: none; }
.s-site .s-line__title a:hover { color: var(--s-accent); }
.s-line__notice, .s-line__gift { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--s-muted); }
.s-line__notice .bi, .s-line__gift .bi { color: var(--s-accent); margin-top: 2px; }
.s-line__facts { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.s-line__facts div { display: flex; flex-wrap: wrap; gap: 4px; }
.s-line__facts dt { font-weight: 400; color: var(--s-muted); }
.s-line__facts dt::after { content: ":"; }
.s-line__facts dd { margin: 0; font-weight: 600; }
.s-line__actions { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; }
.s-line__price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; white-space: nowrap; }
.s-line__price strong { font-size: 17px; }
.s-line__price del { font-size: 14px; color: var(--s-faint); }
@media (max-width: 575.98px) {
    .s-line { grid-template-columns: 88px minmax(0, 1fr); }
    .s-line__thumb img { width: 88px; }
    .s-line__price { grid-column: 2; flex-direction: row; gap: 8px; align-items: baseline; }
}
.s-line--compact { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; }
.s-line--compact .s-line__thumb img { width: 64px; }
.s-line--compact .s-line__title { font-size: 15px; }
.s-line--compact .s-line__facts, .s-line--compact .s-line__notice, .s-line--compact .s-line__gift { font-size: 13px; }
.s-line--compact .s-line__price strong { font-size: 15px; }
@media (max-width: 575.98px) { .s-line--compact .s-line__price { grid-column: auto; flex-direction: column; } }

/* The summary box */
.s-summary { position: sticky; top: var(--s-sticky-top, 96px); display: flex; flex-direction: column; gap: 16px; padding: 24px; border: 1px solid var(--s-line); border-radius: var(--s-radius-lg); background: var(--s-surface); box-shadow: var(--s-shadow); }
@media (max-width: 991.98px) { .s-summary { position: static; } }
.s-totals { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.s-totals div { display: flex; justify-content: space-between; gap: 12px; }
.s-totals dt { font-weight: 400; color: var(--s-muted); }
.s-totals dd { margin: 0; font-weight: 600; }
.s-totals__saving dt, .s-totals__saving dd { color: var(--s-accent); }
.s-totals__saving .bi { margin-right: 6px; }
.s-totals__total { padding-top: 12px; border-top: 1px solid var(--s-line); }
.s-totals__total dt { color: var(--s-ink); font-weight: 700; }
.s-totals__total dd { font-family: var(--s-font-display); font-size: 26px; line-height: 1.1; }
.s-totals__note { margin: -4px 0 0; display: flex; gap: 6px; align-items: center; font-size: 14px; color: var(--s-accent); }
.s-totals__charge { margin: 4px 0 0; display: flex; gap: 6px; align-items: baseline; font-size: 13px; color: var(--s-muted); }
.s-coupon details summary { display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.s-coupon details summary::-webkit-details-marker { display: none; }
.s-coupon__form { display: flex; gap: 8px; margin-top: 8px; }
.s-coupon__form .form-control { min-height: 44px; }
.s-coupon__applied { margin: 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--s-accent); font-weight: 600; }
.s-coupon__applied .bi { margin-right: 6px; }
.s-summary__secure { margin: -4px 0 0; display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; color: var(--s-muted); }
.s-site .s-summary__help { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--s-muted); text-decoration: none; }
.s-site .s-summary__help:hover { color: var(--s-accent); }

/* Checkout steps (not the home page's .s-step) */
.s-co-step { display: flex; flex-direction: column; gap: 18px; padding: 28px; border: 1px solid var(--s-line); border-radius: var(--s-radius-lg); background: var(--s-surface); }
@media (max-width: 575.98px) { .s-co-step { padding: 22px 18px; } }
.s-co-step--next { background: var(--s-band); border-color: transparent; opacity: .85; }
.s-co-step__head { display: flex; gap: 14px; align-items: flex-start; }
.s-co-step__head p { margin: 2px 0 0; }
.s-co-step__n { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 999px; background: var(--s-accent); color: var(--s-on-accent); font-weight: 700; }
.s-co-step--next .s-co-step__n { background: var(--s-surface); color: var(--s-muted); border: 1px solid var(--s-line); }
.s-co-step__count { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--s-muted); }
.s-co-step__reassure { margin: 0; display: flex; gap: 8px; font-size: 13px; color: var(--s-muted); }
.s-chosen { margin: 0; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--s-radius-sm); background: var(--s-bg); font-size: 15px; overflow-wrap: anywhere; }
.s-chosen .bi { margin-right: 8px; color: var(--s-accent); }
.s-methods-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.s-methods-preview li { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--s-surface); font-size: 14px; }

/* Payment methods: each a choice with what to know about it */
.s-methods { display: flex; flex-direction: column; gap: 10px; }
.s-method { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 14px 16px; border: 1px solid var(--s-line); border-radius: var(--s-radius); cursor: pointer; }
.s-method input { grid-row: span 2; margin-top: 4px; width: 18px; height: 18px; accent-color: var(--s-accent); }
.s-method__name { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
.s-method__hint { font-size: 13px; color: var(--s-muted); }
.s-method:has(input:checked) { border-color: var(--s-accent); background: var(--s-accent-soft); box-shadow: 0 0 0 1px var(--s-accent); }
.s-method:has(input:focus-visible) { outline: 3px solid var(--s-focus); outline-offset: 2px; }
.s-pay [hidden] { display: none; }
.s-pay__total { margin: 0 0 12px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 14px; border-top: 1px solid var(--s-line); }
.s-pay__total span { font-weight: 700; }
.s-pay__total strong { font-family: var(--s-font-display); font-size: 24px; line-height: 1.1; }
@media (min-width: 992px) { .s-pay__total { display: none; } }
.s-pay__note { margin: 10px 0 0; display: flex; gap: 8px; align-items: center; font-size: 14px; color: var(--s-muted); }
/* The PayPal slot when PayPal's script never arrived (paypal_gateway_script.php): said like a notice. */
.s-pay__note--error { padding: 12px 14px; border-radius: var(--s-radius-sm); background: var(--s-tint-2); color: var(--s-ink); }
.s-line__thumb img { height: auto; }
.s-checkout__brand { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 28px; }
.s-checkout__lock { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--s-muted); }
.s-summary__items summary { display: flex; justify-content: space-between; align-items: center; min-height: 44px; padding: 0 14px; border-radius: var(--s-radius-sm); background: var(--s-bg); font-weight: 600; cursor: pointer; list-style: none; }
.s-summary__items summary::-webkit-details-marker { display: none; }
.s-summary__items[open] summary .bi { transform: rotate(180deg); }
.s-summary__items .s-lines { margin-top: 8px; }
@media (min-width: 992px) {
    .s-summary__items summary { display: none; }
    .s-summary__items .s-lines { margin-top: 0; }
}

/* ── After paying (payment_success.php) ───────────────────────────────────── */

.s-receipt { max-width: 880px; padding-top: 48px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.s-receipt__head { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.s-receipt__head .s-lead { max-width: 620px; }
.s-receipt__mark { display: inline-flex; align-items: center; justify-content: center; width: 80px; height: 80px; border-radius: 999px; background: var(--s-accent); color: var(--s-on-accent); font-size: 40px; }
.s-receipt__mark--pending { background: var(--s-tint-2); color: var(--s-ink); font-size: 34px; }
.s-receipt__mail { margin: 0; display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; font-size: 15px; color: var(--s-muted); overflow-wrap: anywhere; }
.s-receipt__mail .bi { color: var(--s-accent); }
.s-receipt__voucher p { margin: 0 0 12px; }
.s-receipt__voucher > .bi { font-size: 24px; }
.s-receipt__order { position: static; }
.s-receipt__go { font-size: 14px; margin-top: 4px; }
.s-receipt__ref { margin: 0; font-size: 13px; color: var(--s-muted); overflow-wrap: anywhere; }
.s-receipt__ref span { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.s-receipt__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; }
.s-summary .s-lines > .s-line:last-child { border-bottom: 0; padding-bottom: 8px; }
