
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    background-color: #ffe8c5;

    font-family: "Poppins", sans-serif;
    font-style: normal;
    font-weight: 300;
    color: #402620;
}

.button {
    display: inline-block;
    padding: 10px 50px;
    border: 1px solid;
    text-decoration: none;
    font-size: 2rem;
    border-radius: 14px;
    color: #402620;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    transition: color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
}

.button:hover {
    background-color: #402620;
    color: white;
}

@media screen and (max-width: 768px) {

    .button {
        color: white;
        background-color: #402620;
    }
}

.book-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1 1 calc(33.33% - 20px);
    box-sizing: border-box;
    margin: 10px;
    max-width: 450px;
    padding: 10px;
    background-color: rgba(255, 245, 220, 0.5);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    border-radius: 8px;
    overflow: hidden;
}

.book-card a {
    text-decoration: none;
}

.book-card:hover {
    background-color: rgb(255, 245, 220);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.book-thumbnail {
    width: 200px;
    height: auto;
    max-height: 300px;
    object-fit:contain;
    border-radius: 5px;
}

.book-title {
    font-size: 1.75em;
    margin: 10px 0;
    color: #333;
}

.book-description {
    font-size: 1em;
    color: #666;
    padding: 0 10px;
    margin-bottom: 10px;
    flex-grow: 1;
}


.book-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 10px 20px;
    gap: 10px;
}

.book-footer .price-section {
    text-align: left;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.book-footer .sale-price {
    font-size: 1.5em;
    color: red;
}

.book-footer .price {
    font-size: 1.5em;
    color:#402620
}

.book-footer .discount {
    font-size: 0.9em;
    color: #999;
    display: block;
}

.add-to-cart {
    background-color: #98FB98;
    border: none;
    padding: 10px 20px;
    color: #333;
    font-size: 1em;
    border-radius: 20px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.add-to-cart:hover {
    background-color: #8FDC8F;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.book-card.out-of-stock {
    position: relative;
    pointer-events: none;
    cursor: not-allowed;
}

.book-card.out-of-stock::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 1;
    transition: backdrop-filter 0.3s ease;
}

.book-card.out-of-stock::after {
    content: "Indisponibil";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    z-index: 2;
    text-transform: uppercase;
    pointer-events: none;
}

.book-card.out-of-stock:hover::before {
    backdrop-filter: blur(5px);
}

@media screen and (min-width: 1920px) {
    .book-card {
        max-width: 400px
    }
}

@media screen and (max-width: 1919px) {
    .book-card {
        max-width: 450px;
        padding: 10px 15px;
    }

    .book-title {
        font-size: 1.5em;
    }
    
    .add-to-cart {
        padding: 7px 7px;
    }
}

@media screen and (max-width: 1080px) {
    .book-card {
        max-width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .book-card {
        width: calc(50% - 20px);
        max-width: 100%;
    }
}

@media screen and (max-width: 480px) {
    .book-card {
        width: 100%;
        margin: 10px 0;
    }
}

.message-overlay {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: #FFBD59;
    color:#402620;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    font-size: 1.25rem;
    font-weight: 400;
    z-index: 1000;
    opacity: 0;
    transform: translateX(100%);
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.message-overlay.show {
    opacity: 1;
    transform: translateX(0);
}

.message-overlay.hide {
    opacity: 0;
    transform: translateX(100%);
}