/* Product Card Base Styles - Used across Shop and Home Page */
.product-card {
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Ensure cards have fixed width for consistent 4-item scroll */
    flex: 0 0 calc(25% - 24px);
    min-width: 250px;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.product-image {
    position: relative;
    height: 350px;
    /* Fixed height for consistency */
    background-color: #F8F9FA;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    border-radius: 8px;
}

.product-image img {
    height: 100%;
    width: auto;
    max-width: 90%;
    object-fit: contain;
    filter: drop-shadow(0 15px 25px rgba(0, 0, 0, 0.2));
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    /* Moved to right to avoid overlapping with book spine usually on left */
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 40px;
    background-color: #1a1a1a;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.product-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    z-index: 5;
}

.product-card:hover .product-overlay {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.add-to-cart-btn {
    background-color: #1a1a1a;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    background-color: #333;
    transform: scale(1.05);
}

.product-info {
    text-align: center;
    padding-top: 5px;
}

.product-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    font-family: 'Playfair Display', serif;
    color: #1a1a1a;
    height: 2.4em;
    /* Fixed height for 2 lines */
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
}

.product-author {
    font-size: 13px;
    color: #666;
    margin-bottom: 10px;
    height: 1.2em;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-price {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.price-original {
    text-decoration: line-through;
    color: #999;
}

.price-sale {
    font-weight: 700;
    color: #e63946;
    /* Using a bit of color for sale */
}

.price-regular {
    font-weight: 600;
}

/* Shop Page Layout */
.shop-hero {
    background: linear-gradient(135deg, #E8B5E8 0%, #D8A5D8 100%);
    padding: 100px 0;
    text-align: center;
    color: #1a1a1a;
}

.shop-title {
    font-size: 72px;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.shop-subtitle {
    font-size: 20px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

.shop-section {
    padding: 80px 0;
    background-color: #FDFBF7;
    /* Slightly warmer white for shop */
}

.shop-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 60px;
}

/* Sidebar Filters */
.filter-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.filter-group {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    font-size: 20px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.filter-list {
    list-style: none;
}

.filter-item {
    font-size: 15px;
    color: #666;
    padding: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-item:hover {
    color: #1a1a1a;
    padding-left: 5px;
}

.filter-item.active {
    color: #1a1a1a;
    font-weight: 600;
}

/* Product View Area */
.product-view {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.product-results {
    font-size: 15px;
    color: #666;
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #1a1a1a;
    font-weight: 500;
}

.sort-dropdown select {
    padding: 10px 15px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    font-family: inherit;
    outline: none;
}

/* Horizontal Grid Layout - 4 Columns */
.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px 30px;
    /* Vertical gap 40px, Horizontal gap 30px */
}

/* Media Queries */
@media (max-width: 1400px) {
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1100px) {
    .shop-layout {
        grid-template-columns: 240px 1fr;
        gap: 30px;
    }
}

@media (max-width: 900px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        position: static;
        flex-direction: row;
        gap: 20px;
        overflow-x: auto;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
        margin-bottom: 30px;
    }

    .filter-group {
        margin-bottom: 0;
        padding-bottom: 0;
        border-bottom: none;
        flex-shrink: 0;
    }

    .filter-list {
        display: flex;
        gap: 15px;
    }

    .filter-item {
        white-space: nowrap;
        background: #F0F0F0;
        padding: 8px 16px;
        border-radius: 20px;
    }

    .filter-item.active {
        background: #1a1a1a;
        color: #fff;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .shop-title {
        font-size: 48px;
    }

    .products-grid {
        gap: 20px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
}

/* Carousel / Slider Styles (Shared) */
.products-section {
    padding: 80px 0;
    background-color: #F5F1E8;
}

.products-carousel-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 20px;
}

.products-slider {
    display: flex;
    gap: 32px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    padding: 24px 0;
    width: 100%;
    scroll-snap-type: x mandatory;
}

.product-card {
    scroll-snap-align: start;
}

.products-slider::-webkit-scrollbar {
    display: none;
}

.products-carousel-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    padding: 0 10px;
}

.products-carousel-btn:hover {
    color: #1a1a1a;
}

.products-slider-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #ccc;
    cursor: pointer;
    transition: background-color 0.3s;
}

.dot.active {
    background-color: #1a1a1a;
}

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: #FAF9F6;
    z-index: 1000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.05);
    transition: right 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
}

.cart-sidebar.open {
    right: 0;
}

.cart-header {
    padding: 30px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h2 {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    font-family: 'Playfair Display', serif;
}

.close-cart {
    font-size: 24px;
    color: #1a1a1a;
    transition: opacity 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.close-cart:hover {
    opacity: 0.6;
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
}

.empty-cart-msg {
    text-align: center;
    margin-top: 60px;
    font-size: 16px;
    color: #666;
}

.cart-item {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-item-img {
    width: 70px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.cart-item-info {
    flex: 1;
}

.cart-item-title {
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.cart-item-author {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    transition: all 0.2s;
    background: #fff;
    cursor: pointer;
}

.qty-btn:hover {
    background-color: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.cart-footer {
    padding: 30px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    font-weight: 700;
    font-size: 20px;
    color: #1a1a1a;
}

.checkout-btn {
    width: 100%;
    background-color: #1a1a1a;
    color: #fff;
    padding: 18px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.checkout-btn:hover {
    background-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Cart Overlay */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

.cart-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #1a1a1a;
    color: #fff;
    padding: 15px 25px;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast-message {
    font-size: 14px;
    font-weight: 500;
}

/* Extra Media Query for Sidebar on Mobile */
@media (max-width: 480px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }

    .products-slider {
        gap: 15px;
    }

    .product-card {
        flex: 0 0 calc(100%);
    }
}

@media (max-width: 1024px) {
    .product-card {
        flex: 0 0 calc(33.333% - 22px);
    }
}

@media (max-width: 768px) {
    .product-card {
        flex: 0 0 calc(50% - 16px);
    }
}