/* Styling for Book Display Widget/Shortcode using Card Layout */

.book-display-container {
    margin-bottom: 20px; /* Space below the container */
}

.book-display-title {
    margin-bottom: 15px;
    font-size: 1.2em; /* Adjust title size */
    border-bottom: 1px solid #eee; /* Optional separator */
    padding-bottom: 5px;
    display: flex; /* Allows View All link alignment */
    justify-content: space-between; /* Pushes View All link to the end */
    align-items: center; /* Vertically aligns title and link */
}

.book-display-title .book-display-view-all {
    font-size: 0.8em; /* Smaller font for the link */
    font-weight: normal;
    margin-inline-start: 10px; /* Space between title and link (RTL/LTR aware) */
    text-decoration: none;
}
.book-display-title .book-display-view-all:hover {
    text-decoration: underline;
}

/* Style the list - can be display: grid or flex for columns */
.book-display-list {
    list-style: none;
    margin: 0 -10px; /* Adjust negative margin based on item padding */
    padding: 0;
    display: flex; /* Example: Use flexbox for layout */
    flex-wrap: wrap; /* Allow items to wrap */
}

/* Each list item acts as a wrapper */
.book-card-list-item {
    padding: 0 10px; /* Gutter between items */
    margin-bottom: 20px; /* Space below items */
    box-sizing: border-box;
    /* Adjust width for columns, e.g., 50% for 2 columns, 33.33% for 3 */
    width: 100%; /* Default: full width */
    /* Example for responsiveness - Adjust breakpoints as needed */
    @media (min-width: 480px) {
        width: 50%; /* 2 columns on small screens */
    }
    @media (min-width: 768px) {
        width: 33.333%; /* 3 columns on medium screens */
    }
    @media (min-width: 1024px) {
        width: 20%; /* 4 columns on larger screens */
    }
}


/* Apply card styles to the inner div */
.book-card {
    background-color: #ffffff;
    border-radius: 8px;
    overflow: visible; /* Needed for discount badge positioning */
    width: 100%; /* Take full width of list item */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    direction: rtl;
    text-align: center;
    display: flex;
    flex-direction: column;
    position: relative; /* Context for absolute elements */
    height: 100%; /* Ensure cards in a row have same height if using flex/grid */
}

.book-card .image-container {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    overflow: hidden; /* Clip image and ribbon */
}

.book-card .image-container picture,
.book-card .image-container img {
    display: block;
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    aspect-ratio: 3 / 4; /* Example: Set aspect ratio for consistent height */
}

.book-card .image-container img {
    background-color: #eee;
    /* Adjust min-height or use aspect-ratio for consistent image area */
    /* min-height: 200px; Example min-height */
    object-fit: cover; /* Cover the area, might crop */
}

