/* ===============================
   BOOK SLIDER SECTION STYLES
   =============================== */

.bestsellers-section {
    width: 100%;
    background: #fff;
    padding: 40px 0;
    box-sizing: border-box;
}

.bestsellers-section .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.slider-loader {
    width: 100%;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    /* center horizontally */
    justify-content: center;
    /* center vertically */
    text-align: center;
    /* center text inside */
    padding: 30px 40px;
    box-sizing: border-box;
    border-radius: 8px;
}

.loader-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* center text block horizontally */
    justify-content: center;
    /* center vertically */
    margin-right: 100px;
}

/* Title */
.loader-text h1 {
    font-size: 2.2rem;
    color: #1a1a1a;
    margin-top: 25px;
    margin-bottom: 15px;
    font-weight: 800;
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-transform: none;
    text-align: center;
}

/* Subtitle / Description */
.loader-text p {
    font-size: 1.3rem;
    color: #666;
    margin: 0;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    text-align: center;
}


/* ---------- Section Header ---------- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.section-header p {
    font-size: 1rem;
    color: #555;
    margin: 0 10px;
    flex: 1;
}

.section-header .see-all-link {
    color: #1e3a8a;
    font-weight: 600;
    text-decoration: none;
}

.section-header .see-all-link:hover {
    text-decoration: underline;
}

/* ---------- Book Card Layout ---------- */
.books-flex {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.bestseller-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
    padding: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin: 0 100px 0 0 !important;
}

.bestseller-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.book-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

/* ---------- Book Image ---------- */
.book-image {
    flex: 0 0 120px;
    height: 160px;
    background: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.book-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- Wishlist Heart Styling (Same as previous page) --- */
.bestseller-card .wishlist-heart {
    position: relative;
    /* stays within the normal flow above image */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 25px;
    height: 25px;
    margin: 0 0 8px auto;
    /* push to right side */
    background-color: #dcdada;
    border: 2px solid #838080;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Heart icon */
.bestseller-card .wishlist-heart i {
    color: #ffffff;
    font-size: 16px;
    transition: color 0.3s ease;
}

/* Active (book added to wishlist) */
.bestseller-card .wishlist-heart.active {
    background-color: #fff;
    /* red circle when active */
    border-color: #ff4d4d;
}

.bestseller-card .wishlist-heart.active i {
    color: #ff4d4d;
    /* white heart inside red circle */
}

/* Hover effect */
.bestseller-card .wishlist-heart:hover {
    transform: scale(1.1);
    border-color: #ff4d4d;
}

.bestseller-card .wishlist-heart:hover i {
    color: #ff4d4d;
}

/* --- Wishlist Tooltip --- */
.wishlist-tooltip {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ffffff;
    color: #333;
    padding: 6px 10px;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    border-left: 4px solid #28a745;
    /* green for success */
    white-space: nowrap;
    opacity: 0;
    transform: translateY(5px);
    animation: tooltipFade 0.3s forwards;
}

/* Error (removed or failed) */
.wishlist-tooltip.error {
    border-left-color: #ff4d4d;
    /* red on left border */
}

.wishlist-tooltip i {
    color: #28a745;
}

.wishlist-tooltip.error i {
    color: #ff4d4d;
}

/* ✨ Arrow (attached to tooltip, pointing upward to the heart) */
.wishlist-tooltip .wishlist-tooltip-arrow {
    position: absolute;
    bottom: 100%;
    /* attach arrow above tooltip */
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid white;
}

/* Animation */
@keyframes tooltipFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- Book Details ---------- */
.book-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-details h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 6px;
}

.author {
    font-size: 14px;
    margin: 4px 0;
}

.author .by-text {
    color: #000;
    /* black */
    font-weight: 500;
}

.author .author-name {
    color: #059669;
    /* green shade (you can change this) */
    font-weight: 600;
    margin-left: 4px;
    /* small gap between "By" and name */
}

.book-details .edition,
.book-details .isbn {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.book-details .price-container {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 6px;
}

.book-details .original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 0.9rem;
}

.free-price {
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: 800;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    padding: 8px 16px;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(238, 90, 36, 0.3);
    position: relative;
    overflow: hidden;
    animation: pulse 2s infinite;
}

.free-price::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 3s infinite;
}



/* Bestsellers FREE tag: compact green outline pill */
.bestsellers-section .free-price {
    font-size: 0.75rem;
    font-weight: 700;
    color: #0b7a3e;
    background: rgba(11, 122, 62, 0.08);
    border: 1px solid rgba(11, 122, 62, 0.35);
    padding: 3px 8px 1px 8px;
    border-radius: 999px;
    letter-spacing: .4px;
    box-shadow: none;
    animation: none;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ---------- Empty State ---------- */
.bestsellers-empty-wrap {
    text-align: center;
    padding: 60px 0;
}

.slider-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
}

.slider-empty-state .empty-icon {
    font-size: 3rem;
    color: #aaa;
    margin-bottom: 10px;
}

