* {
    box-sizing: border-box;
}

body {
    margin: 0;
    margin-top: 20px;
    padding: 20px;
    background: #f4f4f4;
    font-family: 'Courier New', Courier, monospace;
}
.book-list {
    margin: 40px auto;
    padding: 30px 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    overflow-y: auto;
}
.book-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;  /* instead of center */
    flex: 0 0 300px;
    max-width: 100%;
    height: 480px; /* slightly taller for consistent button room */
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative; /* for button positioning */
}

h1 {
    color: #222;
    font-family: Arial, sans-serif;
    text-align: center;
}
p {
    font-size: 16px;
    line-height: 1.5;
    color: #444;
    text-align: center;
}
h1, p {
    margin-bottom: 20px;
}
img {
    display: block;
    margin: 20px auto;
    width: 150px;
    height: 200px;
    max-width: 100%;
}
.bestseller {
    font-size: 10px;
    color: red;
}
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 15px;
    font-size: 14px;
    background-color: #007BFF;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .back-button {
        top: 12px;
        left: 12px;
        padding: 8px 12px;
        font-size: 12px;
    }

    body {
        padding-top: 70px !important;
    }
}
@media (max-width: 600px) {
    .book-card {
        height: auto;
        padding: 12px;
    }

    .book-card img {
        height: auto;
        width: 100%;
        max-width: 180px;
    }
}
#openCart {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    z-index: 9999;
}

.cart-panel {
    display: none;
    position: fixed;
    right: 20px;
    top: 70px;
    width: 260px;
    background: #222;
    color: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    z-index: 9999;
}

.cart-panel h2 {
    margin-bottom: 10px;
}

.cart-panel ul {
    padding-left: 20px;
    margin-bottom: 15px;
}
.openCart {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px 15px;
    background: #007bff;
    color: white;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    z-index: 9999;
}
.add-cart-btn {
    margin-top: auto; /* pushes the button to the bottom */
    padding: 6px 15px;
    background: #007bff;
    color: white;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.2s ease;
}

.top-button {
    font-size: 20px;
    margin-top: auto;
    top: 20px;
    right: 20px;
    padding: 15px 15px;
    background: #007bff;
    color: white;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    z-index: 9999;
    width: 150px;
}

.mobile-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 12px;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.mobile-header .back-button,
.mobile-header .openCart {
    position: static;
    margin: 0;
}

body {
    padding-top: 80px !important;
}

@media (max-width: 600px) {
    body {
        padding-top: 90px !important;
    }
}