.book-card .image-fallback {
    background-color:#eee;
    /* min-height: 200px; Match image min-height */
    aspect-ratio: 3 / 4; /* Match image aspect-ratio */
    display:flex;
    align-items:center;
    justify-content:center;
    color:#aaa;
    font-size: 14px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.book-card .ribbon {
    position: absolute;
    top: 0;
    right: 0;
    background: linear-gradient(135deg, #e85a4f, #e98074);
    color: white;
    padding: 12px 10px 8px 25px;
    font-weight: 900;
    font-size: 14px; /* Adjusted size */
    line-height: 1;
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%, 20% 50%);
    transform: translate(1px, 0px);
    z-index: 1; /* Below badge */
    direction: ltr;
    text-align: center;
}

.book-card .discount-badge {
    position: absolute;
    /* Position relative to the details container top */
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #b53f3f;
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    z-index: 2; /* Above ribbon and details */
    direction: rtl;
    line-height: 1.3;
    white-space: nowrap;
    height: 26px;
    box-sizing: border-box;
}

.book-card .details {
    position: relative; /* Context for the absolutely positioned badge */
    padding: 20px 0 0 0; /* Top padding for badge, zero horizontal/bottom */
    flex-grow: 1; /* Take remaining vertical space */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    background-color: #ffffff;
}

.book-card .info-wrapper {
    flex-grow: 1;
    margin-bottom: 15px; /* Space before pricing */
    padding: 0 15px; /* Horizontal padding for inner content */
    min-height: 80px; /* Example: Ensure minimum height for content area */
}

.book-card .rating-container {
    margin-bottom: 6px;
    line-height: 1;
    /* Ensure stars are centered */
    text-align: center;
    min-height: 18px; /* Reserve space even if no stars */
}
/* WooCommerce Star Rating Styles */
.book-card .star-rating {
    color: #ededed; /* Empty star color */
    font-size: 15px; /* Star size */
    display: inline-block; /* Allow centering */
    height: 1em;
    line-height: 1;
    position: relative;
    width: 5.4em; /* Adjust width based on font size/letter spacing */
    font-family: star; /* Use WooCommerce star font */
}
.book-card .star-rating span {
    color: #ffc107; /* Filled star color */
    overflow: hidden;
    position: absolute;
    top: 0;
    left: 0;
    padding-top: 1.5em; /* WC technique */
}
.book-card .star-rating span::before,
.book-card .star-rating::before {
    letter-spacing: 2px; /* Space between stars */
    content: "\73\73\73\73\73"; /* The stars */
    position: absolute;
    top: 0;
    left: 0;
}


.book-card .title {
    font-size: 1.1em; /* Adjusted size */
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 4px;
    color: #212529;
    line-height: 1.35;
    /* Ensure consistent height - maybe limit lines */
    height: 2.7em; /* Approx 2 lines */
    overflow: hidden;
    /* padding: 0 15px; */ /* Padding handled by info-wrapper */
}
.book-card .title a,
.book-card .author a {
    color: inherit;
    text-decoration: none;
}
.book-card .title a:hover,
.book-card .author a:hover {
    text-decoration: underline;
}

.book-card .author {
    font-size: 0.85em;
    color: #7d726c;
    margin-bottom: 0; /* Remove default margin if present */
    font-weight: 400;
    line-height: 1.4;
    /* padding: 0 15px; */ /* Padding handled by info-wrapper */
    /* Limit lines if needed */
    height: 1.4em; /* Approx 1 line */
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}


.book-card .pricing {
    display: flex;
    justify-content: flex-end; /* Align items to the end (right in LTR, left in RTL) */
    align-items: stretch; /* Make items fill height */
    background-color: #f1f3f5;
    margin: 0; /* Reset margin */
    padding: 0; /* Reset padding */
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    flex-shrink: 0;
    min-height: 45px;
    position: relative;
    border-top: 1px solid #e0e0e0;
    overflow: hidden; /* Clip button corners */
}

.book-card .price-container {
    padding: 3px 10px 3px 0;
    display: flex;
    align-items: center;
    flex-grow: 1;
    /*justify-content: flex-end; !* Align prices to the end (start in RTL) *!*/
    flex-wrap: wrap; /* Allow prices to wrap if needed */
}

/* WooCommerce Price Styling */
.book-card .price {
    /* font-size: 1.3em; */ /* Inherit or adjust */
    font-weight: 900;
    color: #403834;
    direction: ltr;
    line-height: 1;
    display: inline-block; /* Or flex for better control */
    margin-left: 5px; /* Space between price elements */
}
html[dir="rtl"] .book-card .price {
    margin-left: 0;
    margin-right: 5px;
}

.book-card .price del {
    text-decoration: line-through;
    color: #adb5bd;
    font-size: 0.7em; /* Smaller relative size */
    font-weight: 400;
    /* margin-left: 10px; */ /* Handled by price container spacing */
    opacity: 0.8;
    display: block; /* Ensure it takes its own space */
    width: 100%; /* Take full width in wrap scenario */
    text-align: right; /* Align to end */
}
html[dir="rtl"] .book-card .price del {
    text-align: left;
}

.book-card .price ins {
    text-decoration: none; /* Remove underline from sale price */
    background: transparent; /* Ensure no background */
    font-size: 1.3em; /* Make sale price larger */
}
/* Hide original price if it's the same as sale price (handled by WC?) */
.book-card .price del:only-child { display: none; }


/* Cart Button Styling */
.book-card .cart-button,
.book-card .add_to_cart_button, /* Target WC default class */
.book-card .ajax_add_to_cart /* Target WC ajax class */
{
    background-color: #f38b12 !important; /* Use important if needed to override WC styles */
    color: white !important;
    border: none !important;
    padding: 0 14px !important; /* Horizontal padding */
    border-radius: 0 !important; /* Square corners */
    border-left: 1px solid #e08317 !important; /* Left border */
    cursor: pointer;
    font-size: 1.1em !important;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    order: -1; /* Move to the start (left in LTR, right in RTL) */
    align-self: stretch; /* Fill height */
    text-decoration: none !important; /* Remove underline from WC button link */
    white-space: nowrap; /* Prevent text wrapping */
    line-height: 1 !important; /* Override WC line height */
    text-shadow: none !important; /* Override WC text shadow */
    margin: 0 !important; /* Override WC margin */
}
html[dir="rtl"] .book-card .cart-button,
html[dir="rtl"] .book-card .add_to_cart_button,
html[dir="rtl"] .book-card .ajax_add_to_cart {
    border-left: none !important;
    border-right:     1px solid #e08317 !important; /* Right border in RTL */
    order: 1; /* Move to the end (left in RTL) */
}


.book-card .cart-button:hover,
.book-card .add_to_cart_button:hover,
.book-card .ajax_add_to_cart:hover {
    background-color: #cf5b06 !important;
    color: white !important;
}

/* Hide WC 'added' state text/icon if desired */
.book-card .added_to_cart {
    display: none !important;
}


/* Hide schema meta tags */
.book-card .details meta,
.book-card .pricing meta,
.book-card .pricing link {
    display: none;
}
.book-card .pricing .button-label{
    display: none;
}





/* compact, sleek, and professional version of the price style */

.book-card .price-container {
    display: flex;
    align-items: center;
    gap: 2px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    flex-wrap: wrap;
    margin-top: 0;
}
.book-card .original-price{
    font-size: 11px;
    line-height: 11px;
}
.book-card .original-price .woocommerce-Price-amount {
    color: #999;
    text-decoration: line-through;
    font-weight: 500;
    opacity: 0.75;
}

.book-card .current-price .woocommerce-Price-amount {
    color: #007a3d;
    font-weight: 700;
    font-size: 14px;
    line-height: 11px;
}


/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .book-card .original-price .woocommerce-Price-amount {
        color: #777;
    }

    .book-card .current-price .woocommerce-Price-amount {
        color: #4caf50;
    }
}

/*END*/
/* compact, sleek, and professional version of the price style */



