.book-container {
    margin: 10px auto;
    background-color: var(--bg-section-primary);
    padding: 20px;
    border-radius: var(--border-raduis-default);
    display: flex;
    border: var(--size-border-solid) solid var(--color-border-section-primary);
    gap: 20px;
}

.book-cover {
    flex: 1;
    margin-bottom: 0;
    perspective: 1000px;
    width: 100%;
    height: 490px;
    display: flex;
    align-items: center;
    flex-direction: column;
    position: relative;
    display: inline-block;
}

.flipper {
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
}

.book-cover.flipped .flipper {
    transform: rotateY(180deg);
}

.front,
.back {
    width: 100%;
    height: 100%;
    position: absolute;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: var(--size-border-solid) solid var(--color-border-button-secondary);
    border-radius: var(--border-raduis-default);
}

.front {
    background: var(--bg-button-fifth);
}

.back {
    background: var(--bg-button-fifth);
    transform: rotateY(180deg);
}

.book-cover img {
    width: 100%;
    box-shadow: 1px 10px 10px rgba(0, 0, 0, 0.404), 1px 1px 10px rgba(0, 0, 0, 0.315);
    font-size: 50px;
    border-radius: var(--border-raduis-default);
}

.book-cover img:hover {
    box-shadow: none;
}

.book-cover .price {
    position: absolute;
    top: 0;
    right: 5px;
    width: auto;
    color: var(--color-text-button-primary);
    padding: 5px 10px;
    font-weight: bold;
    border-radius: var(--border-raduis-default);
    font-size: 18px;
    font-style: italic;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    --_filter: blur(10px) saturate(50%);
    background-color: var(--bg-popup-message-primary);
    backdrop-filter: var(--_filter);
    -webkit-backdrop-filter: var(--_filter);
}

.book-info {
    flex: 2;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.title {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-text-title-primary);
    margin-left: 10px;
    margin-right: 10px;
    margin-top: 30px;
}

.author {
    font-size: 16px;
    color: var(--color-text-title-primary);
    margin-left: 10px;
    margin-right: 10px;
}

.author .book-download {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    width: 100%;
    margin-top: 25px;
    margin-bottom: 25px;
    align-items: center;
    gap: 8px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.rating span {
    font-size: 18px;
    color: var(--color-secondary);
}

.media-author {
    display: flex;
    margin: 20px;
    align-items: center;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: left;
    gap: 8px;
}

.media-author .author-index {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-decoration: none;
    background: transparent;
}

.media-author .media-author-body h4 {
    color: var(--color-text-title-primary);
    font-size: 16px;
    margin-top: 3px;
}

.media-author .profile-card-author {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f5f5dc;
    border: 3px solid transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 3px solid white;
}

.media-author .profile-card-author:hover {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #f5f5dc;
    border: 3px solid transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border: 3px solid var(--color-text-button-primary);
}

.media-author .profile-card-author img {
    width: 100%;
    height: 100%;
}

.profile-pic {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.2);
}

.profile-pic:hover {
    box-shadow: none;
}

.description p {
    line-height: 1.6;
    color: var(--color-text-paragraph-primary);
    font-size: 16px;
    margin-bottom: 10px;
}

.details {
    font-size: 1rem;
    color: var(--color-text-paragraph-primary);
}

.details .book-details {
    display: flex;
    margin-top: 10px;
    margin-bottom: 10px;
    align-items: center;
    gap: 8px;
}

.details .book-details .propriety-book {
    font-weight: 700;
    font-size: 1.8rem;
    background: var(--bg-color-secondary);
    border: var(--size-border-solid) solid var(--color-border-button-primary);
    padding: 5px;
    width: 40px;
    text-align: center;
    border-radius: 5px;
}

.rating .book-rating {
    margin-right: 40px;
}

