/*
 * Checkout page. Scoped to .checkout-page so the shared form/summary styles elsewhere are untouched.
 * Layout: form column + sticky summary; one column under 960px (summary under the form; the Place order button repeats the total).
 */
.checkout-page { --co-ink:#1a2233; --co-muted:#667085; --co-line:#e4e7ee; --co-accent:#e04420; --co-soft:#fdf0ec; align-items: start; }
.checkout-page.order-layout { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr); gap: clamp(16px, 2.4vw, 30px); }
.checkout-page .order-main { gap: 16px; }

.co-card { background:#fff; border:1px solid var(--co-line); border-radius:16px; padding: clamp(16px, 2vw, 24px); box-shadow: 0 1px 2px rgba(16,24,40,.04); }
.co-title { display:flex; align-items:center; gap:10px; margin:0 0 4px; font-size: clamp(1rem, 1.3vw, 1.15rem); font-weight:700; color:var(--co-ink); }
.co-step { display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:50%; background:var(--co-accent); color:#fff; font-size:13px; font-weight:700; flex:none; }
.co-sub { margin:0 0 16px 36px; color:var(--co-muted); font-size:13.5px; }
.co-title + .co-grid, .co-title + .co-saved { margin-top: 16px; }
.co-alert { margin:0; padding:12px 16px; border-radius:12px; background:#fffaeb; border:1px solid #fedf89; color:#7a4a07; font-size:14px; }

/* Pincode strip */
.co-pincode { display:flex; align-items:center; justify-content:space-between; gap:14px 20px; flex-wrap:wrap; padding: 14px clamp(16px, 2vw, 22px); background: var(--co-soft); border-color:#f8d5ca; }
.co-kicker { display:block; font-size:11.5px; font-weight:700; letter-spacing:.07em; text-transform:uppercase; color:#b9381c; }
.co-pincode-text strong { font-size:15px; color:var(--co-ink); }
.co-pincode-form { display:flex; gap:8px; flex:0 1 340px; min-width:0; }
.co-pincode-form input { flex:1; min-width:0; height:40px; padding:0 12px; border:1px solid #f0c6b9; border-radius:10px; background:#fff; font-size:14px; }
.co-pincode-form input:focus { outline:none; border-color:var(--co-accent); box-shadow:0 0 0 3px rgba(224,68,32,.12); }
.co-btn { height:40px; padding:0 18px; border-radius:10px; border:1px solid var(--co-line); background:#fff; color:var(--co-ink); font-weight:700; font-size:13px; letter-spacing:.04em; text-transform:uppercase; cursor:pointer; transition:background .15s, border-color .15s; }
.co-btn:hover { background:#f4f6fa; border-color:#cfd5e1; }

/* Saved addresses */
.co-saved { display:grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap:12px; }
.co-saved-card { position:relative; display:block; cursor:pointer; margin:0; }
.co-saved-card input { position:absolute; opacity:0; inset:0; width:100%; height:100%; margin:0; cursor:pointer; }
.co-saved-body { display:flex; flex-direction:column; gap:3px; height:100%; padding:14px 16px 14px 44px; border:1.5px solid var(--co-line); border-radius:14px; background:#fff; font-size:13.5px; color:var(--co-muted); line-height:1.45; transition:border-color .15s, background .15s, box-shadow .15s; position:relative; }
.co-saved-body::before { content:""; position:absolute; left:15px; top:16px; width:18px; height:18px; border-radius:50%; border:2px solid #cfd5e1; background:#fff; box-sizing:border-box; transition:border-color .15s, box-shadow .15s; }
.co-saved-body strong { color:var(--co-ink); font-size:14.5px; display:flex; align-items:center; gap:8px; }
.co-saved-body em { font-style:normal; font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--co-soft); color:#b9381c; }
.co-saved-card input:checked + .co-saved-body { border-color:var(--co-accent); background:#fffaf8; box-shadow:0 0 0 3px rgba(224,68,32,.1); }
.co-saved-card input:checked + .co-saved-body::before { border-color:var(--co-accent); box-shadow: inset 0 0 0 4px #fff, inset 0 0 0 9px var(--co-accent); }
.co-saved-card input:focus-visible + .co-saved-body { outline:2px solid var(--co-accent); outline-offset:2px; }

/* Form grid */
.co-grid { display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px 16px; }
.co-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.co-field.wide { grid-column: 1 / -1; }
.co-label { font-size:13px; font-weight:600; color:var(--co-ink); }
.co-label em { font-style:normal; font-weight:400; color:var(--co-muted); }
.checkout-page .co-field input[type="text"],
.checkout-page .co-field input[type="tel"],
.checkout-page .co-field input[type="email"],
.checkout-page .co-field input:not([type]),
.checkout-page .co-field select,
.checkout-page .co-field textarea {
    width:100%; box-sizing:border-box; height:44px; padding:0 14px; border:1px solid #d0d5dd; border-radius:10px;
    background:#fff; color:var(--co-ink); font-size:14.5px; font-family:inherit; transition:border-color .15s, box-shadow .15s;
}
.checkout-page .co-field textarea { height:96px !important; min-height:80px; max-height:240px; padding:11px 14px; line-height:1.5; resize:vertical; }
.checkout-page .co-field select { appearance:none; -webkit-appearance:none; padding-right:38px;
    background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' 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 12px center; }
.checkout-page .co-field input::placeholder, .checkout-page .co-field textarea::placeholder { color:#98a2b3; }
.checkout-page .co-field input:hover, .checkout-page .co-field select:hover, .checkout-page .co-field textarea:hover { border-color:#b8c0d0; }
.checkout-page .co-field input:focus, .checkout-page .co-field select:focus, .checkout-page .co-field textarea:focus { outline:none; border-color:var(--co-accent); box-shadow:0 0 0 3px rgba(224,68,32,.12); }
.co-field.has-error input, .co-field.has-error select { border-color:#d92d20; }
.co-error { color:#d92d20; font-size:12.5px; }

/* Address type as chips */
.co-chips { display:flex; gap:10px; flex-wrap:wrap; }
.co-chip { position:relative; margin:0; cursor:pointer; }
.co-chip input { position:absolute; opacity:0; inset:0; width:100%; height:100%; margin:0; cursor:pointer; }
.co-chip span { display:inline-flex; align-items:center; height:38px; padding:0 20px; border:1.5px solid #d0d5dd; border-radius:999px; background:#fff; font-size:14px; font-weight:600; color:#344054; transition:all .15s; }
.co-chip:hover span { border-color:#b8c0d0; background:#f8f9fc; }
.co-chip input:checked + span { border-color:var(--co-accent); background:var(--co-soft); color:#b9381c; }
.co-chip input:focus-visible + span { outline:2px solid var(--co-accent); outline-offset:2px; }

/* Default-address checkbox */
.co-check { display:flex; align-items:center; gap:10px; margin:0; cursor:pointer; font-size:14px; color:var(--co-ink); }
.co-check input { width:18px; height:18px; margin:0; accent-color:var(--co-accent); flex:none; }

/* Place order */
.co-place { display:flex; align-items:center; justify-content:space-between; gap:16px; width:100%; height:54px; padding:0 22px; border:0; border-radius:14px; background:var(--co-accent); color:#fff; font-size:15px; font-weight:700; letter-spacing:.05em; text-transform:uppercase; cursor:pointer; box-shadow:0 12px 24px -12px rgba(224,68,32,.7); transition:transform .15s, filter .15s, box-shadow .15s; }
.co-place span { font-size:15px; letter-spacing:0; padding:5px 12px; border-radius:8px; background:rgba(255,255,255,.18); }
.co-place:hover { filter:brightness(1.06); transform:translateY(-1px); box-shadow:0 16px 28px -12px rgba(224,68,32,.75); }

/* Summary */
.co-summary { padding: clamp(18px, 2vw, 26px) !important; border-radius:16px !important; border:1px solid var(--co-line) !important; background:#fff; box-shadow:0 1px 2px rgba(16,24,40,.04); }
.co-summary h2 { margin:0 0 14px; font-size: clamp(1.1rem, 1.5vw, 1.3rem); }
.co-lines { display:flex; flex-direction:column; gap:12px; padding-bottom:14px; border-bottom:1px dashed var(--co-line); }
.co-line { display:flex; justify-content:space-between; align-items:flex-start; gap:14px; }
.co-line > div { min-width:0; }
.co-line-name { display:block; font-size:14px; font-weight:600; color:var(--co-ink); overflow-wrap:anywhere; }
.co-line-name b { color:var(--co-muted); font-weight:600; white-space:nowrap; }
.co-line small { display:block; margin-top:3px; font-size:12.5px; color:var(--co-muted); }
.co-line strong { font-size:14px; white-space:nowrap; }
.co-rows { padding:12px 0 4px; }
.co-summary .summary-row { display:flex; justify-content:space-between; gap:12px; padding:7px 0; font-size:14px; color:#475467; border:0; }
.co-summary .summary-row strong { color:var(--co-ink); font-weight:600; }
.co-summary .co-total { margin-top:8px; padding-top:14px; border-top:1px solid var(--co-line); font-size:17px; }
.co-summary .co-total span { color:var(--co-ink); font-weight:700; }
.co-summary .co-total strong { font-size:20px; font-weight:800; color:var(--co-accent); }
.co-secure { margin:14px 0 0; text-align:center; font-size:12.5px; color:var(--co-muted); }

.checkout-page .order-summary-panel { position: sticky; top: 24px; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1100px) { .checkout-page.order-layout { grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); } }
@media (max-width: 960px) {
    .checkout-page.order-layout { grid-template-columns: minmax(0, 1fr); }
    .checkout-page .order-summary-panel { position: static; }
    .co-summary .co-secure { display:none; }
}
@media (max-width: 600px) {
    .co-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
    .co-pincode-form { flex: 1 1 100%; }
    .co-sub { margin-left: 0; }
    .co-saved { grid-template-columns: minmax(0, 1fr); }
    .co-place { height: 52px; font-size: 14px; }
    .checkout-page .co-field input[type="text"], .checkout-page .co-field select { height: 46px; font-size: 16px; } /* 16px stops iOS zoom on focus */
}
