/* --- Product Carousel  --- */
.is-product-collection-layout-carousel {
    margin: 24px 20px;

    @media (max-width: 768px) {
        margin: 10px 5px;
    }
}

/* Previous and next button */
.wc-block-next-previous-buttons__button {
    background-color: transparent !important;
    box-shadow: none !important;
    color: var(--text-muted) !important;
}

.wc-block-next-previous-buttons__button:hover {
    background-color: transparent !important;
}

.wc-block-next-previous-buttons {
    gap: 0 !important;
}

.wc-block-next-previous-buttons__icon.wc-block-next-previous-buttons__icon--left,
.wc-block-next-previous-buttons__icon.wc-block-next-previous-buttons__icon--right {
    padding: 0 !important;
}

/* Book title */
.has-text-align-center.wp-block-post-title {
    text-decoration: underline;
    margin: 0 !important;
}


/* Author name under product */
.wp-block-table.wp-block-woocommerce-product-specifications {
    width: fit-content;
    margin: 0 auto;
    padding: 0;
    border: none;
    border-spacing: 0 !important;
    height: 25px;
    overflow: hidden;
    margin-bottom: 5px !important;

    text-decoration: underline;
}

.wp-block-table table,
.wp-block-product-specifications-item__value {
    border: none !important;
    text-align: center;
    padding: 0 !important;
    margin-bottom: 6px !important;
}

.entry-content p {
    margin: 0 !important;
}

/* Align the title to two lines so they all stay consistent */
.wp-block-product-specifications-item__label {
    display: none !important;
}

.wp-block-post-title a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3em;
    height: 2.6em !important;
    margin-bottom: 8px !important;
    text-decoration: none;
}

.wc-block-grid__product-price {
    margin-top: auto !important;
}

/* How many books to show on carousel based on screensize */
.wp-block-woocommerce-product-collection.is-layout-flow.wp-block-woocommerce-product-collection-is-layout-flow {
    padding: 20px;
    margin-bottom: 0;
}

.wc-block-components-product-image__inner-container {
    padding: 0;
}

.is-product-collection-layout-carousel .wc-block-product {

    /* Display 2 books */
    @media (max-width: 441px) {
        min-width: 38%;
    }

    /* Display 3 books */
    @media (min-width: 442px) {
        min-width: 34%;
    }

    @media (min-width: 661px) {
        min-width: 22%;
    }

    /* Display 5 books */
    @media (min-width: 938px) {
        min-width: 17%;
    }

    /* Display 6 books */
    @media (min-width: 1080px) {
        min-width: 14.7%;
    }
}

/* -- Dual Price -- */
.wc-block-components-product-price.wc-block-grid__product-price .chamnar-price-wrapper {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--brand-color);
    width: 100%;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price,
.wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price {
    color: var(--text-body);
    font-weight: 500;
}

.wc-block-components-product-price.wc-block-grid__product-price .price-amount {
    flex-shrink: 0;
    display: flex;
    align-items: baseline;
    white-space: nowrap;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price .price-amount .original-price,
.wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price .price-amount .original-price {
    font-size: var(--font-size-label);
    color: var(--text-muted);
    font-weight: normal;
    margin-right: 5px;
}

.wc-block-components-product-price.wc-block-grid__product-price .price-label {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Triggers the ... */
    flex-shrink: 1;
    /* Gives permission to shrink */
    margin-left: 5px;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price .price-label {
    font-size: var(--font-size-label);
    color: var(--text-muted);
    font-weight: 400;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price {
    font-size: var(--font-size-body);
    font-weight: 700;
}

.wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price .price-label {
    font-size: var(--font-size-label);
    color: var(--brand-color);
    font-weight: 600;
}

@media (max-width: 768px) {
    .wc-block-components-product-price.wc-block-grid__product-price .chamnar-price-wrapper {
        gap: 0px;
        margin-bottom: 5px;
    }

    .wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price,
    .wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price {
        font-size: var(--font-size-body);
    }

    .wc-block-components-product-price.wc-block-grid__product-price .chamnar-online-price .price-label,
    .wc-block-components-product-price.wc-block-grid__product-price .chamnar-member-price .price-label {
        font-size: calc(var(--font-size-label) - 1px);
    }
}


/* Pre order discount badge */
/* Ensure the image container can hold the absolute badge */
.wc-block-grid__product-image .chamnar-badge-discount {
    bottom: -5px;
    right: -5px;
}
