.textbook-page,
.textbook-detail-page {
    min-height: calc(100vh - 64px);
    background: #ffffff;
}

.textbook-container,
.textbook-detail-container {
    width: min(1120px, calc(100% - 48px));
    margin: 0 auto;
}

.textbook-list-head {
    padding: 70px 0 34px;
}

.textbook-list-head span,
.textbook-category {
    display: inline-flex;
    align-items: center;
    height: 30px;
    padding: 0 12px;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 900;
}

.textbook-list-head h1 {
    margin-top: 18px;
    color: #0f172a;
    font-size: 44px;
    line-height: 1.15;
    letter-spacing: 0;
}

.textbook-list-head p {
    margin-top: 14px;
    color: #475569;
    font-size: 16px;
    font-weight: 700;
}

.textbook-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 18px;
    padding-bottom: 80px;
}

.textbook-card {
    display: grid;
    grid-template-columns: 128px minmax(0, 1fr);
    gap: 20px;
    padding: 20px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.textbook-card:hover {
    transform: translateY(-2px);
    border-color: #93c5fd;
    box-shadow: 0 20px 46px rgba(37, 99, 235, 0.12);
}

.textbook-cover-mini,
.textbook-cover-large {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 8px;
    background:
        radial-gradient(circle at 22% 20%, rgba(255, 255, 255, 0.95), transparent 11%),
        radial-gradient(circle at 72% 30%, rgba(255, 255, 255, 0.8), transparent 13%),
        linear-gradient(145deg, #1e3a8a 0%, #2563eb 48%, #f97316 100%);
    color: #ffffff;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.textbook-cover-mini {
    min-height: 156px;
    padding: 16px;
}

.textbook-cover-mini strong,
.textbook-cover-large span {
    font-size: 13px;
    font-weight: 900;
}

.textbook-cover-mini span {
    font-size: 22px;
    font-weight: 900;
    line-height: 1.18;
}

.textbook-card-body {
    min-width: 0;
}

.textbook-card-body h2 {
    margin-top: 10px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1.25;
}

.textbook-card-body p {
    margin-top: 8px;
    color: #475569;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.6;
}

.textbook-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
    color: #64748b;
    font-size: 14px;
    font-weight: 800;
}

.textbook-card-meta strong {
    color: #0f172a;
    font-size: 20px;
}

.textbook-visual-band {
    padding: 28px 24px 46px;
    background:
        linear-gradient(90deg, rgba(15, 23, 42, 0.16), rgba(255, 255, 255, 0.5)),
        linear-gradient(135deg, #e2e8f0 0%, #fff7ed 100%);
}

.textbook-hero-card {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 42px;
    width: min(760px, 100%);
    min-height: 430px;
    margin: 0 auto;
    padding: 18px;
    border-radius: 6px;
    background: #fff7ed;
}

.textbook-cover-large {
    padding: 28px;
}

.textbook-cover-large strong {
    font-size: 46px;
    line-height: 1.08;
    letter-spacing: 0;
}

.textbook-cover-large em,
.textbook-hero-copy em {
    font-style: normal;
    font-weight: 900;
}

.textbook-hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #111827;
}

.textbook-hero-copy span {
    align-self: flex-end;
    margin-bottom: 28px;
    font-size: 20px;
    font-weight: 900;
}

.textbook-hero-copy strong {
    font-size: 58px;
    line-height: 1.08;
    font-weight: 900;
    letter-spacing: 0;
}

.textbook-hero-copy em {
    margin-top: 16px;
    font-size: 42px;
}

.textbook-detail-container {
    padding: 48px 0 150px;
    text-align: center;
}

.textbook-detail-summary {
    color: #475569;
    font-size: 16px;
    font-weight: 700;
}

.textbook-detail-container h1 {
    margin-top: 8px;
    color: #0f172a;
    font-size: 26px;
    line-height: 1.3;
}

.textbook-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    border: 0;
    background: transparent;
    color: #475569;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.textbook-purchase-panel {
    display: grid;
    grid-template-columns: 1fr 1fr 1.2fr;
    align-items: center;
    width: min(740px, 100%);
    margin: 36px auto 0;
    padding: 18px 24px;
    border-radius: 10px;
    background: #f8fafc;
}

.textbook-purchase-item,
.textbook-price-box {
    min-height: 58px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.textbook-purchase-item + .textbook-purchase-item,
.textbook-price-box {
    border-left: 1px solid #e2e8f0;
}

.textbook-purchase-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    color: #2563eb;
    background: currentColor;
}

