.accordion-button::after {
    margin: 0;
}

.offer_price {
    position: relative;
}

.offer_price::after {
    content: "";
    height: 1px;
    width: 70px;
    background-color: #000;
    position: absolute;
    right: -3%;
    top: 50%;
    transform: translate(50%, -50%);
    transform: rotate(163deg);
}

.accordion-button {
    display: flex;
    justify-content: space-between;
}

.accordion-button:not(.collapsed) {
    color: var(--primary-color);
    background-color: #fff;
    box-shadow: none;
    border-bottom: 1px solid rgba(217, 217, 217, 0.29);
}

.accordion-button:focus {
    z-index: 3;
    border-color: var(--main-border);
    outline: 0;
    box-shadow: none;
}

.accordion-button:not(.collapsed)::after {
    background-image: url("../images/down-arrow\ .png");
}

.accordion-button::after {
    background-image: url("../images/arrow.PNG");
}

.accordion_input-search {
    border-radius: 5rem;
    -webkit-border-radius: 5rem;
    -moz-border-radius: 5rem;
    -ms-border-radius: 5rem;
    -o-border-radius: 5rem;
}

.accordion-item_categories,
.accordion-item_puplisher {
    position: relative;
    margin-bottom: 10px;
}

.accordion_categories,
.accordion_puplisher {
    position: absolute;
    z-index: 2;
    background: #fff;
    bottom: -15%;
    border: 1px solid;
    width: 100%;
    left: 50%;
    transform: translate(-47%, 100%);
}

.form-check-label {
    font-size: 0.7rem;
}

/* pagination */
.page-link {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 40px;
    width: 40px;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    -ms-border-radius: 50%;
    -o-border-radius: 50%;
}

.page-link:hover,
.page-link:focus {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: none;
}

.page-item .page-link {
    /* background-color: red; */
    border-top-right-radius: 50% !important;
    border-bottom-right-radius: 50% !important;
    color: #8b0000;
}

.page-item .page-link.active {
    color: white;
    background-color: #8b0000;
}

/* Check box */

.form-check-input:checked {
    background-color: var(--main-color);
    border: none;
    box-shadow: none;
}

.form-check .form-check-input {
    float: left;
    margin-left: 0;
    border: var(--main-border);
}

.form-check .form-check-input:focus {
    box-shadow: none;
}

.slider-container {
    position: relative;
    width: 100%;
}

.slider {
    -webkit-appearance: none;
    width: 100%;
    height: 15px;
    background: linear-gradient(to left,
            var(--color-left, #8b0000) 0%,
            var(--color-left, #8b0000) var(--percent, 0%),
            var(--color-right, #d3d3d3) var(--percent, 0%),
            var(--color-right, #d3d3d3) 100%);
    outline: none;
    border-radius: 20px;
    position: relative;
    z-index: 1;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 25px;
    background: var(--thumb-color, var(--main-color));
    cursor: pointer;
    position: relative;
    z-index: 2;
    border: 1px solid #fff;
    border-radius: 6px;
}

.slider::-moz-range-thumb {
    width: 25px;
    height: 30px;
    background: var(--thumb-color, var(--main-color));
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.value {
    position: absolute;
    top: -40px;
    background-color: #e3bfc6;
    color: var(--main-color);
    padding: 5px;
    font-weight: bold;
    border-radius: 5px;
    text-align: center;
    width: 70px;
    transform: translateX(-50%);
    z-index: 3;
}

/* --- New Book Card Design (Matches Home Page) --- */

/* Card Container */
.book-card-container {
    background: #ffffff;
    padding: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* Max width ensures it doesn't get too wide on large screens, 
       but width 100% allows it to shrink on smaller ones */
    max-width: 280px;
    margin: 0 auto;
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    /* Added rounded corners */
}

.book-card-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* Cover Wrapper */
.book-cover-wrapper {
    position: relative;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    /* Ensure the wrapper doesn't force height but relies on content */
}

/* Book Cover (The "Physical" Book) */
.book-cover {
    position: relative;
    width: 100%;
    max-width: 210px;
    /* Limit the max size of the book image */
    aspect-ratio: 2 / 3;
    /* Fixed Aspect Ratio 2:3 */
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 auto;
    /* Important: Remove fixed height so aspect-ratio works */
}

.book-cover:hover {
    transform: scale(1.02);
}

/* Book Front (Inner container of the image) */
.book-front {
    position: relative;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    /* Placeholder bg */
    border-radius: 4px;
    /* Slight rounding for book edges */
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.book-cover:hover .book-front {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Image */
.book-cover-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    /* Remove inline-block spacing */
    transition: all 0.3s ease;
}

/* Discount Ribbon */
.discount-ribbon {
    position: absolute;
    top: 12px;
    right: -25px;
    z-index: 10;
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    color: white;
    padding: 6px 40px;
    font-size: 0.85rem;
    font-weight: bold;
    transform: rotate(45deg);
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.4);
    letter-spacing: 0.5px;
    animation: ribbonPulse 2s ease-in-out infinite;
    width: 120px;
    text-align: center;
    border-radius: 3px;
    pointer-events: none;
    /* Let clicks pass through */
}

.discount-ribbon::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    z-index: -1;
    border-radius: 3px;
}

@keyframes ribbonPulse {

    0%,
    100% {
        transform: rotate(45deg) scale(1);
        box-shadow: 0 3px 10px rgba(192, 57, 43, 0.4);
    }

    50% {
        transform: rotate(45deg) scale(1.05);
        box-shadow: 0 5px 15px rgba(192, 57, 43, 0.6);
    }
}

.discount-text {
    display: block;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    font-size: 0.85rem;
    white-space: nowrap;
    font-weight: 600;
}

/* Light Effect */
.book-light-effect {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.book-cover:hover .book-light-effect {
    opacity: 1;
}

/* Overlay Actions (Cart, View) */
.book-overlay-actions {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 5;
}

.book-cover:hover .book-overlay-actions {
    opacity: 1;
    transform: translateX(0);
}

.action-btn {
    width: 38px;
    height: 38px;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-size: 1rem;
}

.cart-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #e74c3c;
}

.view-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #3498db;
}

.wishlist-btn {
    background: rgba(255, 255, 255, 0.95);
    color: #e91e63;
}

.action-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

/* Book Info Section */
.book-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding-top: 10px;
}

.book-title {
    font-family: inherit;
    /* Use site font */
    font-size: 1rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.4;
    cursor: pointer;
    transition: color 0.2s ease;
    margin: 0;
    text-align: center;
    /* Limit height if title is too long, or let it grow */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-title:hover {
    color: #3498db;
}

.price-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
    /* Push to bottom if flex column */
}

.current-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: #27ae60;
    /* Green for price often looks good, or keep red #c0392b */
}

.original-price {
    font-size: 0.9rem;
    color: #95a5a6;
    text-decoration: line-through;
}

.admin-edit-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    color: #3498db;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(52, 152, 219, 0.1);
    transition: all 0.3s ease;
    margin-top: 8px;
    width: fit-content;
    align-self: center;
}

.admin-edit-link:hover {
    background: rgba(52, 152, 219, 0.2);
    color: #2980b9;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .book-card-container {
        padding: 10px;
        max-width: 100%;
        /* Check this */
    }

    .book-cover {
        max-width: 160px;
        /* Smaller cover on mobile */
    }

    .book-title {
        font-size: 0.95rem;
    }

    .current-price {
        font-size: 1rem;
    }

    .discount-ribbon {
        padding: 4px 30px;
        font-size: 0.7rem;
        top: 8px;
        right: -20px;
        width: 100px;
    }
}