/* Pagination Container */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0;
}

/* Page Number List */
.pagination ul.page-numbers {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 6px;
}

/* Each Page Item */
.pagination ul.page-numbers li {
    display: inline-block;
}

/* Links & Dots */
.pagination a.page-link,
.pagination span.dots {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Hover Effect */
.pagination a.page-link:hover {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a;
}

/* Active Page */
.pagination a.page-link.active {
    background: #1e3a8a;
    color: #fff;
    border-color: #1e3a8a;
    font-weight: 600;
}

/* Dots (...) between pages */
.pagination span.dots {
    color: #999;
    border: none;
    background: transparent;
    padding: 8px 10px;
}

.pagination-summary-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* keeps it responsive */
    margin: 0 100px 0 0 !important;
}

.record-summary {
    font-size: 16px;
    color: #333;
}

.record-summary2 {
    font-size: 16px;
    color: #333;
    margin-top: 50px !important;
}

.pagination-wrap {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


.count-green {
    color: #16a34a;
    /* modern green (tailwind's green-600) */
    font-weight: 700;
}

.count-blue {
    color: #555;
    /* theme blue */
    font-weight: 700;
    font-size: 18px;
}

.title-separator {
    width: calc(100% - 100px);
    /* full width minus right margin */
    height: 3px;
    background-color: #ccc;
    border: none;
    margin: 30px 100px 0 0;
    /* top right bottom left: top 30px, right 0, bottom 0, left 0 */
    border-radius: 2px;
}

/* Wrapper layout */
.content-wrapper {
    display: flex;
    align-items: flex-start;
}

/* Sidebar styling */
.sidebar {
    width: 150px;
    position: sticky;
    top: 50px;
    background: #fff;
    padding: 15px;
    border-radius: 5px;
    height: fit-content;
    margin: 70px 20px 0 0 !important;
}

.sidebar h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.sidebar a {
    display: block;
    padding: 8px 0;
    text-decoration: none;
    color: #333;
}

.sidebar a:hover {
    color: #007bff;
}

/* Main content */
.main-content {
    flex: 1;
}

/* Vertical Divider */
.vertical-divider {
    width: 3px;
    /* thickness of the line */
    background: #ccc;
    /* color of the line */
    margin: 70px 20px 30px 20px;
    /* space around */
    align-self: stretch;
}

.sidebar-heading {
    background-color: #fff;
    padding: 12px 0 12px 0;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    margin: 0;
    display: flex;
    justify-content: flex-start;
}

.dropdown-icon {
    display: none;
    /* hide by default (desktop) */
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .mobile-cart-wrapper{
     margin-left:32px !important;
    }
    .amz-add-to-cart.mobile-grid-btn{
        width:50% !important;
    }
    .header-mobile-row {
        margin-bottom: 0 !important;
    }

    .header-main {
        padding: 5px 0 !important;
    }

    .slider-loader {
        padding: 5px 40px 10px 40px !important;
    }

    .loader-text h1 {
        font-size: 2rem;
        margin-top: 20px !important;
        margin-bottom: 10px !important;
    }

    .loader-text p {
        font-size: 1rem;
    }

    .record-summary {
        margin-left: 0 !important;
    }

    .bestsellers-section {
        padding: 2px 0;
    }

    .bestseller-card {
        flex-direction: column;
        align-items: flex-start;
        text-align: start;
        margin: 0 0 0 0 !important;
        position: relative;
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgb(39 38 38 / 12%);
        transition: box-shadow 0.3s ease;
        /* Ensure specific positioning context */
    }

    /* Position wishlist heart absolutely on top right for mobile */
    .bestseller-card .wishlist-heart {
        position: absolute !important;
        top: 45px;
        left: 100px;
        margin: 0 !important;
        /* Slight transparency */
    }

    /* Ensure book content takes full width */
    .bestseller-card>div[style*="display: inline-block"] {
        width: 100% !important;
        display: block !important;
    }

    .free-tag-container {
        margin-top: 0 !important;
        min-height: 0 !important;
        height: 0 !important;
        overflow: hidden;
    }

    .book-image {
        margin-top: 25px !important;
        width: 100%;
        height: 180px;
    }

    .book-details {
        margin-top: 25px;
        align-items: flex-start;
    }

    .loader-text {
        margin-right: 0;
    }

    .title-separator {
        width: 100%;
        margin: 10px 0 10px 0 !important;
    }

    .content-wrapper {
        flex-direction: column;
        /* stack vertically */
    }

    .sidebar {
        position: static !important;
        width: -webkit-fill-available;
        margin: 10px 0 !important;
        background: #fff;
        border-radius: 5px;
        display: none !important;
        /* Hide sidebar on mobile */
    }

    .sidebar-heading {
        justify-content: space-between;
        border: 1px solid #ccc;
        font-size: 16px !important;
        padding: 12px 15px !important;
        margin: 0 10px;
    }

    .dropdown-icon {
        display: inline;
        /* show only on mobile */
        font-size: 18px;
        color: #333;
        margin-left: auto;
        /* push icon to far right */
    }

    .sidebar-heading::after {
        content: '';
        float: right;
    }

    .sidebar-links {
        display: none;
        /* hidden by default */
        flex-direction: column;
        padding: 10px 15px;
    }

    .sidebar-links a {
        display: block;
        padding: 8px 0;
        color: #333;
        text-decoration: none;
        border-bottom: 1px solid #eee;
    }

    .sidebar-links a:last-child {
        border-bottom: none;
    }

    .sidebar-links.show {
        display: flex;
        /* show when toggled */
    }

    .vertical-divider {
        display: none !important;
    }

    .main-content {
        width: 100%;
    }

    .pagination-summary-wrapper {
        margin: 0 0 0 0 !important;
    }

    /* Mobile Category Navigation - Show on mobile */
    .mobile-category-navigation {
        display: block !important;
        margin-bottom: 10px;
        width: 100%;
        overflow: hidden;
    }

    /* Category Slider Styles */
    .category-slider-section {
        background: #f6f5f8;
        border-bottom: 1px solid #e4e3e8;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
        border-radius: 8px;
    }

    .parent-category-slider {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 8px;
        padding: 5px 0;
    }

    .parent-category-slider::-webkit-scrollbar {
        display: none;
    }

    .parent-cat-label {
        position: sticky;
        left: 0;
        flex-shrink: 0;
        padding: 8px 16px;
        font-size: 13px;
        font-weight: 600;
        color: #666;
        white-space: nowrap;
        cursor: default;
        background: #f6f5f8;
        z-index: 10;
    }

    .parent-cat-label i {
        margin-left: 4px;
        color: #999;
    }

    .parent-cat-link {
        flex-shrink: 0;
        padding: 8px 10px 0;
        font-size: 13px;
        color: #333;
        text-decoration: none;
        white-space: nowrap;
        border-bottom: 2px solid transparent;
        transition: all 0.3s ease;
    }

    .parent-cat-link.active {
        color: #1269ba;
        border-bottom: 2px solid #1269ba;
        font-weight: 600;
    }

    .parent-cat-link:hover {
        color: #1269ba;
    }

    /* Category Header & Title */
    .category-header-section {
        padding: 15px 0 10px;
    }

    .category-title-divider {
        border-bottom: 1px solid #e4e3e8;
        margin: 7px 0 5px;
    }

    .category-title {
        font-size: 18px;
        font-weight: 600;
        color: #333;
        margin: 0 0 5px 0;
    }

    /* Search Bar Inline Section */
    .search-bar-section-inline {
        background: #f7f6f9;
        padding: 10px 10px;
        border-bottom: 1px solid #ddd;

    }

    .search-form-inline {
        display: flex;
        gap: 8px;
        align-items: center;
    }

    .search-input-inline {
        flex: 1;
        padding: 10px 14px;
        font-size: 13px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
    }

    .search-input-inline:focus {
        outline: none;
        border-color: #1269ba;
    }

    .search-btn-inline {
        padding: 10px 16px;
        font-size: 13px;
        background: linear-gradient(90deg, #679075 10%, #2d4e39 100%);
        color: #fff;
        border: none;
        border-radius: 4px;
        white-space: nowrap;
    }

    .search-hint {
        font-size: 11px;
        color: #888;
        margin: 8px 0 0 0;
    }


    /* Hide header search bar on mobile */
    .header-search {
        display: none !important;
    }


}

/* Desktop: Hide mobile navigation */
@media (min-width: 769px) {
    .mobile-category-navigation {
        display: none !important;
    }
}

/* Add to Cart Button for Mobile Grid */
.amz-add-to-cart.mobile-grid-btn {
    display: block;
    width: 20%;
    margin-top: 12px;
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
    background: #f8e064;
    border: 1px solid #fcd200;
    box-shadow: 0 2px 5px 0 rgba(213, 217, 217, .5);
    color: #0F1111;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
    margin-left: auto;
}

.amz-add-to-cart.mobile-grid-btn:hover {
    background: #f7ca00;
    border-color: #f2c200;
    box-shadow: 0 2px 5px 0 rgba(213, 217, 217, .5);
}

.amz-add-to-cart.mobile-grid-btn:active {
    background: #f0b800;
    border-color: #000;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, .1);
}

.amz-add-to-cart.mobile-grid-btn:disabled {
    background: #f7f8f8;
    border-color: #d5d9d9;
    color: #565959;
    cursor: not-allowed;
    box-shadow: none;
}

.amz-add-to-cart {
    position: relative;
    z-index: 9999;
    pointer-events: auto;
}

.book-link {
    pointer-events: none;
}

@media (min-width: 1024px) {
    .amz-add-to-cart.mobile-grid-btn{
        display: none;
    }
}