.textbook-purchase-icon.book {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-1.5Z'/%3E%3Cpath d='M8 7h6'/%3E%3Cpath d='M8 11h8'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5V5a2 2 0 0 1 2-2h12v18H6a2 2 0 0 1-2-1.5Z'/%3E%3Cpath d='M8 7h6'/%3E%3Cpath d='M8 11h8'/%3E%3C/svg%3E") center / contain no-repeat;
}

.textbook-purchase-icon.truck {
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H3v14h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2v-5l-3-5h-4v10h1'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H3v14h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2v-5l-3-5h-4v10h1'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3C/svg%3E") center / contain no-repeat;
}

.textbook-purchase-item strong {
    color: #334155;
    font-size: 14px;
}

.textbook-original-price {
    color: #94a3b8;
    font-size: 15px;
    font-weight: 800;
    text-decoration: line-through;
}

.textbook-price-box strong {
    color: #0f172a;
    font-size: 26px;
    line-height: 1;
}

.textbook-price-box em {
    color: #f43f5e;
    font-style: normal;
}

.textbook-bottom-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 900;
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(10px);
}

.textbook-bottom-inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    align-items: center;
    gap: 24px;
    width: min(1120px, calc(100% - 48px));
    min-height: 76px;
    margin: 0 auto;
}

.textbook-bottom-inner strong {
    min-width: 0;
    color: #0f172a;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.textbook-bottom-inner button {
    height: 52px;
    border: 0;
    border-radius: 4px;
    background: #2f80ed;
    color: #ffffff;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

body.textbook-modal-open {
    overflow: hidden;
}

.textbook-order-modal[hidden] {
    display: none;
}

.textbook-order-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    align-items: end;
    justify-items: center;
}

.textbook-order-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
}

.textbook-order-sheet {
    position: relative;
    width: min(960px, calc(100% - 40px));
    max-height: min(78vh, 620px);
    overflow: auto;
    border-radius: 22px 22px 0 0;
    background: #ffffff;
    box-shadow: 0 -22px 60px rgba(15, 23, 42, 0.2);
}

.textbook-order-handle {
    width: 42px;
    height: 6px;
    margin: 10px auto 24px;
    border-radius: 999px;
    background: #f1f5f9;
}

.textbook-order-sheet h2 {
    padding: 0 18px 24px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
}

.textbook-order-product {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 0 18px 28px;
}

.textbook-order-cover {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 66px;
    height: 66px;
    padding: 8px;
    border-radius: 4px;
    background:
        radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.9), transparent 12%),
        linear-gradient(145deg, #1e3a8a 0%, #2563eb 50%, #f97316 100%);
    color: #ffffff;
}

.textbook-order-cover strong {
    font-size: 10px;
    font-weight: 900;
}

.textbook-order-cover span {
    font-size: 11px;
    font-weight: 900;
    line-height: 1.18;
}

.textbook-order-info {
    min-width: 0;
}

.textbook-order-info h3 {
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
}

.textbook-order-info strong {
    display: block;
    margin-top: 2px;
    color: #0f172a;
    font-size: 17px;
    line-height: 1;
}

.textbook-order-info strong em {
    color: #f43f5e;
    font-style: normal;
}

.textbook-quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0f172a;
    font-size: 18px;
    font-weight: 700;
}

.textbook-quantity-control button {
    width: 28px;
    height: 28px;
    border: 0;
    background: transparent;
    color: #64748b;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.textbook-quantity-control input {
    width: 54px;
    height: 34px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #ffffff;
    color: #0f172a;
    font-size: 16px;
    font-weight: 900;
    text-align: center;
}

.textbook-quantity-control button:disabled {
    color: #cbd5e1;
    cursor: not-allowed;
}

.textbook-order-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px;
    border-top: 1px solid #e2e8f0;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
}

.textbook-order-total strong {
    font-size: 18px;
}

.textbook-order-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 0 18px 18px;
}

.textbook-order-actions form {
    min-width: 0;
}

.textbook-order-actions button {
    width: 100%;
    height: 52px;
    border-radius: 4px;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
}

.textbook-cart-btn {
    border: 1px solid #93c5fd;
    background: #ffffff;
    color: #2f80ed;
}

.textbook-order-btn {
    border: 1px solid #2f80ed;
    background: #2f80ed;
    color: #ffffff;
}

.textbook-account-page {
    min-height: calc(100vh - 64px);
    background: #f5f8fc;
    padding-bottom: 80px;
}

.textbook-list-head.compact {
    padding: 48px 0 24px;
}

.textbook-cart-list,
.textbook-history-list,
.textbook-order-confirm {
    display: grid;
    gap: 14px;
}

