/* Heat icon styling */
.heat-icon {
    color: #074585;
    font-size: 20px;
}

.heat-icon i {
    color: #074585;
}

.book-card-front img{
    min-height: 250px;
}

.heading-outer {
    width: 100%;
    margin-bottom: 20px;
}

.heading-outer .heading-title {
    font-size: 30px;
    line-height: 34px;
    font-weight: 800;
    font-family: "Nunito", sans-serif;
}

.pd-tb100 {
    padding-top: 25px;
    padding-bottom: 25px;
}

/* Optimize spacing for 1600px resolution */
@media (min-width: 1600px) and (max-width: 1899px) {
    .owl-carousel .owl-item {
        padding: 0 2.5px;
    }
    
    .owl-carousel .owl-stage {
        display: flex;
        justify-content: center;
    }
    
    .container {
        max-width: 1400px;
    }
}

/* Further optimize for larger screens */
@media (min-width: 1900px) {
    .owl-carousel .owl-item {
        padding: 0 3px;
    }
}



/* Ensure proper book card spacing and centering */
.owl-carousel .item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.book-card-front {
    margin: 0 auto;
}

/* Specific optimization for 1600px resolution */
@media (min-width: 1600px) and (max-width: 1899px) {
    .sellers-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .owl-carousel {
        margin: 0 -5px;
    }
    
    .owl-carousel .owl-item {
        padding: 0 5px;
    }
}

/* General container optimization for medium screens */
@media (min-width: 768px) and (max-width: 1599px) {
    .sellers-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 480px) {
    .book-sale-modal-image-block{
        margin-bottom: 15px;
    }
}

.thumbnail-wrapper {
    position: relative;
    cursor: pointer;
}

.book-thumbnail {
    width: 196px;
    height: 257px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Responsive book thumbnail sizes */
@media (max-width: 786px) {
    .book-thumbnail {
        width: 157px;
        height: 205px;
    }
}

@media (max-width: 425px) {
    .book-thumbnail {
        width: 137px;
        height: 180px;
    }
}

@media (max-width: 320px) {
    .book-thumbnail {
        width: 124px;
        height: 163px;
    }
}

.thumbnail-wrapper:hover .book-thumbnail {
    transform: scale(1.05);
}

/* Global hover modal styles */
.global-hover-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    pointer-events: none;
    touch-action: none;
}

.global-hover-modal .hover-box {
    position: absolute;
    display: flex;
    background-color: #212224;
    border: 3px solid #5c96e5;
    box-shadow: 8px 8px 8px rgba(0, 0, 0, 0.5);
    padding: 20px;
    width: 602px;
    min-width: 602px;
    max-width: 602px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: auto;
    box-sizing: border-box;
    touch-action: pan-y;
}

