/* Consolidated Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Barlow:ital,wght@0,300;0,400;0,600;0,700;1,400&family=Gotu&family=Merriweather:ital,wght@0,300;0,700;1,300&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Barlow', sans-serif;
}

:root {
    --body-color: #fff;    
    --header-bg:#F7F4EF;       
    --menu-color: #1C2430;    
    --menu-bg-trans: #b6064170;    
    --mobilemenu-color: #f7f4ef;
    --footer-bg: #1C2430;
    --footer-text: #a0a0a0;
    --footer-heading: #ffffff;
    --footer-link-hover: #ffffff;
    --footer-border: #2a2a2a;
    --text-main: #1a1a1a;
    --text-muted: #555;
    --accent-gold: #b3924e;
    --bg-light: #f9f9f9;
    --white: #ffffff;
    --border-soft: #eeeeee;
}


html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    /*overflow-x: hidden;*/
    box-sizing: border-box;
    background-color: var(--body-color);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


/* ====================HERO SECTION CSS STARTS ================= */

/* CAUTIONARY CSS: 
       We ensure the card is the relative container, 
       but we keep the 'Add to Cart' button clickable by raising its z-index.
    */
    .featured-book-card, .book-card {
        position: relative;
        transition: transform 0.3s ease;
    }

    .featured-book-card:hover, .book-card:hover {
        transform: translateY(-5px);
    }

    /* The Stretched Link */
    .buy-btn-ft::after {
        content: "";
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1; /* Covers the card */
    }

    /* CRITICAL: Keep Add to Cart and Search interactive */
    .btn-add-to-cart, .search-container input, .search-container button {
        position: relative;
        z-index: 5; 
    }
    
/* ===================================================================*/

/* --- Hero Section --- */
.hero {
    height: 180px;
    background: linear-gradient(rgba(0,0,0,0.25), rgba(0,0,0,0.25)), 
                url('/assets/images/web/rose-petals-bg.svg');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 20px;
}

.hero-content h2 {
    font-size: 2.5rem;
    font-family: 'Gotu', sans-serif;
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-style: italic;
    letter-spacing: 1px;
}

.hero-content p {
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    opacity: 0.9;
    font-weight: 300;
}

/* Mobile Carousel Logic */
@media screen and (max-width: 768px) {
    .hero-content h2{
        font-size: 1.5rem;
        font-weight: 700;
    }
    .hero-content p{
        display: none;
    }
    .hero {
        height: 100px;
    }
}

/* --- Featured Section --- */
.featured-book-section{
    display: flex;
    flex-direction: column;
    padding: 3rem 8%;
    align-items: start;
}

.featured-section-title h2{
    font-size: 1.4rem;
    color: #2d3436;
    letter-spacing: 2PX;
    margin-bottom: 20px;
    border-left: 4px solid #b60604;
    padding-left: 10px;
    margin-top: 5px;
}

.featured-box{
    display: inline-flex;
    /*justify-content: start;*/
    width: 100%;
    padding: 20px;
    /*border: 1px solid #9f9e9e28;*/
    border-radius: 8px;
    height: 350px;
}

/* Featured Card Style From Uiverse.io by dylanharriscameron */ 
.featured-book-card {
    position: relative;
    width: 240px;
    height: 320px;
    border-radius: 14px;
    z-index: 11;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 20px 20px 30px #bebebe, -20px -20px 30px #ffffff;
  }
  
  .bg {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 230px;
    height: 320px;
    z-index: 2;
    background: rgba(255, 255, 255, .95);
    backdrop-filter: blur(24px);
    border-radius: 10px;
    overflow: hidden;
    outline: 2px solid white;
  }

  .book-card-ft {
    background: white;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}


.book-card-ft:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}
.book-card-ft img{
    width: auto;
    height: 200px;
    object-fit: cover;
}

.ft-book-cover{
    width: auto;
    height: 300px;
    object-fit: cover;
}

.book-info-ft h3{
    font-size: 1rem;
} 

.author-ft {
    font-size: 0.825rem;
    color: #777;
    font-style: italic;
    margin-bottom: 12px;
    display: block;
}

.price-section-ft{
    width: 100%;
    display: inline-flex;
    align-items: start;       
    gap: 15px;
}

.price-ft {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-dark);   
}

.btn-add-to-cart {    
    background-color: #1a1a1a;
    color: white;
    text-align: center;
    border: none;
    outline: none;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: auto;
    font-size: .75rem;
    cursor: pointer;
}

.btn-add-to-cart:hover {
    background: #1a1a1a;
    color: #fff;
}

.buy-btn-ft {
    background-color: #b60640;
    color: white;
    text-align: center;
    padding: 4px 8px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: auto;
    font-size: .75rem;
    cursor: pointer;
}

.buy-btn-ft:hover {
    background-color: #3d0a13;
}