.textbook-cart-row,
.textbook-history-card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.textbook-cart-main {
    min-width: 0;
}

.textbook-cart-main h2 {
    color: #0f172a;
    font-size: 18px;
    line-height: 1.3;
}

.textbook-cart-main p {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.textbook-cart-main strong {
    display: block;
    margin-top: 8px;
    color: #0f172a;
    font-size: 17px;
}

.textbook-cart-quantity {
    display: grid;
    gap: 6px;
    justify-items: start;
}

.textbook-cart-quantity-label {
    color: #475569;
    font-size: 12px;
    font-weight: 800;
}

.textbook-cart-stepper {
    align-self: center;
}

.textbook-cart-stepper input {
    width: 56px;
}

.textbook-cart-remove-form {
    display: none;
}

.textbook-remove-btn,
.textbook-cart-summary button,
.textbook-empty-state a {
    height: 38px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.textbook-remove-btn {
    border: 1px solid #fecaca;
    background: #fff1f2;
    color: #dc2626;
}

.textbook-cart-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #ffffff;
}

.textbook-order-submit {
    display: grid;
    gap: 14px;
}

.textbook-order-submit .textbook-cart-summary {
    margin-top: 0;
}

.textbook-shipping-card {
    padding: 18px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #ffffff;
}

.textbook-shipping-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.textbook-shipping-head span {
    color: #475569;
    font-weight: 900;
}

.shipping-address-lookup {
    display: grid;
    gap: 10px;
}

.shipping-address-lookup .address-postcode-row {
    display: grid;
    grid-template-columns: 160px auto;
    gap: 10px;
    justify-content: start;
}

.shipping-address-lookup input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
    box-sizing: border-box;
}

.shipping-address-lookup input[readonly] {
    background: #f8fafc;
    color: #475569;
}

.shipping-address-lookup button,
.textbook-shipping-edit button {
    height: 38px;
    padding: 0 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.textbook-shipping-card p {
    margin-top: 10px;
    color: #0f172a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.55;
}

.textbook-shipping-edit {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin-top: 12px;
}

.textbook-shipping-edit[hidden] {
    display: none;
}

.textbook-shipping-edit input {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.textbook-shipping-edit input:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.16);
}

.textbook-cart-summary span {
    color: #475569;
    font-weight: 900;
}

.textbook-cart-summary strong {
    color: #0f172a;
    font-size: 24px;
}

.textbook-cart-summary button,
.textbook-empty-state a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #2f80ed;
    background: #2f80ed;
    color: #ffffff;
}

.textbook-empty-state {
    padding: 52px 24px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #ffffff;
    text-align: center;
}

.textbook-empty-state h2 {
    color: #0f172a;
    font-size: 24px;
}

.textbook-empty-state p {
    margin: 8px 0 20px;
    color: #64748b;
    font-weight: 700;
}

.textbook-history-card {
    grid-template-columns: minmax(0, 1fr) minmax(220px, auto) auto;
}

.textbook-history-card strong,
.textbook-history-card span {
    display: block;
}

.textbook-history-card strong {
    color: #0f172a;
    font-size: 16px;
}

.textbook-history-card span,
.textbook-history-card li {
    margin-top: 5px;
    color: #64748b;
    font-size: 13px;
    font-weight: 700;
}

.textbook-history-meta {
    min-width: 0;
}

.textbook-history-address {
    display: grid;
    gap: 3px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #eef2f7;
}

.textbook-history-address b {
    color: #2563eb;
    font-size: 12px;
    font-weight: 900;
}

.textbook-history-address span {
    margin-top: 0;
    color: #334155;
    line-height: 1.45;
}

.textbook-history-card p {
    color: #0f172a;
    font-size: 20px;
    font-weight: 900;
}

.textbook-order-notice {
    margin-bottom: 14px;
    padding: 14px 16px;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    background: #f0fdf4;
    color: #15803d;
    font-weight: 900;
}

@media (max-width: 760px) {
    .textbook-card,
    .textbook-hero-card,
    .textbook-purchase-panel,
    .textbook-bottom-inner {
        grid-template-columns: 1fr;
    }

    .textbook-hero-copy strong {
        font-size: 42px;
    }

    .textbook-purchase-item + .textbook-purchase-item,
    .textbook-price-box {
        border-left: 0;
        border-top: 1px solid #e2e8f0;
        padding-top: 14px;
    }

    .textbook-order-product {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .textbook-quantity-control {
        grid-column: 1 / -1;
        justify-content: flex-end;
    }

    .textbook-cart-row,
    .textbook-history-card,
    .textbook-cart-summary {
        grid-template-columns: 1fr;
    }
}
