/**
 * Store checkout — matches store-catalog (ink rail + sky accent + clean white canvas)
 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:opsz,wght@9..40,500;9..40,600;9..40,700&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap');

html:has(body.checkout-page) {
    margin: 0 !important;
    padding: 0 !important;
    background: #eef1f5 !important;
}

body.checkout-page {
    --co-ink: #1a1d23;
    --co-ink-2: #22262e;
    --co-blue: #0ea5e9;
    --co-blue-hot: #0284c7;
    --co-green: #15803d;
    --co-canvas: #eef1f5;
    --co-card: #ffffff;
    --co-line: #d5dbe3;
    --co-muted: #6b7280;
    --co-text: #111827;
    --co-danger: #dc2626;
    --co-nav-h: 44px;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh;
    font-family: "IBM Plex Sans", "DM Sans", system-ui, sans-serif;
    background:
        radial-gradient(900px 420px at 12% -10%, rgba(14, 165, 233, 0.14), transparent 55%),
        radial-gradient(700px 380px at 100% 0%, rgba(26, 29, 35, 0.08), transparent 50%),
        var(--co-canvas) !important;
    color: var(--co-text);
    overflow-x: hidden;
}

body.checkout-page .co-topnav {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    height: var(--co-nav-h);
    padding: 0 18px;
    background: var(--co-ink);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
}

body.checkout-page .co-topnav__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 0.02em;
}

body.checkout-page .co-topnav__brand:hover {
    color: #fff;
    opacity: 0.92;
}

body.checkout-page .co-topnav__back {
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

body.checkout-page .co-topnav__back:hover {
    color: #fff;
}

body.checkout-page .co-shell {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 18px 56px;
    box-sizing: border-box;
}

body.checkout-page .co-heading {
    margin: 0 0 6px;
    font-family: "DM Sans", "IBM Plex Sans", sans-serif;
    font-size: clamp(1.55rem, 2.4vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--co-ink);
}

body.checkout-page .co-subhead {
    margin: 0 0 22px;
    color: var(--co-muted);
    font-size: 14px;
    line-height: 1.45;
}

body.checkout-page .co-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
    gap: 22px;
    align-items: start;
}

body.checkout-page .co-panel {
    background: var(--co-card);
    border: 1px solid var(--co-line);
    border-radius: 14px;
    box-shadow: 0 10px 28px rgba(17, 24, 39, 0.06);
    overflow: hidden;
}

body.checkout-page .co-panel__body {
    padding: 22px 22px 8px;
}

body.checkout-page .co-section {
    margin-bottom: 22px;
    padding-bottom: 6px;
}

body.checkout-page .co-section__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--co-ink);
}

body.checkout-page .co-section__step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: rgba(14, 165, 233, 0.12);
    color: var(--co-blue-hot);
    font-size: 12px;
    font-weight: 700;
}

body.checkout-page .co-field {
    margin-bottom: 14px;
}

body.checkout-page .co-field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--co-text);
}

body.checkout-page .co-field small,
body.checkout-page .co-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.4;
    color: var(--co-muted);
}

body.checkout-page .co-field .form-control,
body.checkout-page .co-field input.form-control,
body.checkout-page .co-field select.form-control {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
    color: var(--co-text);
    font: inherit;
    font-size: 15px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.checkout-page .co-field .form-control:focus {
    outline: none;
    border-color: var(--co-blue);
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}

body.checkout-page .co-field .form-control[readonly] {
    background: #f3f5f8;
    color: #374151;
}

body.checkout-page .co-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

body.checkout-page .co-coupon {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    align-items: stretch;
}

body.checkout-page .co-coupon .form-control {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

body.checkout-page .co-coupon__tag {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 10px;
    border: 1px dashed var(--co-line);
    background: #f8fafc;
    color: var(--co-muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

body.checkout-page .co-pay-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

body.checkout-page .co-pay {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

body.checkout-page .co-pay input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

body.checkout-page .co-pay__card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 78px;
    padding: 14px 14px 12px;
    border: 1.5px solid var(--co-line);
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

body.checkout-page .co-pay__name {
    font-size: 14px;
    font-weight: 700;
    color: var(--co-ink);
}

body.checkout-page .co-pay__meta {
    font-size: 12px;
    color: var(--co-muted);
    line-height: 1.35;
}

body.checkout-page .co-pay:hover .co-pay__card {
    border-color: #94a3b8;
}

body.checkout-page .co-pay input:focus-visible + .co-pay__card {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

body.checkout-page .co-pay input:checked + .co-pay__card {
    border-color: var(--co-blue);
    background: linear-gradient(180deg, rgba(14, 165, 233, 0.08), #fff 55%);
    box-shadow: 0 0 0 1px var(--co-blue);
}

body.checkout-page .co-gateway-panel {
    margin-top: 12px;
    display: none;
}

body.checkout-page .co-gateway-panel.is-open {
    display: block;
}

body.checkout-page #stripe-card-element,
body.checkout-page #payment-element {
    padding: 14px 12px;
    border: 1.5px solid var(--co-line);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 8px;
}

body.checkout-page #stripe-card-errors {
    color: var(--co-danger);
    font-size: 13px;
    min-height: 1.2em;
}

body.checkout-page .co-note {
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid #c7e0f5;
    background: #f0f9ff;
    color: #0c4a6e;
    font-size: 13.5px;
    line-height: 1.45;
}

body.checkout-page .co-note--warn {
    border-color: #fde68a;
    background: #fffbeb;
    color: #92400e;
}

body.checkout-page .co-note strong {
    display: block;
    margin-bottom: 4px;
}

body.checkout-page .co-alert {
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.4;
}

body.checkout-page .co-alert--danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

body.checkout-page .co-alert--success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

body.checkout-page .co-alert--info {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0c4a6e;
}

body.checkout-page .co-actions {
    padding: 8px 22px 22px;
}

body.checkout-page .co-submit {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--co-blue) 0%, var(--co-blue-hot) 100%);
    color: #fff !important;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(2, 132, 199, 0.28);
    transition: transform 0.12s ease, filter 0.12s ease;
}

body.checkout-page .co-submit:hover {
    filter: brightness(1.03);
    transform: translateY(-1px);
}

body.checkout-page .co-submit:active {
    transform: translateY(0);
}

body.checkout-page .co-secure {
    margin-top: 10px;
    text-align: center;
    font-size: 12px;
    color: var(--co-muted);
}

body.checkout-page .co-summary {
    position: sticky;
    top: calc(var(--co-nav-h) + 14px);
}

body.checkout-page .co-summary__head {
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--co-line);
    background: linear-gradient(180deg, #f8fafc, #fff);
}

body.checkout-page .co-summary__eyebrow {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--co-muted);
}

body.checkout-page .co-summary__product {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

body.checkout-page .co-summary__thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    object-fit: cover;
    background: #e5e7eb;
    border: 1px solid var(--co-line);
    flex-shrink: 0;
}

body.checkout-page .co-summary__thumb--empty {
    display: grid;
    place-items: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--co-muted);
    text-align: center;
    padding: 6px;
}

body.checkout-page .co-summary__name {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--co-ink);
}

body.checkout-page .co-summary__meta {
    margin: 0;
    font-size: 12.5px;
    color: var(--co-muted);
    line-height: 1.4;
}

body.checkout-page .co-summary__body {
    padding: 16px 20px 18px;
}

body.checkout-page .co-summary__row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 10px;
    font-size: 13.5px;
    color: #374151;
}

body.checkout-page .co-summary__row span:last-child {
    font-weight: 600;
    text-align: right;
}

body.checkout-page .co-summary__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--co-line);
}

body.checkout-page .co-summary__total strong:first-child {
    font-size: 14px;
}

body.checkout-page .co-summary__price {
    font-family: "DM Sans", sans-serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--co-ink);
}

body.checkout-page .co-summary__was {
    margin-left: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--co-muted);
    text-decoration: line-through;
}

body.checkout-page .co-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin: 4px 6px 0 0;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #334155;
    font-size: 11px;
    font-weight: 600;
}

body.checkout-page .co-pill--sale {
    background: #dcfce7;
    color: var(--co-green);
}

body.checkout-page .co-pill--emby {
    background: #dcfce7;
    color: #166534;
}

body.checkout-page .co-pill--jellyfin {
    background: #e0f2fe;
    color: #075985;
}

body.checkout-page .co-trust {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid var(--co-line);
}

body.checkout-page .co-trust li {
    margin: 0 0 6px;
    padding-left: 0;
    list-style: none;
    font-size: 12.5px;
    color: #475569;
    line-height: 1.35;
}

body.checkout-page .co-trust li:last-child {
    margin-bottom: 0;
}

body.checkout-page .co-trust ul {
    margin: 0;
    padding: 0;
}

body.checkout-page .co-upsell {
    display: block;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #9a3412;
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
}

@keyframes co-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

body.checkout-page .co-layout > * {
    animation: co-fade-up 0.35s ease both;
}

body.checkout-page .co-summary {
    animation-delay: 0.06s;
}

body.checkout-page .co-coupon-details {
    margin-top: 4px;
    border: 1px solid var(--co-line);
    border-radius: 10px;
    background: #f8fafc;
    overflow: hidden;
}

body.checkout-page .co-coupon-details > summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 600;
    font-size: 14px;
    color: var(--co-muted);
}

body.checkout-page .co-coupon-details > summary::-webkit-details-marker {
    display: none;
}

body.checkout-page .co-coupon-details[open] > summary {
    color: var(--co-text);
    border-bottom: 1px solid var(--co-line);
}

body.checkout-page .co-coupon-details .co-field {
    padding: 0 14px 14px;
}

@media (max-width: 860px) {
    body.checkout-page .co-layout {
        grid-template-columns: 1fr;
    }
    body.checkout-page .co-summary {
        position: static;
        order: -1;
    }
    body.checkout-page .co-shell {
        padding: 18px 12px 40px;
    }
}

@media (max-width: 560px) {
    body.checkout-page .co-grid-2,
    body.checkout-page .co-pay-grid {
        grid-template-columns: 1fr;
    }
    body.checkout-page .co-panel__body,
    body.checkout-page .co-actions {
        padding-left: 16px;
        padding-right: 16px;
    }
    body.checkout-page .co-topnav {
        padding: 0 12px;
    }
    body.checkout-page .co-optional-name {
        display: none;
    }
    body.checkout-page .co-pay-sticky {
        position: sticky;
        bottom: 0;
        z-index: 8;
        padding: 10px 0 6px;
        background: linear-gradient(180deg, transparent, var(--co-card, #fff) 28%);
    }
    body.checkout-page .co-pay-sticky .sf-btn,
    body.checkout-page .co-pay-sticky button[type="submit"] {
        width: 100%;
        min-height: 48px;
        font-size: 16px;
    }
    body.checkout-page.sf-cart-checkout .sf-form-group input,
    body.checkout-page.sf-cart-checkout .sf-form-group select {
        min-height: 48px;
        font-size: 16px;
    }
}

body.checkout-page .co-get-line {
    margin: 4px 0 0;
    font-size: 12px;
    color: #0f766e;
    font-weight: 600;
    line-height: 1.35;
}