.rating .book-rating i.icon-star {
    font-size: 18px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.rating .book-rating i.icon-star-half {
    font-size: 18px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.review-content .book-rating {
    margin-right: 40px;
}

.review-content .book-rating i.icon-star {
    font-size: 15px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.review-content .book-rating i.icon-star-half {
    font-size: 15px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.send-book-rating {
    margin-top: 10px;
    margin-bottom: 10px;
    margin-right: 40px;
}

.send-book-rating i.icon-star {
    font-size: 18px;
    margin: 3px;
    font-weight: 700;
    cursor: pointer;
    color: #b9b9b9;
    transition: color 0.3s ease;
}

.send-book-rating i.icon-star-half {
    font-size: 18px;
    margin: 3px;
    font-weight: 700;
    cursor: pointer;
    color: #b9b9b9;
    transition: color 0.3s ease;
}

.highlight {
    color: #ffa500 !important;
}



.rating .book-rating i.icon-star2 {
    font-size: 19px;
    margin: 3px;
    color: #b9b9b9;
    font-weight: 700;
}

.review-content .book-rating i.icon-star2 {
    font-size: 16px;
    margin: 3px;
    color: #b9b9b9;
    font-weight: 700;
}

.book-details span {
    margin-left: 5px;
    margin-right: 5px;
}

.book-details .books-type-virtuel {
    background: var(--green);
    color: var(--white);
    padding: 8px 18px;
    border-radius: var(--border-raduis-default);
}

.book-details .books-type-physic {
    background: var(--primary);
    color: var(--white);
    padding: 8px 18px;
    border-radius: var(--border-raduis-default);
}

.book-details .books-type-physic i {
    margin-right: 10px;
}

/* partie 2 */

.main-container {
    display: flex;
    margin: 20px auto;
    gap: 20px;
    padding: 20px;
    background: var(--bg-section-primary);
    border-radius: var(--border-raduis-default);
    border: var(--size-border-solid) solid var(--color-border-section-primary);
}

/* Left Section */
.left-section {
    flex: 3;
}

.write-review,
.reviews {
    margin-bottom: 30px;
}

.review-box {
    display: flex;
    align-items: center;
    gap: 15px;
}

.send-review {
    width: 100%;
    display: flex;
    margin-top: 10px;
    margin-bottom: 10px;
    justify-content: space-between
}

.rating-stars {
    font-size: 20px;
    color: #ffd700;
    cursor: pointer;
}

.submit-btn {
    background-color: #00c4cc;
    color: var(--color-btn);
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.submit-btn:hover {
    background-color: #009da3;
}

.reviews-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.reviews-header .divoptions-select-wrapper {
    width: 50px;
}

.review {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.review-content h3 {
    margin: 0;
    font-size: 18px;
}

.review-content p {
    margin-top: 3px;
    margin-bottom: 10px;
    font-size: 15px;
    display: flex;
}

/* Right Section */
.related-books {
    flex: 1;
}

.related-card {
    display: flex;
    flex-wrap: wrap;
    justify-content: left;
    width: 530px;
}

.related-books .book {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 20px;
}

.related-books .book-info p {
    margin: 0;
}

.add-to-read {
    background-color: #00c4cc;
    color: var(--color-btn);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.add-to-read:hover {
    background-color: #009da3;
}

@media screen and (max-width: 980px) {
    .related-card {
        width: 330px;
    }
}

@media screen and (max-width: 736px) {
    .related-card {
        width: 100%;
    }
}

/* card */

.wrap-card {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    position: relative;
    gap: 2px;
    margin-bottom: 5px;
}

/* scrollab */

.scrollbar {
    /* firefox */
    scrollbar-width: thin;
    scrollbar-color: #888 transparent;
}

.scrollbar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: var(--border-raduis-default);
    border: 2px solid #ccc;
}

.scrollbar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: var(--border-raduis-default);
    border: 2px solid var(--white);
}

.scrollbar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.scrollbar::-webkit-scrollbar {
    width: 8px;
}

.scrollbar__h {
    overflow-x: scroll;
}

.scrollbar__v {
    overflow-y: scroll;
}


.card {
    width: 160px;
    height: 218px;
    border: var(--size-border-solid) solid transparent;
    border-radius: var(--border-raduis-default);
    background-color: transparent;
    padding: 5px;
    position: relative;
    display: inline-block;
    flex-shrink: 0;
    box-shadow: none;
    margin-bottom: 2px;
}

.card:hover {
    border: var(--size-border-solid) solid var(--color-border-button-secondary);
    background-color: var(--color-default);
}

.price-free {
    position: absolute;
    bottom: 44px;
    left: 10px;
    background: transparent;
    color: var(--color-text-button-third);
    padding: 2px 5px;
    font-weight: bold;
    border-radius: var(--border-raduis-default);
    font-size: 16px;
    font-style: italic;
    z-index: 1;
}

.card-view-load {
    position: absolute;
    width: 148px;
    height: 30%;
    bottom: 5px;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: var(--size-border-solid) solid transparent;
    padding: 4px;
    display: flex;
    flex-direction: row;
    justify-items: center;
    align-items: flex-end;
    overflow: hidden; /* important pour que le dégradé ne dépasse pas */
}

.card-view-load::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0) 40%, var(--color-footer-primary) 100%);
    pointer-events: none; /* pour que ça n'empêche pas les clics sur le contenu */
}

.card-view-load a {
    margin-left: 1px;
    margin-right: 1px;
}

.card-image {
    width: 100%;
    height: auto;
    border-radius: 18px;
    display: block;
    margin-bottom: 5px;
}

.card-content {
    padding: 10px;
    text-align: center;
}

.card-rating i.icon-star {
    font-size: 14px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.card-rating i.icon-star-half {
    font-size: 14px;
    margin: 3px;
    color: #ffa500;
    font-weight: 700;
}

.card-rating i.icon-star2 {
    font-size: 15px;
    margin: 3px;
    color: #b9b9b9;
    font-weight: 700;
}

.card-content a {
    margin-top: 10px;
}

@media screen and (max-width: 1024px) {
    .book-cover {
        height: 420px;
    }

    .author .book-download {
        grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    }

}

@media screen and (max-width: 980px) {

    .book-cover {
        height: 320px;
    }

    .author .book-download {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

@media screen and (max-width: 768px) {

    /* Card */
    .book-container {
        display: block;
        padding: 10px;
    }

    .book-cover {
        height: 540px;
    }

    .main-container {
        display: block;
        padding: 15px;
    }

    .book-cover img {
        width: 380px;
    }

    .author .book-download {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media screen and (max-width: 480px) {
    .book-cover {
        height: 550px;
    }

    .book-cover img {
        width: 100%;
    }

    .author .book-download {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}


.product-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    align-items: flex-start;
    padding: 1rem;
}

.product-images,
.product-details {
    flex: 1 1 300px;
    min-width: 280px;
}

.product-images {
    max-width: 500px;
}

.main-image img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    object-fit: cover;
}


/* Responsive breakpoint */
@media screen and (max-width: 768px) {
    .product-grid {
        flex-direction: column;
        align-items: center;
    }

    .product-images,
    .product-details {
        max-width: 100%;
    }
}

.product-images .main-image {
    background: #f9fafb;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}

.main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-top: 1rem;
}

.thumbnail {
    background: #f9fafb;
    border-radius: 0.5rem;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    border: 2px solid #e5e7eb;
    transition: border-color 0.2s;
}

.thumbnail.selected {
    border-color: #111827;
}

.thumbnail:hover {
    border-color: #d1d5db;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-details .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-text-title-primary);
}

.favorite {
    font-size: 1.5rem;
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    transition: color 0.2s;
}

.favorite:hover {
    color: #ef4444;
}

.description {
    color: #4b5563;
    line-height: 1.6;
}

.pricesp {
    font-size: 1.875rem;
    font-weight: 700;
}

.ratings {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: #facc15;
}

.review-count {
    font-size: 0.875rem;
    color: #6b7280;
}

.color-options h3 {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.color-buttons {
    display: flex;
    gap: 0.75rem;
}

.color {
    width: 2rem;
    height: 2rem;
    border-radius: 9999px;
    border: 2px solid #d1d5db;
    transition: border 0.2s;
    cursor: pointer;
}

.color:hover {
    border-color: #9ca3af;
}

.color.selected {
    border-color: #111827;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-outline {
    background: white;
    color: #111827;
    border: 2px solid #111827;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
}

.btn-outline:hover {
    background: #f9fafb;
}

.btn-primary {
    background: #111827;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: background-color 0.2s;
    border: none;
}

.btn-primary:hover {
    background: #1f2937;
}

.shipping-info {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #6b7280;
}

.shipping-info span {
    font-weight: 500;
}