/* Bookstore — shop catalogue */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid transparent;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn--primary {
    background: linear-gradient(135deg, var(--red-600), var(--red-400));
    color: white;
    box-shadow: 0 4px 18px var(--red-glow);
}

.btn--ghost {
    background: var(--surface);
    border-color: var(--border);
    color: var(--text);
}

.price-display {
    font-variant-numeric: tabular-nums;
}

.bookstore-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.bookstore-hero h1 {
    font-size: 1.65rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.bookstore-hero p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.bookstore-hero__count {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--red-400);
    background: rgba(220, 38, 38, 0.12);
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(220, 38, 38, 0.25);
}

.bookstore-search {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: stretch;
    margin-bottom: 0.75rem;
}

.bookstore-search__field {
    flex: 1;
    min-width: 220px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0 0.85rem;
    transition: border-color 0.2s;
}

.bookstore-search__field:focus-within {
    border-color: rgba(220, 38, 38, 0.45);
}

.bookstore-search__icon {
    opacity: 0.55;
}

.bookstore-search__field input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 0.92rem;
    padding: 0.75rem 0;
    outline: none;
}

.bookstore-filters-wrap {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.35s ease;
    margin-bottom: 0.5rem;
}

.bookstore-filters-wrap--open {
    grid-template-rows: 1fr;
    margin-bottom: 1.25rem;
}

.bookstore-filters-wrap > .bookstore-filters {
    overflow: hidden;
}

.bookstore-filters {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.2);
    border-radius: var(--radius);
    padding: 1rem;
}

.bookstore-filters__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.bookstore-filters .field span {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.field--wide {
    grid-column: 1 / -1;
}

.bookstore-filters__actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.bookstore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.bookstore-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.bookstore-card:hover {
    border-color: rgba(220, 38, 38, 0.35);
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
}

.bookstore-card__link {
    flex: 1;
    text-decoration: none;
    color: inherit;
    display: block;
}

.bookstore-card__footer {
    padding: 0 0.75rem 0.75rem;
}

.btn--cart-sm {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.8rem;
    border-radius: 11px;
    background: linear-gradient(135deg, rgba(220, 38, 38, 0.92), rgba(239, 68, 68, 0.88));
    color: #fff;
    border: none;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.22);
}

.btn--cart-sm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.32);
}

.quick-cart {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.quick-cart[hidden] {
    display: none;
}

.quick-cart__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(6px);
}

.quick-cart__panel {
    position: relative;
    z-index: 1;
    width: min(100%, 480px);
    max-height: min(88vh, 640px);
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, rgba(28, 10, 12, 0.98), rgba(18, 6, 8, 0.98));
    border: 1px solid rgba(220, 38, 38, 0.28);
    border-radius: 20px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}

.quick-cart__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 1rem 1rem 0.65rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-cart__book {
    display: flex;
    gap: 0.75rem;
    min-width: 0;
}