@media screen and (max-width: 768px) {
    .featured-book-section {
        padding: 2rem 0; /* Remove side padding to let carousel hit screen edges */
        margin-bottom: 5px;
    }

    .featured-section-title {
        padding-left: 15px; /* Keep title aligned with other content */
    }
    .featured-section-title h2{
        font-size: 1.05rem;
    }

    .featured-box {
        display: flex; /* Change from grid to flex for horizontal layout */
        flex-direction: row;
        overflow-x: auto; /* Enable horizontal scrolling */
        scroll-snap-type: x mandatory; /* Modern "snapping" feel */
        gap: 15px;
        padding: 20px 15px; /* Side padding allows first card to align */
        height: auto;
        border: none; /* Remove border for a cleaner mobile look */
        scrollbar-width: none; /* Hide scrollbar for Firefox */
    }

    .featured-box::-webkit-scrollbar {
        display: none; /* Hide scrollbar for Chrome/Safari */
    }

    .featured-book-card {
        flex: 0 0 82%; /* This ensures the 2nd card "peeks" in from the right */
        scroll-snap-align: center; /* Snaps card to center when scrolling stops */
        box-shadow: 0 10px 20px rgba(0,0,0,0.1); /* Softer shadow for mobile */
    }

    .bg {
        width: 96%; /* Adjust card internals for mobile width */
        height: 340px;
    }

    .ft-book-cover {
        height: 200px; /* Scale image down slightly for mobile */
    }

    .book-card-ft:hover {
        transform: none;      
    }
}
  
 /* .blob {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: #1c2430;
    opacity: 1;
    filter: blur(12px);
    animation: blob-bounce 10s infinite ease;
  }
  
  @keyframes blob-bounce {
    0% {
      transform: translate(-100%, -100%) translate3d(0, 0, 0);
    }
  
    25% {
      transform: translate(-100%, -100%) translate3d(100%, 0, 0);
    }
  
    50% {
      transform: translate(-100%, -100%) translate3d(100%, 100%, 0);
    }
  
    75% {
      transform: translate(-100%, -100%) translate3d(0, 100%, 0);
    }
  
    100% {
      transform: translate(-100%, -100%) translate3d(0, 0, 0);
    }
  }*/


  

/* --- BOOK COLLECTION Section --- */

.collection-container {
    max-width: 1200px;
    margin: 60px auto 80px; /* Overlap with hero slightly */
    padding: 0 20px;
}

.search-section {
    text-align: center;
    margin-bottom: 40px;
}
.search-section h1{
    font-size: 1.4rem;
    letter-spacing: 2px;
    margin-bottom: 15px;
    font-weight: 700;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 20px auto;
}

#bookSearch {
    width: 100%;
    padding: 12px 45px 12px 20px;
    border: 1px solid #ddd;
    border-radius: 25px; /* Modern rounded look */
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
}

#bookSearch:focus {
    border-color: #e63946; /* Brand Red accent */
    box-shadow: 0 0 8px rgba(230, 57, 70, 0.2);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
    pointer-events: none;
}


/* --- Book Grid --- */
/* --- Updated Book Grid --- */
.book-grid {
    display: grid;
    /* Forces exactly 4 columns on desktop */
    grid-template-columns: repeat(4, 1fr); 
    gap: 30px;
}

/* --- Responsive Adjustments --- */

/* For Tablets (approx 1024px and below) */
@media (max-width: 1100px) {
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    .hero-content h1 {
        font-size: 2.8rem;
    }
}


.book-card {
    background: white;
    border-radius: 4px;
    padding: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.book-cover {
    width: 100%;
    height: 250px;
    background-color: #f0f0f0;
    border-radius: 2px;
    margin-bottom: 20px;
    object-fit: cover;
    box-shadow: 5px 5px 15px rgba(0,0,0,0.1);
}

.book-info h3 {
    font-size: 1.05rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.author {
    font-size: 0.9rem;
    color: #777;
    font-style: italic;
    margin-bottom: 12px;
    display: block;
}

.price {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--text-dark);
    margin-bottom: 20px;
    display: block;
}

.buy-btn {
    background-color: #b60640;
    color: white;
    text-align: center;
    padding: 8px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: bold;
    transition: background 0.3s;
    margin-top: auto;
    font-size: .825rem;
}

.buy-btn:hover {
    background-color: #3d0a13;
}

/* Responsive adjustments for mobile */
/* For Mobile (600px and below) */

@media (max-width: 600px) {
    .collection-container{
        padding: 0;
    }
    .search-section{
        padding: 0 20px;
    }
    .search-section h1{
        font-size: 1.5rem;
    }
    .search-icon{
        left: 85%;
    }
    .search-container{
        display: flex;
    }

    .book-grid {
        /* Changes from 1fr to two equal columns */
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px; /* Tighter gap for mobile screen real estate */
        padding: 0 5px;
    }


    .book-card {
        padding: 8px; /* Reduced padding inside the card */
    }

    .book-card:hover{
        transform: none;
    }

    .book-card img{
        height: 150px;
    }

    .ajax-cart-form {
        display: flex !important;
        flex-direction: row !important; /* Keep buttons horizontal */
        gap: 4px; /* Tiny gap between Add and Buy */
        width: 100%;
        margin-top: 8px;
    }

    /*.book-cover {
        height: 180px; /* Shorter height so two cards fit well on one screen 
        margin-bottom: 10px;
    }

    .book-info h3 {
        font-size: 0.9rem; /* Smaller title to prevent awkward text wrapping 
    }*/

    /* Stack the buttons vertically on mobile if they are too wide */
    .btn-add-to-cart, .buy-btn-ft {
        flex: 1; /* Both buttons take equal width */
        font-size: 0.65rem; /* Very small font to fit text */
        padding: 6px 2px;
        white-space: nowrap; /* Prevents text from wrapping */
        text-align: center;
    }

    .price-ft {
        font-size: 0.85rem; /* Smaller price to save space */
    }
}

