/* --- Custom CSS --- */
:root {
    --primary-color: #5F0A0B;
    --secondary-color: #FFD0D0; /* For light grey backgrounds */
    --nav-bg-color: #9F1D1E;
    --hero-bg-color: #FFC0C1;
    --white-color: hsl(0, 0%, 100%);
    --text-dark: #281672;
    --text-light: #5a6a7a;
    --accent-color: #4a3d8f; /* Lighter version of primary for hover */
    --price-color: #cb3d40;
    --border-color: #dce3ec;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f8f9fa;
    color: var(--text-dark);
}
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* Custom font for Marathi text */
.marathi-font {
    font-family: 'Tiro Devanagari Marathi', serif;
}

/* --- Header --- */
.top-header {
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.header-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white-color);
    letter-spacing: -1px;
}

.search-bar {
    max-width: 400px;
    border-radius: 28px;
    overflow: hidden;
}

.search-bar .form-control {
    border: none;
    background-color: #fff;
    color: #49454F;
}
.search-bar .form-control::placeholder {
    color: #49454F;
    opacity: 1;
}
.search-bar .btn {
    border: none;
    background-color: #fff;
    color: #49454F;
}
.search-bar .form-control:focus {
    box-shadow: none;
    background-color: #ECE6F0;
}

.header-icons .nav-link {
    font-size: 1.25rem;
    color: var(--white-color);
    transition: color 0.3s;
}
.header-icons .nav-link:hover {
    color: var(--nav-bg-color);
}

.sticky-top.header-scrolled {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: var(--primary-color);
    transition: box-shadow 0.3s, background-color 0.3s;
}

.main-nav {
    background-color: var(--nav-bg-color);
    border-bottom: 0px solid #c8c8c8;
}
.main-nav .nav-link {
    color: var(--white-color);
    font-weight: 500;
    padding: 0.70rem 1.5rem;
    transition: color 0.3s, background-color 0.3s;
}
.main-nav .nav-link:hover, .main-nav .nav-link.active {
    color: var(--primary-color);
    background-color: var(--white-color);
}

/* Mobile Header */
.mobile-header {
    background-color: var(--primary-color);
    border-bottom: 1px solid var(--primary-color);
}

.mobile-nav-toggle {
    font-size: 1.75rem;
    color: var(--white-color);
    border: none;
    background: transparent;
}

/* Mobile Offcanvas Menu Styles */
.offcanvas#mobileMenu .offcanvas-header {
    background-color: var(--primary-color);
}
 .offcanvas#mobileMenu .offcanvas-title {
    color: var(--white-color);
}
.offcanvas#mobileMenu .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}
.offcanvas#mobileMenu .offcanvas-body {
    padding: 1rem;
    background-color: #f0f0f0;
}
#mobileMenu .nav-item {
    background-color: var(--nav-bg-color);
    margin-bottom: 5px;
    border-radius: 8px;
}
#mobileMenu .nav-link {
    color: var(--secondary-color);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: background-color 0.3s;
}
#mobileMenu .nav-link.active,
#mobileMenu .nav-link:hover {
    color: var(--primary-color);
    background-color: var(--white-color);
}

/* --- Hero Section --- */
.hero-section {
    background-color: var(--hero-bg-color);
    padding: 0.1rem 0;
}
.hero-section .text-muted {
    letter-spacing: 2px;
    font-size: 0.9rem;
    color: var(--primary-color) !important;
}
.hero-section .display-3, .hero-section h2, .hero-section .lead {
    color: var(--primary-color);
}
.hero-section .display-3 {
    font-size: 4rem;
    font-weight: bold;
}

.btn-shop-now, #backToTop, .product-card-sm .btn-icon {
    background-color: var(--primary-color);
    color: var(--white-color);
}

.btn-shop-now:hover, #backToTop:hover, .product-card-sm .btn-icon:hover {
    background-color: var(--accent-color);
    color: var(--white-color);
}