.global-hover-modal.show .hover-box {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive modal positioning */
@media (max-width: 768px) {
    .global-hover-modal .hover-box {
        width: 400px;
        min-width: 400px;
        max-width: 400px;
    }
}

@media (max-width: 480px) {
    .global-hover-modal .hover-box {
        width: 350px;
        min-width: 350px;
        max-width: 350px;
        padding: 15px;
    }
}

.hover-image {
    width: 268px;
    height: 408px;
    object-fit: cover;
    border: 1px solid #000;
    transition: opacity 0.3s ease;
    position: relative;
}

.hover-image.loading {
    opacity: 0.3;
}

.hover-image.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    background-image: url('/assets/web/slick/ajax-loader.gif');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    padding: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hover-content {
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    color: white;
    flex: 1;
}

.hover-title {
    font-size: 28px;
    color: #5f94dc;
    margin: 0 0 10px 0;
}

.hover-meta {
    font-size: 18px;
    margin: 0 0 13px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.hover-author-label {
    color: #f4d30c;
}

.hover-excerpt {
    font-size: 20px;
    line-height: 1.4;
    color: white;
    margin: 0 0 13px 0;
}

.bottom-info {
    font-size: 18px;
    margin: 0 0 13px 0;
}

.bottom-info span.label {
    color: #f4d30c;
    font-weight: 400;
}

.bottom-info-group {
    margin-top: 13px;
    margin-bottom: 0px;
}

.buy-now-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    gap: 10px;
    min-height: 5rem;
    flex-wrap: nowrap;
}

.hover-actions {
    width: 100%;
    display: flex;
    gap: 10px;
}

.hover-actions .col-md-6 {
    flex: 0 0 calc(50% - 5px);
    max-width: calc(50% - 5px);
    padding: 0;
}

/* Style the buy-button to match existing save-btn styles */
.buy-button {
    max-width: 100% !important;
    height: auto !important;
    min-height: 4.5rem !important;
    width: 100% !important;
    overflow: visible !important;
    border-radius: 10rem !important;
    position: static !important;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.16) !important;
    font-size: 1.6rem !important;
    font-weight: bold !important;
    font-family: "Nunito", sans-serif !important;
    line-height: 1.2 !important;
    color: #000 !important;
    transition: all 0.4s ease-in !important;
    -webkit-transition: all 0.4s ease-in !important;
    -moz-transition: all 0.4s ease-in !important;
    -ms-transition: all 0.4s ease-in !important;
    padding: 0.8rem 1.5rem !important;
    border: 3px solid rgb(225 159 33 / 70%) !important;
    cursor: pointer !important;
    text-decoration: none !important;
    display: inline-flex !important;
    justify-content: center !important;
    align-items: center !important;
    background-image: linear-gradient(to bottom, rgb(249 231 91), rgb(255 186 65)) !important;
    background: linear-gradient(to bottom, rgb(249 231 91), rgb(255 186 65)) !important;
    white-space: nowrap !important;
    text-overflow: visible !important;
    outline: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

.buy-button:hover {
    background: linear-gradient(to bottom, rgb(255 186 65), rgb(249 231 91)) !important;
    transition: ease all 0.5s !important;
    color: #000 !important;
    text-decoration: none !important;
    transform: scale(1.05) !important;
}

/* Ensure form elements don't interfere */
.hover-actions form {
    margin: 0 !important;
    padding: 0 !important;
}

.hover-actions form button {
    background: linear-gradient(to bottom, rgb(249 231 91), rgb(255 186 65)) !important;
    border: 3px solid rgb(225 159 33 / 70%) !important;
}

.hover-actions form button:hover {
    background: linear-gradient(to bottom, rgb(255 186 65), rgb(249 231 91)) !important;
}

/* Ensure forms don't break the layout */
.hover-actions form {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    display: block !important;
}

/* Force buttons to stay in line */
.buy-now-row .col-md-6 {
    display: inline-block !important;
    vertical-align: top !important;
    float: none !important;
}

@media (max-width: 450px) {
    .buy-button {
        font-size: 1.4rem;
        line-height: 1.2;
        padding: 0.6rem 1rem;
        min-height: 3.5rem;
    }
}

.buy-button {
    width: 100%;
    height: auto;
    min-height: 40px;
    background: linear-gradient(to bottom, rgb(249 231 91), rgb(255 186 65)) !important;
    border: 3px solid rgb(225 159 33 / 70%) !important;
    border-radius: 5px;
    cursor: pointer;
    font-family: 'Nunito', sans-serif;
    font-weight: bold;
    font-size: 14px;
    color: #000;
    text-shadow: 0 1px 1px #fff;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 8px 12px;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.buy-button:hover {
    background: linear-gradient(to bottom, rgb(255 186 65), rgb(249 231 91)) !important;
    transform: scale(1.05);
    color: #000;
    text-decoration: none;
}

.readmore-btn {
    color: #5f94dc;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    margin-top: 5px;
    display: inline-block;
}

.readmore-btn:hover {
    color: #4a7bc8;
    text-decoration: underline;
}

.hover-excerpt-container.showContent .hover-excerpt {
    max-height: none;
}

.sound-icon {
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #5f94dc;
    margin-left: 10px;
    transition: color 0.3s ease;
}

.sound-icon:hover {
    color: #4a7bc8;
}

.sound-icon.muted {
    color: #999;
}

.sound-controls {
    display: flex;
    align-items: center;
    margin-left: auto;
}

/* Smart positioning for hover box to prevent going off-screen */
.thumbnail-wrapper {
    position: relative;
}

/* Ensure the hover box content is properly sized */
.hover-content {
    max-width: 300px;
    overflow: hidden;
}

.hover-excerpt {
    max-height: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    /* Hide hover modal on mobile devices */
    .global-hover-modal {
        display: none !important;
    }
    
    /* Show mobile links and hide desktop elements */
    .mobile-book-link {
        display: block !important;
        text-decoration: none;
        color: inherit;
        width: 100%;
        height: 100%;
    }
    
    .desktop-only {
        display: none !important;
    }
    
    /* Add click indicator for mobile */
    .thumbnail-wrapper {
        cursor: pointer;
        position: relative;
        display: block;
        width: 100%;
        height: 100%;
    }
    
    .thumbnail-wrapper:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    /* Ensure the image is clickable */
    .thumbnail-wrapper .book-thumbnail {
        pointer-events: none;
    }
}

/* Desktop styles */
@media (min-width: 769px) {
    .mobile-book-link {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
}

@media (max-width: 480px) {
    .hover-box {
        position: fixed !important;
        top: 5% !important;
        left: 5% !important;
        right: 5% !important;
        bottom: 5% !important;
        width: auto !important;
        height: auto !important;
        max-width: none !important;
        max-height: none !important;
        transform: none !important;
        z-index: 10000;
        display: block !important;
        overflow-y: scroll !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .hover-image {
        width: 150px;
        height: 225px;
        margin: 15px auto;
        display: block;
    }
    
    .hover-image.loading::after {
        width: 30px;
        height: 30px;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        padding: 6px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    
    .hover-content {
        max-width: 100% !important;
        padding: 0 15px 15px 15px;
    }
    
    .hover-title {
        font-size: 18px;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .hover-meta {
        justify-content: center !important;
        margin-bottom: 10px;
    }
    
    .hover-excerpt {
        font-size: 14px;
        text-align: center;
        margin-bottom: 10px;
    }
    
    .bottom-info-group {
        text-align: center;
        margin-bottom: 15px;
    }
    
    .sound-controls {
        margin-left: 10px;
    }
    
    .sound-icon {
        width: 18px;
        height: 18px;
        margin-left: 8px;
    }
    
    .buy-now-row {
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 15px;
    }
    
    /* Custom scrollbar for mobile */
    .hover-box::-webkit-scrollbar {
        width: 6px;
    }
    
    .hover-box::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 3px;
    }
    
    .hover-box::-webkit-scrollbar-thumb {
        background: #5c96e5;
        border-radius: 3px;
    }
    
    .hover-box::-webkit-scrollbar-thumb:hover {
        background: #4a7bc8;
    }
} 