/* ---------- CHECKOUT WINDOW ---------- */
/* Loaded on cart.html in addition to styles.css (it uses the same colour variables). */

.checkout-overlay{
    position:fixed; inset:0;
    z-index:200;
    display:flex; align-items:flex-start; justify-content:center;
    padding:24px 16px;
    background:rgba(18,18,18,0.55);
    overflow-y:auto;
}
/* the hidden attribute must win over display:flex above */
.checkout-overlay[hidden],
.checkout-overlay [hidden]{ display:none !important; }

body.checkout-open{ overflow:hidden; }

.checkout-modal{
    position:relative;
    width:100%; max-width:480px;
    margin:auto;
    background:var(--paper);
    border-radius:4px;
    padding:36px 32px 28px;
    box-shadow:0 24px 60px rgba(18,18,18,0.28);
}
.checkout-close{
    position:absolute; top:10px; right:12px;
    font-family:inherit; font-size:26px; line-height:1;
    background:none; border:none; cursor:pointer;
    color:rgba(18,18,18,0.5);
    padding:6px 10px;
}
.checkout-close:hover{ color:var(--ink); }

.checkout-modal h2{
    font-size:24px; font-weight:800;
    margin-bottom:10px;
}
.checkout-sub{
    font-size:14px; line-height:1.6;
    color:rgba(18,18,18,0.62);
    margin-bottom:22px;
}

#checkoutForm{
    display:flex; flex-direction:column;
    gap:10px;
}
/* 16px so iPhones don't zoom the page when a field is tapped */
#checkoutForm input,
#checkoutForm select{
    font-family:inherit; font-size:16px;
    width:100%; min-width:0;
    padding:12px 14px;
    border:1px solid var(--line);
    border-radius:2px;
    background:#fff;
    color:var(--ink);
}
#checkoutForm input:focus-visible,
#checkoutForm select:focus-visible{
    outline:2px solid var(--blue);
    outline-offset:1px;
}
.checkout-row{ display:flex; gap:10px; }
.checkout-row > *{ flex:1; }

.checkout-summary{
    margin-top:14px;
    padding-top:14px;
    border-top:1px solid var(--line);
}
.checkout-line{
    display:flex; justify-content:space-between;
    font-size:14px;
    color:rgba(18,18,18,0.7);
    padding:4px 0;
}
.checkout-total{
    margin-top:6px; padding-top:12px;
    border-top:1px solid var(--line);
    font-size:17px; font-weight:700;
    color:var(--ink);
}

.checkout-error{
    min-height:0;
    font-size:13px; line-height:1.5;
    color:#B3261E;
    margin-top:4px;
}
.checkout-error:empty{ display:none; }

.checkout-pay{
    font-family:inherit; font-size:16px; font-weight:600;
    width:100%;
    background:var(--ink); color:var(--paper);
    border:none; border-radius:2px;
    padding:16px 20px;
    cursor:pointer;
    margin-top:8px;
    transition:background 0.2s ease;
}
.checkout-pay:hover:not(:disabled){ background:var(--blue); }
.checkout-pay:disabled{ opacity:0.55; cursor:not-allowed; }

.checkout-fine{
    text-align:center;
    font-size:12px;
    color:rgba(18,18,18,0.5);
    margin-top:10px;
}

.checkout-ref{
    font-size:13px; line-height:1.6;
    color:rgba(18,18,18,0.6);
    margin-bottom:22px;
    word-break:break-all;
}
.checkout-ref strong{ font-size:15px; color:var(--ink); }
.checkout-pay-link{
    display:block; text-align:center;
    text-decoration:none;
}
.checkout-secondary{
    font-family:inherit; font-size:15px; font-weight:600;
    width:100%;
    background:transparent; color:var(--ink);
    border:1px solid var(--line); border-radius:2px;
    padding:14px 20px;
    cursor:pointer;
    margin-top:10px;
}
.checkout-secondary:hover{ border-color:var(--ink); }

@media (max-width:480px){
    .checkout-overlay{ padding:0; }
    .checkout-modal{
        min-height:100%;
        border-radius:0;
        padding:56px 20px 24px;
    }
    .checkout-row{ flex-direction:column; }
}

/* size picker on each cart line */
.cart-item-size{
    font-family:inherit; font-size:13px; font-weight:600;
    margin-top:8px;
    padding:6px 28px 6px 10px;
    border:1px solid var(--line); border-radius:2px;
    background:#fff; color:var(--ink);
    max-width:100%;
}
.cart-item-size:focus-visible{ outline:2px solid var(--blue); outline-offset:1px; }
