/**
 * Article Purchase — Checkout page.
 */

.checkout-wrap {
    max-width: 640px;
    margin: 40px auto 60px;
    padding: 0 16px;
}

.checkout-title {
    font-family: var(--font-display, "Playfair Display", serif);
    font-size: clamp(22px, 3vw, 28px);
    font-weight: 800;
    color: var(--navy-900, #0f2a52);
    margin: 0 0 20px;
}

.checkout-cart-section {
    margin-bottom: 24px;
}

.checkout-cart-box {
    background: var(--white, #fff);
    border: 1px solid var(--line, #e3e9f0);
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15, 42, 82, 0.06);
}

.checkout-cart-box--empty {
    padding: 20px 22px;
}

.checkout-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: var(--sky-50, #eef4fa);
    border-bottom: 1px solid var(--line, #e3e9f0);
}

.checkout-cart-heading {
    margin: 0;
    font-family: var(--font-display, "Playfair Display", serif);
    font-size: 15px;
    font-weight: 700;
    color: var(--navy-900, #0f2a52);
}

.checkout-cart-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--navy-800, #133a6f);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.checkout-cart-box .article-purchase-checkout-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.checkout-cart-box .checkout-cart-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--line, #e3e9f0);
}

.checkout-cart-box .checkout-cart-item:last-child {
    border-bottom: none;
}

.checkout-cart-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.checkout-cart-item-doi {
    display: inline-block;
    align-self: flex-start;
    max-width: 100%;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--sky-50, #eef4fa);
    border: 1px solid var(--line, #e3e9f0);
    font-size: 11px;
    font-weight: 600;
    font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
    color: var(--navy-700, #1e4d8c);
    word-break: break-all;
    line-height: 1.4;
}

.checkout-cart-item-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--navy-900, #0f2a52);
    line-height: 1.45;
    word-break: break-word;
}

.checkout-cart-item-authors {
    font-size: 13px;
    color: var(--ink-500, #5c6a7d);
    line-height: 1.45;
    word-break: break-word;
}

.checkout-cart-box .article-purchase-cart-remove {
    border: none;
    background: transparent;
    color: var(--ink-400, #8494a7);
    font-size: 20px;
    cursor: pointer;
    line-height: 1;
    padding: 2px 4px;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.15s, background 0.15s;
}

.checkout-cart-box .article-purchase-cart-remove:hover {
    color: var(--red-600, #c8102e);
    background: rgba(200, 16, 46, 0.08);
}

.checkout-cart-box .checkout-cart-empty {
    margin: 0;
    font-size: 14px;
    color: var(--ink-500, #5c6a7d);
    text-align: center;
}

.checkout-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.checkout-form-card {
    background: var(--white, #fff);
    border: 1px solid var(--line, #e3e9f0);
    border-radius: 14px;
    padding: 28px 28px 24px;
    box-shadow: 0 1px 3px rgba(15,42,82,0.06);
}

.checkout-field {
    margin-bottom: 18px;
}

.checkout-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-700, #2e3a4b);
    margin-bottom: 6px;
}

.checkout-field .req { color: var(--red-600, #c8102e); margin-left: 2px; }

.checkout-field input[type="text"],
.checkout-field input[type="email"],
.checkout-field select {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--line, #e3e9f0);
    border-radius: 8px;
    font-size: 14px;
    color: var(--ink-900, #0a1628);
    background: var(--white, #fff);
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.checkout-field select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238494a7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

.checkout-field input:focus,
.checkout-field select:focus {
    border-color: var(--navy-600, #2a5fa8);
    box-shadow: 0 0 0 3px rgba(42,95,168,0.1);
}

.checkout-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--line, #e3e9f0);
}

.checkout-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 28px;
    height: 44px;
    background: var(--red-600, #c8102e);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.checkout-submit-btn:hover { background: var(--red-700, #a50d26); }

.checkout-cancel-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink-500, #5c6a7d);
    text-decoration: none;
    transition: color 0.15s;
}

.checkout-cancel-link:hover { color: var(--red-600, #c8102e); }

/* Validation error states */
.checkout-field input.input-error,
.checkout-field select.input-error {
    border-color: var(--red-600, #c8102e);
    box-shadow: 0 0 0 3px rgba(200,16,46,0.1);
}

.checkout-field-msg {
    font-size: 12px;
    color: var(--red-600, #c8102e);
    margin-top: 4px;
    display: none;
}

.checkout-field-msg.visible { display: block; }