.quick-cart__cover {
    width: 52px;
    height: 68px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.quick-cart__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quick-cart__head h2 {
    font-size: 0.95rem;
    line-height: 1.45;
    margin-bottom: 0.15rem;
}

.quick-cart__author {
    font-size: 0.76rem;
    color: var(--text-muted);
}

.quick-cart__close {
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.quick-cart__hint {
    padding: 0.65rem 1rem 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.quick-cart__editions {
    flex: 1;
    overflow: auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.quick-cart__edition {
    display: block;
    cursor: pointer;
}

.quick-cart__edition input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.quick-cart__edition-body {
    padding: 0.75rem 0.85rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.22);
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.quick-cart__edition--selected .quick-cart__edition-body {
    border-color: rgba(220, 38, 38, 0.55);
    background: rgba(220, 38, 38, 0.1);
    box-shadow: 0 0 0 1px rgba(220, 38, 38, 0.15);
}

.quick-cart__edition-top {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.quick-cart__edition-top strong {
    font-size: 0.88rem;
}

.quick-cart__badge {
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    background: rgba(251, 191, 36, 0.15);
    color: #fcd34d;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.quick-cart__edition-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
}

.quick-cart__price {
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--red-400);
}

.quick-cart__meta-item {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.quick-cart__edition-note {
    margin: 0.45rem 0 0;
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.quick-cart__foot {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.quick-cart__foot .btn--ghost {
    flex: 0 0 auto;
}

.quick-cart__submit {
    flex: 1;
}

.bookstore-card__cover {
    position: relative;
    aspect-ratio: 3/4;
    background: rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.bookstore-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookstore-card__placeholder {
    font-size: 2.5rem;
    opacity: 0.45;
}

.bookstore-card__year {
    position: absolute;
    bottom: 0.5rem;
    right: 0.5rem;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.62);
    color: #e5e7eb;
}

.bookstore-card__body {
    padding: 0.85rem;
}

.bookstore-card__body h3 {
    font-size: 0.92rem;
    line-height: 1.4;
    margin-bottom: 0.2rem;
    font-weight: 700;
}

.bookstore-card__author {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.bookstore-card__meta {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.bookstore-card__price {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--red-400);
}

.bookstore-empty {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
}

.bookstore-empty p,
.bookstore-empty h1 {
    margin-bottom: 0.75rem;
}

.bookstore-empty h1 {
    font-size: 1.25rem;
}

/* Detail */
.bookstore-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.bookstore-breadcrumb a {
    color: var(--red-400);
    text-decoration: none;
}

.bookstore-detail {
    display: grid;
    grid-template-columns: minmax(260px, 380px) 1fr;
    gap: 1.5rem;
    align-items: start;
}

.bookstore-detail__main-photo {
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.25);
    aspect-ratio: 3/4;
}

.bookstore-detail__main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookstore-detail__no-photo {
    aspect-ratio: 3/4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.bookstore-detail__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.bookstore-thumb {
    width: 56px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    background: transparent;
}

.bookstore-thumb--active {
    border-color: var(--red-500);
}

.bookstore-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bookstore-detail__category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--red-400);
    background: rgba(220, 38, 38, 0.12);
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.bookstore-detail__info h1 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 0.35rem;
}

.bookstore-detail__author {
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.bookstore-detail__publisher {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
}

.bookstore-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.bookstore-chip {
    font-size: 0.72rem;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
}

.bookstore-chip--tag {
    border-color: rgba(220, 38, 38, 0.25);
    color: #fecaca;
}

.bookstore-detail__desc {
    margin: 1rem 0;
    padding: 0.85rem;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 12px;
    border: 1px solid var(--border);
}

.bookstore-detail__desc h2 {
    font-size: 0.88rem;
    margin-bottom: 0.4rem;
}

.bookstore-detail__desc p {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.bookstore-editions {
    margin: 1.25rem 0;
}

.bookstore-editions h2 {
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
}

.bookstore-editions__list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bookstore-edition {
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.15);
}

.bookstore-edition--latest {
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.06);
}

.bookstore-edition header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.bookstore-edition__badge {
    font-size: 0.68rem;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.12);
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
}

.bookstore-edition dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
}

.bookstore-edition dt {
    font-size: 0.68rem;
    color: var(--text-muted);
}

.bookstore-edition dd {
    font-size: 0.85rem;
    font-weight: 600;
}

.bookstore-edition__sale {
    color: var(--red-400);
    font-size: 0.95rem !important;
}

.bookstore-edition__note {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.bookstore-edition__paused {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .bookstore-filters__grid,
    .bookstore-detail,
    .bookstore-edition dl {
        grid-template-columns: 1fr;
    }

    .bookstore-detail {
        gap: 1rem;
    }

    .bookstore-detail__info h1 {
        font-size: 1.35rem;
    }

    .bookstore-search {
        flex-direction: column;
    }

    .bookstore-editions__list {
        gap: 0.65rem;
    }
}
