* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f7f4ed;
    color: #222;
}

header {
    padding: 25px;
    text-align: center;
    background-color: #161616;
    color: white;
}

header h1 {
    margin: 0 0 5px;
}

nav {
    margin-top: 20px;
}

nav a {
    margin: 0 10px;
    color: white;
    text-decoration: none;
}

nav a:hover {
    text-decoration: underline;
}

.hero {
    min-height: 380px;
    background-image: url("https://images.unsplash.com/photo-1524995997946-a1c2e315a42f");
    background-size: cover;
    background-position: center;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    text-align: center;
}

.hero-content {
    max-width: 700px;
    padding: 30px;
    border-radius: 12px;
    background-color: rgba(0, 0, 0, 0.62);
    color: white;
}

.hero-content h1 {
    margin-top: 0;
    font-size: 42px;
}

.main-button,
.buy-button,
.favorite-button,
.submit-review,
#clear-cart {
    display: inline-block;
    padding: 11px 18px;
    border: none;
    border-radius: 6px;
    background-color: #222;
    color: white;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
}

.main-button:hover,
.buy-button:hover,
.favorite-button:hover,
.submit-review:hover,
#clear-cart:hover {
    background-color: #b78b25;
    color: black;
}

main section {
    padding: 45px 20px;
}

main section > h2 {
    text-align: center;
}

.search-area {
    max-width: 600px;
    margin: 0 auto 25px;
}

#book-search {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #c5c5c5;
    border-radius: 30px;
    font-size: 18px;
    outline: none;
}

#book-search:focus {
    border-color: #222;
}

.category-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.category-button {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    background-color: #222;
    color: white;
    cursor: pointer;
}

.category-button.active {
    background-color: #b78b25;
    color: black;
}

.book-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
}

.book-card {
    width: 300px;
    padding: 20px;
    border-radius: 8px;
    background-color: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
}

.book-card img {
    width: 100%;
    height: 330px;
    object-fit: cover;
    border-radius: 5px;
}

.language {
    font-weight: bold;
}

.price {
    font-size: 22px;
    font-weight: bold;
}

.book-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.favorite-button.is-favorite {
    background-color: #8b1e1e;
}

.review-box {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px solid #ddd;
}

.review-box label,
.review-box select,
.review-box textarea {
    display: block;
    width: 100%;
    margin-bottom: 8px;
}

.review-box select,
.review-box textarea {
    padding: 9px;
}

.review-box textarea {
    min-height: 75px;
    resize: vertical;
}

.single-review {
    margin-top: 10px;
    padding: 10px;
    background-color: #f3f3f3;
    border-radius: 5px;
}

#favorites,
#cart,
#checkout {
    max-width: 900px;
    margin: auto;
}

.favorite-item,
.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    padding: 14px;
    border-radius: 6px;
    background-color: white;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.quantity-controls button,
.remove-favorite {
    padding: 7px 11px;
    border: none;
    border-radius: 5px;
    background-color: #222;
    color: white;
    cursor: pointer;
}

.remove-item,
.remove-favorite {
    background-color: #8b1e1e !important;
}

#cart-total {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
}

#clear-cart {
    display: block;
    margin: auto;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}

.form-grid label {
    display: flex;
    flex-direction: column;
    font-weight: bold;
}

.form-grid input,
.form-grid select {
    margin-top: 5px;
    padding: 11px;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 16px;
}

#order-summary {
    margin-top: 25px;
    padding: 20px;
    background-color: white;
    border-radius: 7px;
}

.payment-warning {
    margin-top: 20px;
    padding: 12px;
    background-color: #fff1c7;
    border-radius: 6px;
}

footer {
    padding: 20px;
    text-align: center;
    background-color: #161616;
    color: white;
}

@media (max-width: 700px) {
    nav a {
        display: block;
        margin: 8px;
    }

    .hero {
        min-height: 320px;
    }

    .hero-content h1 {
        font-size: 31px;
    }

    .book-card {
        width: 100%;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .cart-item,
    .favorite-item {
        flex-direction: column;
        align-items: flex-start;
    }
}
