/* ==========================================================================
   Bengali Bookstore Card - Precision Layout & Fixed Dimensions
   ========================================================================== */
.modern-book-card-item {
    height: 100%;
}

.modern-book-card {
    background: #ffffff;
    border: 1px solid #eef2f6 !important;
    border-radius: 8px !important;
    padding: 10px 10px 12px 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.modern-book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 22px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
    border-color: #cbd5e1 !important;
}

/* --- Top-Left Badges (Discount + E-book) --- */
.book-card-top-left {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: none;
}

.book-discount-badge {
    width: 35px;
    height: 35px;
    background: #dc2626;
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.4);
    line-height: 1;
    pointer-events: auto;
}

.book-discount-badge .discount-val {
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: -0.2px;
}

.book-discount-badge .discount-lbl {
    font-size: 6.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.5px;
}

.book-digital-ribbon {
    position: absolute;
    top: 18px;
    left: -34px;
    z-index: 6;
    width: 130px;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-align: center;
    padding: 4px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    pointer-events: auto;
}

/* --- Top-Right Action Stack (Wishlist + Add to Cart) --- */
.book-card-top-right {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.book-action-wrapper {
    position: static !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.book-round-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    color: #475569;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    transition: all 0.15s ease;
    cursor: pointer;
}

.book-round-btn:hover {
    background: #dc2626;
    color: #ffffff !important;
    border-color: #dc2626;
    transform: scale(1.08);
}

.book-round-btn:hover svg {
    stroke: #ffffff;
}

/* --- Book Cover Stage --- */
.book-cover-container {
    width: 100%;
    height: 205px;
    padding: 2px 0 6px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.book-cover-link {
    display: inline-block;
    transition: transform 0.25s ease;
}

.book-cover-wrap {
    position: relative;
    display: inline-block;
    width: 135px;
    height: 195px;
    border-radius: 3px 5px 5px 3px;
    border: 1px solid #e2e8f0;
    box-shadow: -3px 5px 12px rgba(15, 23, 42, 0.12), 0 2px 4px rgba(0, 0, 0, 0.04);
    background: #f8fafc;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.modern-book-card:hover .book-cover-wrap {
    transform: scale(1.02);
    box-shadow: -5px 9px 18px rgba(15, 23, 42, 0.18), 0 3px 6px rgba(0, 0, 0, 0.06);
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px 4px 4px 2px;
    display: block;
    background-color: #f8fafc;
}

/* Spine Shadow on Left of Cover */
.book-spine-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 8px;
    height: 100%;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.22) 0%, rgba(255, 255, 255, 0.2) 30%, transparent 100%);
    border-radius: 2px 0 0 2px;
    pointer-events: none;
}

/* Right Edge on Cover */
.book-edge-line {
    position: absolute;
    top: 0;
    right: 0;
    width: 2px;
    height: 100%;
    background: rgba(0, 0, 0, 0.06);
    pointer-events: none;
}

.book-cover-out-of-stock {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 6;
    background: rgba(220, 38, 38, 0.9) !important;
    color: #fff !important;
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

/* --- Typography & Uniform Layout --- */
.book-info-wrap {
    padding-top: 6px;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    height: 37px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.book-title a {
    color: #1e293b;
    text-decoration: none;
    transition: color 0.15s ease;
}

.book-title a:hover {
    color: #dc2626;
}

.book-author-line {
    font-size: 12px;
    line-height: 1.4;
    height: 17px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #64748b;
}

.book-author-line a {
    color: #64748b !important;
    text-decoration: none;
}

.book-author-line a:hover {
    color: #dc2626 !important;
}

/* --- Price Layout --- */
.book-price-current {
    font-size: 15.5px;
    font-weight: 700;
    color: #dc2626 !important;
    line-height: 1;
}

.book-price-original {
    font-size: 12.5px;
    color: #94a3b8 !important;
    text-decoration: line-through;
    line-height: 1;
}

/* --- Action Button --- */
.book-card-action-footer .order-now-btn {
    height: 34px;
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 5px;
    background: #dc2626;
    border: 1px solid #dc2626;
    color: #ffffff;
    transition: all 0.2s ease;
}

.book-card-action-footer .order-now-btn:hover {
    background: #b91c1c;
    border-color: #b91c1c;
    color: #ffffff;
}

@media (max-width: 575.98px) {
    .modern-book-card {
        padding: 6px 6px 8px 6px;
    }
    .book-cover-container {
        height: 165px;
    }
    .book-cover-wrap {
        width: 110px;
        height: 155px;
    }
    .book-discount-badge {
        width: 28px;
        height: 28px;
    }
    .book-discount-badge .discount-val {
        font-size: 8.5px;
    }
    .book-discount-badge .discount-lbl {
        font-size: 5.5px;
    }
    .book-digital-ribbon {
        top: 12px;
        left: -32px;
        width: 110px;
        font-size: 8.5px;
        padding: 3px 0;
    }
    .book-round-btn {
        width: 26px;
        height: 26px;
    }
    .book-round-btn svg {
        width: 12px;
        height: 12px;
    }
    .book-title {
        font-size: 12px;
        height: 33px;
    }
    .book-author-line {
        font-size: 11px;
    }
    .book-price-current {
        font-size: 14px;
    }
    .book-card-action-footer .order-now-btn {
        height: 30px;
        font-size: 11.5px;
    }
}