.btn-shop-now {
    padding: 0.75rem 2rem;
    font-weight: bold;
    border-radius: 50px;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.btn-shop-now:hover {
    transform: translateY(-2px);
}

/* --- Section Styling --- */
.section-padding {
    padding: 2rem 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.section-title {
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--primary-color);
}
.view-more-link {
    color: var(--accent-color);
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}
.view-more-link:hover {
    color: var(--primary-color);
}

/* --- Product Cards --- */
.product-card-lg {
    background-color: var(--secondary-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}
.product-card-lg:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.product-card-lg .book-title {
    font-weight: bold;
    color: var(--primary-color);
}
.product-card-lg .price {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--price-color);
}
.product-card-lg .price-striked {
    text-decoration: line-through;
    color: var(--text-light);
    font-size: 1rem;
    margin-left: 0.5rem;
}

/* Responsive image for the large product card */
.product-card-lg-img {
    width: 120px;
    height: auto;
    border-radius: 8px;
    object-fit: cover;
}

@media (min-width: 768px) {
    .product-card-lg-img {
        width: 180px; /* Restore original size on desktop */
    }
}


.product-card-sm {
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.product-card-sm:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    border-color: var(--border-color);
}
.product-card-sm .placeholder-img {
    background-color: var(--secondary-color);
    height: 220px;
    border-radius: 8px;
    margin-bottom: 1rem;
}
.product-card-sm .book-title {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1rem;
    min-height: 40px; /* To align titles */
}
.product-card-sm .price {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--price-color);
    background-color: #fdeeee;
    padding: 0.2rem 0.5rem;
    border-radius: 5px;
}
.product-card-sm .price-striked {
    color: var(--text-light);
    text-decoration: line-through;
    font-size: 0.9rem;
}
.product-card-sm .actions {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}
.product-card-sm .btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background-color 0.3s, color 0.3s;
}

/* --- New Arrivals Button Styles --- */
.btn-add-to-cart {
    background-color: var(--primary-color);
    color: var(--white-color);
    font-weight: bold;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    transition: background-color 0.3s;
    display: inline-flex;
    align-items: center;
    font-size:0.8rem;
}

.btn-add-to-cart:hover {
     background-color: var(--accent-color);
}

.btn-view-details {
    color: var(--text-light);
    font-weight: bold;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s;
}

.btn-view-details:hover {
    color: var(--primary-color);
}

/* --- Testimonial Section --- */
.testimonial-section {
    background-color: var(--hero-bg-color);
}
.testimonial-card {
    background-color: #FFD0D0;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    height: 100%;
}
.testimonial-card .lead {
    font-style: italic;
    color: var(--text-dark);
}
.testimonial-card .author {
    font-weight: bold;
    color: var(--primary-color);
    margin-top: 1.5rem;
}
.swiper-nav-btn {
    color: var(--primary-color);
    background-color: #fff;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    transition: background-color 0.3s, color 0.3s;
    top: 65%;
    transform: translateY(-50%);
}
.swiper-nav-btn:hover {
     background-color: var(--primary-color);
     color: #fff;
}
.swiper-nav-btn::after {
    font-size: 1.2rem;
    font-weight: bold;
}
.swiper-button-prev { left: -15px; }
.swiper-button-next { right: -15px; }

/* --- Footer --- */
.footer {
    background-color: var(--hero-bg-color);
    color: var(--primary-color);
}
.footer-logo, .footer h5, .footer .list-unstyled li a, .footer .social-icons a {
    color: var(--primary-color);
}

.footer-logo {
    font-size: 2rem;
    margin-bottom: 1rem;
}
.footer h5 {
    font-weight: bold;
    margin-bottom: 1.5rem;
}
.footer .list-unstyled li a {
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
}
.footer .list-unstyled li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}
.footer .social-icons a {
    font-size: 1.2rem;
    margin-right: 1rem;
    transition: color 0.3s, transform 0.3s;
}
.footer .social-icons a:hover {
    color: var(--accent-color);
    transform: scale(1.1);
}
.footer-bottom {
    padding: 1rem 0;
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* --- On-screen Cart Alert --- */
.cart-success-alert {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translate(-50%, 100px);
    background-color: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 50px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out, visibility 0.4s;
    font-size: 0.9rem;
}
.cart-success-alert.show {
    transform: translate(-50%, 0);
    opacity: 1;
    visibility: visible;
}

/* --- Back to Top Button --- */
#backToTop {
    display: none;
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 1000;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    transition: background-color 0.3s, transform 0.3s;
}

.description-lg {
    /* Limits the text to 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    
    /* You may also need to set a min-height to keep cards aligned */
    /* min-height: 72px; */ /* (Adjust based on your font size) */
}

