/* Book Checkout front end. Everything is scoped under .bkco so it stays out of your theme's way. */
.bkco { --bkco-accent: #1f3a5f; --bkco-border: #d9dde3; --bkco-muted: #667085; --bkco-bg: #f7f8fa; --bkco-err: #b42318; box-sizing: border-box; }
.bkco *, .bkco *::before, .bkco *::after { box-sizing: inherit; }
.bkco .screen-reader-text, .bkco-buybox .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Buttons */
.bkco-btn { display: inline-block; background: var(--bkco-accent); color: #fff !important; border: 2px solid var(--bkco-accent); border-radius: 6px; padding: .6em 1.2em; font: inherit; font-weight: 600; line-height: 1.2; text-decoration: none !important; cursor: pointer; transition: opacity .15s; }
.bkco-btn:hover, .bkco-btn:focus { opacity: .88; }
.bkco-btn:disabled { opacity: .5; cursor: not-allowed; }
.bkco-btn-secondary { background: transparent; color: var(--bkco-accent) !important; }
.bkco-btn-large { width: 100%; font-size: 1.1em; padding: .85em 1.2em; margin-top: 1em; }
.bkco-btn-small { padding: .3em .8em; font-size: .85em; margin-top: .4em; }
.bkco-link { background: none; border: 0; color: var(--bkco-err); font-size: 1.4em; line-height: 1; cursor: pointer; padding: 0 .3em; }

/* Book grid + cards */
.bkco-books { display: grid; gap: 28px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bkco-books.bkco-cols-1 { grid-template-columns: minmax(0, 360px); }
.bkco-books.bkco-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bkco-books.bkco-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bkco-books.bkco-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.bkco-books.bkco-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 800px) { .bkco-books { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; } }
@media (max-width: 480px) { .bkco-books { grid-template-columns: minmax(0, 1fr) !important; } }
.bkco-card { display: flex; flex-direction: column; }
.bkco-card-cover { display: block; background: var(--bkco-bg); border-radius: 6px; overflow: hidden; aspect-ratio: 2 / 3; }
.bkco-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bkco-card-nocover { display: flex; align-items: center; justify-content: center; height: 100%; padding: 1em; text-align: center; font-weight: 600; color: var(--bkco-muted); }
.bkco-card-title { font-size: 1.05em; margin: .7em 0 .2em; }

/* Buy box */
.bkco-buybox { margin: 1.5em 0; padding: 1em 0; }
.bkco-card .bkco-buybox { margin: 0; padding: .3em 0 0; }
.bkco-price { font-size: 1.4em; font-weight: 700; margin: 0 0 .4em; }
.bkco-price del { color: var(--bkco-muted); font-weight: 400; font-size: .8em; }
.bkco-price ins { text-decoration: none; }
.bkco-meta { margin: 0 0 .8em; display: flex; flex-wrap: wrap; gap: 6px; }
.bkco-badge { display: inline-block; background: var(--bkco-bg); border: 1px solid var(--bkco-border); border-radius: 999px; padding: .15em .7em; font-size: .78em; color: var(--bkco-muted); }
.bkco-badge-alt { border-color: var(--bkco-accent); color: var(--bkco-accent); background: transparent; }
.bkco-soldout, .bkco-lowstock { font-weight: 600; margin: .3em 0; }
.bkco-soldout { color: var(--bkco-err); }
.bkco-add-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.bkco-qty input { width: 4.5em; padding: .55em .4em; border: 1px solid var(--bkco-border); border-radius: 6px; font: inherit; }

/* Notices */
.bkco-notice { padding: .8em 1em; border-radius: 6px; background: #ecfdf3; border: 1px solid #abefc6; margin: 0 0 1em; }
.bkco-notice-error { background: #fef3f2; border-color: #fecdca; color: var(--bkco-err); }
.bkco-error { color: var(--bkco-err); font-weight: 600; }
.bkco-muted { color: var(--bkco-muted); display: block; font-size: .85em; }

/* Tables (cart, confirmation) */
.bkco-table { width: 100%; border-collapse: collapse; margin: 1em 0; }
.bkco-table th, .bkco-table td { padding: .7em .5em; border-bottom: 1px solid var(--bkco-border); text-align: left; vertical-align: top; }
.bkco-table td input[type=number] { width: 4.5em; padding: .4em; border: 1px solid var(--bkco-border); border-radius: 6px; }
.bkco-table tfoot th { text-align: right; font-weight: 500; }
.bkco-table .bkco-grand th, .bkco-table .bkco-grand td { font-weight: 700; font-size: 1.1em; }
.bkco-cart-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; }
.bkco-subtotal { margin: 0; text-align: right; flex: 1; }
.bkco-hidden-submit { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
@media (max-width: 640px) {
	.bkco-table thead { display: none; }
	.bkco-table tr { display: block; border-bottom: 1px solid var(--bkco-border); padding: .5em 0; }
	.bkco-table td { display: flex; justify-content: space-between; border: 0; padding: .3em 0; }
	.bkco-table td::before { content: attr(data-label); color: var(--bkco-muted); margin-right: 1em; }
}

/* Checkout */
.bkco-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
@media (max-width: 860px) { .bkco-grid { grid-template-columns: minmax(0, 1fr); } .bkco-side { order: -1; } }
.bkco-fieldset { border: 1px solid var(--bkco-border); border-radius: 8px; padding: 1em 1.2em 1.2em; margin: 0 0 1.2em; min-width: 0; }
.bkco-fieldset legend { font-weight: 700; padding: 0 .5em; }
.bkco-field { margin: 0 0 .9em; }
.bkco-field label { display: block; font-weight: 600; margin-bottom: .25em; }
.bkco-field input[type=text], .bkco-field input[type=email], .bkco-field input[type=tel], .bkco-field select, .bkco-field textarea { width: 100%; padding: .65em .7em; border: 1px solid var(--bkco-border); border-radius: 6px; font: inherit; background: #fff; }
.bkco-field input:focus, .bkco-field select:focus, .bkco-field textarea:focus { outline: 2px solid var(--bkco-accent); outline-offset: 1px; }
.bkco-req { color: var(--bkco-err); }
.bkco-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .bkco-row { grid-template-columns: 1fr; } }
.bkco-check { margin: .4em 0; }
.bkco-method { display: flex; gap: .6em; align-items: center; padding: .8em 1em; border: 1px solid var(--bkco-border); border-radius: 6px; margin: 0 0 .5em; cursor: pointer; font-weight: 600; }
.bkco-method:has(input:checked) { border-color: var(--bkco-accent); background: var(--bkco-bg); }
.bkco-panel { padding: .4em .2em 1em; }
.bkco-secure { font-size: .82em; color: var(--bkco-muted); margin: .6em 0 0; }
.bkco-hp { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.bkco-busy { opacity: .7; pointer-events: none; }
.bkco-counter { text-align: right; }

/* Order summary */
.bkco-side { background: var(--bkco-bg); border-radius: 8px; padding: 1.2em; position: sticky; top: 24px; }
.bkco-side h3 { margin-top: 0; }
.bkco-summary-lines { list-style: none; margin: 0 0 1em; padding: 0; }
.bkco-summary-lines li { display: flex; justify-content: space-between; gap: 1em; padding: .4em 0; border-bottom: 1px solid var(--bkco-border); }
.bkco-totals > div { display: flex; justify-content: space-between; padding: .3em 0; }
.bkco-totals dt, .bkco-totals dd { margin: 0; }
.bkco-totals .bkco-grand { font-weight: 700; font-size: 1.15em; border-top: 2px solid var(--bkco-accent); margin-top: .4em; padding-top: .6em; }
.bkco-totals [hidden] { display: none; }

/* Confirmation */
.bkco-order-no { color: var(--bkco-muted); }
.bkco-box { background: var(--bkco-bg); border-radius: 8px; padding: 1em 1.2em; margin: 1em 0; }
.bkco-box h3 { margin-top: 0; font-size: 1em; }
.bkco-giftnote { margin: .5em 0 0; padding: .6em 1em; border-left: 4px solid var(--bkco-accent); background: #fff; }
.bkco-instructions { background: var(--bkco-bg); border-radius: 8px; padding: .6em 1.2em; margin: 1em 0; }
