.abs-booklist-form { max-width: 100%; }

.abs-bf-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 18px;
}

.abs-bf-back { display: inline-block; margin-bottom: 6px; font-size: 13px; text-decoration: none; }
.abs-bf-head h2 { margin: 0 0 4px; }
.abs-bf-head p { margin: 0; color: #646970; }

.abs-bf-instructions {
    background: #f8fbff;
    border: 1px solid #c5d9ed;
    border-left: 4px solid var(--global-palette2, #2271b1);
    border-radius: 8px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.abs-bf-card {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    padding: 22px;
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
}

.abs-bf-card h3 { margin-top: 0; }

.abs-bf-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 28px;
    margin: 18px 0;
}

.abs-bf-columns h4 {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e5e5;
}

.abs-bf-group {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 11px 12px;
    margin-bottom: 8px;
    border: 1px solid #e3e4e6;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color .14s ease, background-color .14s ease;
}

.abs-bf-group:hover { border-color: var(--global-palette2, #2271b1); background: #fafbfc; }
.abs-bf-group.is-locked { background: #f6f7f7; cursor: default; }

.abs-bf-group input[type="checkbox"] {
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    margin: 3px 0 0 !important;
    flex: 0 0 auto;
}

.abs-bf-group-body { display: block; }
.abs-bf-group-body strong { display: block; }
.abs-bf-group-body small { display: block; color: #646970; margin-top: 3px; }
.abs-bf-group-body em { display: block; color: #646970; font-style: normal; font-size: 13px; margin-top: 4px; }

.abs-bf-lock {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e9ecff;
    color: #2b3ea8;
    font-size: 11px;
    font-weight: 700;
    vertical-align: 1px;
}

.abs-bf-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e5e5;
}

.abs-bf-selected-count { color: #646970; }
.abs-bf-none { color: #646970; }

.abs-bf-toolbar { margin-bottom: 16px; }
.abs-bf-section { margin-bottom: 26px; }
.abs-bf-section h3 { text-transform: uppercase; font-size: 15px; letter-spacing: .02em; }

.abs-bf-table { width: 100%; border-collapse: collapse; }

.abs-bf-table th {
    background: #1d2327;
    color: #fff;
    text-align: left;
    padding: 9px 12px;
    font-size: 13px;
}

.abs-bf-table th:nth-child(2),
.abs-bf-table th:nth-child(3),
.abs-bf-table th:nth-child(4) { width: 110px; text-align: right; }

.abs-bf-table td { padding: 10px 12px; border-bottom: 1px solid #eee; vertical-align: middle; }
.abs-bf-table tbody tr:nth-child(even) { background: #fafbfc; }
.abs-bf-table td small { display: block; color: #646970; font-size: 12px; }

.abs-bf-qty-cell, .abs-bf-price, .abs-bf-line { text-align: right; }
.abs-bf-line { font-variant-numeric: tabular-nums; }

.abs-bf-qty {
    width: 68px !important;
    min-height: 34px !important;
    text-align: center;
    border: 1px solid #8c8f94 !important;
    border-radius: 4px !important;
}

.abs-bf-note td { background: #fffdf4; color: #6a4b00; font-style: italic; }
.abs-bf-oos { color: #b32d2e; font-size: 12px; font-weight: 600; }
.abs-bf-fixed { color: #646970; }
tr.is-unavailable { opacity: .6; }

.abs-bf-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.abs-bf-badge.optional { background: #eef1f4; color: #50575e; }
.abs-bf-badge.recommended { background: #fff4ce; color: #6a4b00; }

.abs-bf-total-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 24px;
    padding: 14px 12px;
    background: var(--global-palette2, #2271b1);
    color: #fff;
    border-radius: 6px;
    font-size: 17px;
}

.abs-bf-confirm { display: flex; align-items: center; gap: 8px; margin: 18px 0; }
.abs-bf-confirm input { width: 16px !important; height: 16px !important; min-height: 16px !important; margin: 0 !important; }

.abs-bf-actions { display: flex; justify-content: flex-end; }
.abs-bf-add.is-loading { opacity: .7; pointer-events: none; }

.abs-bf-message { margin-top: 14px; padding: 12px 14px; border-radius: 6px; }
.abs-bf-message.error { background: #fff8f8; border: 1px solid #f0c1c8; color: #8a2424; }

.abs-bf-message.warning {
    background: #fffdf4;
    border: 1px solid #f0e0a8;
    color: #6a4b00;
}

.abs-bf-message.warning a {
    font-weight: 600;
    text-decoration: underline;
}

.abs-form-empty { background: #fff; border: 1px solid #dcdcde; border-radius: 10px; padding: 28px; text-align: center; }

/* Full-width focused layout on the BookList form endpoint */
.abs-booklist-form-page .woocommerce-MyAccount-navigation,
.abs-booklist-form-page .account-navigation-wrap,
.abs-booklist-form-page .woocommerce-MyAccount-navigation-wrap {
    display: none !important;
}

.abs-booklist-form-page .woocommerce-MyAccount-content {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.abs-booklist-form-page .woocommerce-account .woocommerce {
    display: block !important;
}

.abs-booklist-form-page .abs-booklist-form {
    max-width: 1100px;
    margin: 0 auto;
    padding: 50px 0px;
}

/* Hide theme page header on the BookList form endpoint */
.abs-booklist-form-page .entry-header.page-title,
.abs-booklist-form-page .base-breadcrumbs {
    display: none !important;
}

.abs-booklist-form-page .content-area,
.abs-booklist-form-page .site-main {
    padding-top: 28px !important;
}

@media (max-width: 782px) {
    .abs-bf-columns { grid-template-columns: 1fr; }
    .abs-bf-head { flex-direction: column; }
    .abs-bf-summary { flex-direction: column; align-items: stretch; }
}

@media print {
    .abs-bf-back, .abs-bf-print, .abs-bf-toolbar, .abs-bf-confirm,
    .abs-bf-actions, .woocommerce-MyAccount-navigation, header, footer { display: none !important; }
    .abs-bf-card { border: 0; box-shadow: none; padding: 0; }
}

/* ============================================================
   v0.7.13 — Replace confirmation dialog
   ============================================================ */

.abs-bf-dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .55);
}

.abs-bf-dialog {
    width: 100%;
    max-width: 480px;
    padding: 26px 28px 22px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28);
}

.abs-bf-dialog h3 {
    margin: 0 0 12px;
    font-size: 19px;
    line-height: 1.3;
}

.abs-bf-dialog p {
    margin: 0 0 12px;
    color: #4b5563;
    line-height: 1.55;
}

.abs-bf-dialog p:last-of-type {
    margin-bottom: 20px;
}

.abs-bf-dialog-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.abs-bf-dialog-actions .button {
    margin: 0;
}

.abs-bf-dialog-cart {
    margin-right: auto !important;
}

@media (max-width: 520px) {
    .abs-bf-dialog {
        padding: 22px 20px 18px;
    }

    .abs-bf-dialog-actions {
        flex-direction: column-reverse;
    }

    .abs-bf-dialog-actions .button {
        width: 100%;
        text-align: center;
    }

    .abs-bf-dialog-cart {
        margin-right: 0 !important;
    }
}

/* ============================================================
   v0.7.13 — Guest notice on the BookList form
   Append to assets/booklist-form.css
   ============================================================ */

.abs-bf-guest-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
    margin: 0 0 20px;
    padding: 13px 16px;
    background: #f8fbff;
    border-left: 3px solid #2271b1;
    border-radius: 4px;
    line-height: 1.5;
}

.abs-bf-guest-notice strong {
    font-weight: 600;
}

.abs-bf-guest-notice span {
    color: #4b5563;
}

@media (max-width: 520px) {
    .abs-bf-guest-notice {
        flex-direction: column;
        gap: 2px;
    }
}

/* ============================================================
   v0.7.14 — Restored selection notice
   Append to assets/booklist-form.css
   ============================================================ */

.abs-bf-message.notice {
    margin-top: 14px;
    padding: 12px 15px;
    background: #f0f9f4;
    border-left: 3px solid #1a8754;
    border-radius: 4px;
    color: #14532d;
    line-height: 1.5;
}

/* ============================================================
   v0.7.14 — Student picker dialog
   Append to assets/booklist-form.css
   ============================================================ */

.abs-bf-dialog-sub {
    margin: -6px 0 16px !important;
    color: #6b7280;
    font-size: 14px;
}

.abs-bf-student-list {
    display: grid;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
    margin-bottom: 18px;
}

.abs-bf-student {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    cursor: pointer;
    transition: border-color .12s, background .12s;
}

.abs-bf-student:hover {
    border-color: #2271b1;
    background: #f8fbff;
}

.abs-bf-student input[type="radio"] {
    margin: 3px 0 0;
    flex: 0 0 auto;
}

.abs-bf-student-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.abs-bf-student-body strong {
    font-weight: 600;
    line-height: 1.3;
}

.abs-bf-student-body small {
    color: #6b7280;
    font-size: 13px;
}

.abs-bf-student.is-mismatch {
    border-color: #f0c674;
    background: #fffdf5;
}

.abs-bf-student-warn {
    margin-top: 3px;
    color: #92400e;
    font-size: 12px;
    font-style: normal;
    font-weight: 600;
}

.abs-bf-student-new {
    padding-top: 16px;
    border-top: 1px solid #f0f0f1;
}

.abs-bf-student-new > label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 14px;
}

.abs-bf-student-new-row {
    display: flex;
    gap: 8px;
}

.abs-bf-student-new-row input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
}

.abs-bf-student-new-row .button {
    flex: 0 0 auto;
    margin: 0;
}

.abs-bf-student-new-hint {
    margin: 7px 0 0 !important;
    color: #6b7280;
    font-size: 13px;
}

.abs-bf-dialog-error {
    margin-top: 12px;
    padding: 10px 13px;
    background: #fef2f2;
    border-left: 3px solid #b32d2e;
    border-radius: 4px;
    color: #7f1d1d;
    font-size: 14px;
}

.abs-bf-dialog .abs-bf-dialog-actions {
    margin-top: 20px;
}

.abs-bf-student-chip {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .abs-bf-student-new-row {
        flex-direction: column;
    }

    .abs-bf-student-new-row .button {
        width: 100%;
    }
}

/* ============================================================
   v0.8.0 — Ordering closed notice
   ============================================================ */

.abs-bf-closed-notice {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
    margin: 0 0 20px;
    padding: 13px 16px;
    background: #fffdf5;
    border-left: 3px solid #f0c674;
    border-radius: 4px;
    color: #92400e;
    line-height: 1.5;
}

.abs-bf-closed-notice strong {
    font-weight: 600;
}

.abs-bf-closed-notice span {
    color: #6b4c1a;
}

@media (max-width: 520px) {
    .abs-bf-closed-notice {
        flex-direction: column;
        gap: 2px;
    }
}

/* ============================================================
   v0.9.3 — BookStore and school logos in the BookList header
   ============================================================ */

.abs-bf-brand {
    margin: 0 0 14px;
}

.abs-bf-head-main {
    min-width: 0;
}

.abs-bf-head-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 14px;
    flex: none;
}

/* Fixed box with contain: every logo shape shows in full, and the header
   text never moves between schools. */
.abs-bf-school-logo {
    width: 160px;
    height: 80px;
}

.abs-bf-school-logo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: right center;
    margin: 0;
    border: 0;
    box-shadow: none;
}

@media (max-width: 782px) {
    .abs-bf-head-side {
        flex-direction: row-reverse;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .abs-bf-school-logo {
        width: 120px;
        height: 60px;
    }

    .abs-bf-school-logo img {
        object-position: left center;
    }
}

@media print {
    .abs-bf-brand {
        display: none !important;
    }

    .abs-bf-school-logo {
        width: 140px;
        height: 70px;
    }
}