/* --- Mobile Specific Overrides --- */
@media (max-width: 767.98px) {
    .hero-section {
        padding: 1.5rem 0;
        text-align: center;
    }
    .hero-section .display-3 {
        font-size: 2.5rem;
    }
   /* .hero-image {
        display: none;
    }
    */
    .section-padding {
        padding: 2.5rem 0;
    }
    .product-card-sm {
        padding: 0;
    }
     .product-card-lg .text-end {
        text-align: start !important;
        margin-top: 1rem;
    }
    .swiper-nav-btn {
        width: 30px;
        height: 30px;
        top: 65%; /* Better vertical alignment */
    }
    .swiper-button-prev, .swiper-button-prev.swiper-nav-btn {
        left: 10px;
    }
    .swiper-button-next, .swiper-button-next.swiper-nav-btn {
        right: 10px;
    }
    .swiper-nav-btn::after {
        font-size: 1rem; /* Smaller arrows */
    }
    .footer {
        text-align: center;
    }
     .footer .social-icons {
        justify-content: center;
    }
    .product-card-sm .btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }
    /* === NEW Styles for Mobile New Arrivals Card === */
    .product-card-mobile {
        border: 1px solid var(--border-color);
        background-color: var(--secondary-color);
        box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    }
    .product-card-mobile .card-body {
        padding: 0.75rem; /* Reduced padding */
    }
    .product-card-mobile .object-fit-cover {
        object-fit: cover; /* Ensure image covers the area */
    }
     .product-card-mobile .book-title-mobile {
        font-weight: bold;
        color: var(--primary-color);
        font-size: 0.9rem; /* Slightly smaller title */
        /* Limit title to 2 lines */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.4em; /* Approx height for 2 lines */
    }
    .product-card-mobile .description-mobile {
        font-size: 0.75rem; /* Smaller description */
         /* Limit desc to 2 lines */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        min-height: 2.2em; /* Approx height for 2 lines */
        color: var(--text-light);
    }
     .product-card-mobile .price-mobile {
        font-size: 1.1rem;
        font-weight: bold;
        color: var(--price-color);
    }
    .product-card-mobile .price-striked-mobile {
        text-decoration: line-through;
        color: var(--text-light);
        font-size: 0.8rem;
        margin-left: 0.3rem;
    }
    .product-card-mobile .btn-add-to-cart.btn-sm {
         padding: 0.4rem 0.6rem;
         font-size: 0.75rem; /* Smaller button text */
    }
    .product-card-mobile .btn-icon-mobile {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9rem;
        padding: 0;
        border: 1px solid var(--border-color); /* Add a border to wishlist */
        background-color: #fff;
        color: var(--primary-color);
    }
     .product-card-mobile .wishlist-btn-sm i.wishlist-item-active {
         color: #cb3d40; /* Red when active */
     }
     /* Style for desktop wishlist button next to cart */
     .wishlist-btn-lg {
        padding: 0.6rem; /* Match cart button padding */
        border-radius: 8px; /* Match cart button radius */
        background-color: #fff;
        color: var(--primary-color);
        border: 1px solid var(--border-color);
        line-height: 1; /* Align icon better */
     }
      .wishlist-btn-lg i.wishlist-item-active {
          color: #cb3d40;
      }
    /* === END Mobile New Arrivals Card Styles === */
}

/* Mobile Bottom Nav */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1030;
}
.mobile-bottom-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-light);
}
.mobile-bottom-nav .nav-link i {
    font-size: 1.25rem;
}
.mobile-bottom-nav .nav-link.active, .mobile-bottom-nav .nav-link:hover {
    color: var(--primary-color);
}

/* --- Wishlist Heart Animation --- */
.wishlist-form .btn-icon i {
    transition: transform 0.2s ease-in-out, color 0.3s ease;
}

.wishlist-form .btn-icon:hover i {
    transform: scale(1.2);
}

.wishlist-item-active {
    color: #cb3d40; /* Same as price color */
    animation: heart-beat 0.5s ease-in-out;
}

@keyframes heart-beat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* --- Alert Box Enhancements for Wishlist --- */
#cart-alert.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

#cart-alert.alert-success {
    background-color: #d4edda;
    color: #155724;
}

