/* ===================================
   Product Page Mobile & Desktop Fixes
   =================================== */

/* === Custom Book Slider Styles === */
.custom-book-slider {
    position: relative;
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

.custom-book-slider .slider-container {
    position: relative;
    width: 100%;
    height: 450px;
    overflow: hidden;
    border-radius: 8px;
}

.custom-book-slider .slider-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
}

.custom-book-slider .slider-item.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-book-slider .slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.custom-book-slider .slider-btn:hover {
    background: rgba(133, 29, 101, 0.9);
    transform: translateY(-50%) scale(1.1);
}

.custom-book-slider .slider-btn svg {
    color: #851d65;
}

.custom-book-slider .slider-btn:hover svg {
    color: white;
}

.custom-book-slider .slider-prev {
    left: -20px;
}

.custom-book-slider .slider-next {
    right: -20px;
}

.custom-book-slider .slider-dots {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.custom-book-slider .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-book-slider .dot.active {
    background: #851d65;
    width: 12px;
    height: 12px;
}

.custom-book-slider .dot:hover {
    background: #a52d7d;
}

/* === Pagination Mobile Fixes === */
@media (max-width: 767px) {
    ul.pagination {
        gap: 5px !important;
        padding: 0 10px !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
    }

    .page-item {
        margin: 2px !important;
    }

    .page-item .page-link {
        width: 35px !important;
        height: 35px !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 14px !important;
        line-height: 1 !important;
        min-width: 35px !important;
    }

    .page-item:first-child .page-link,
    .page-item:last-child .page-link {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }
}



/* === Navigation Fixes - All Devices === */
/* Hide dropdown arrows - links navigate directly */
.nav-item.dropdown .nav-link::after {
    display: none !important;
}

/* Hide dropdown menus on all devices */
.dropdown-menu {
    display: none !important;
}

/* Mobile navigation specific fixes */
@media (max-width: 991px) {
    /* Make nav links more clickable on mobile */
    #mainNavbar .nav-link {
        padding: 12px 16px !important;
        font-size: 16px !important;
    }
}

/* Fix for book details visibility on all screens */
.book-card {
    width: 100%;
}

.book-details-content {
    color: #333 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    margin-top: 1rem !important;
}

.book-details-content * {
    background: transparent !important;
    color: inherit !important;
}

.book-details-content p,
.book-details-content div,
.book-details-content span,
.book-details-content h1,
.book-details-content h2,
.book-details-content h3,
.book-details-content h4,
.book-details-content h5,
.book-details-content h6 {
    color: #333 !important;
    background: transparent !important;
    margin-bottom: 0.5rem !important;
}

/* Fix for mobile book details */
@media (max-width: 767px) {
    /* Ensure mobile content is visible */
    .col-12.d-block.d-sm-none {
        display: block !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }

    .col-12.d-block.d-sm-none .block_box {
        padding: 8px 0 !important;
        margin: 0 !important;
    }

    .col-12.d-block.d-sm-none .block_box h4 {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
        color: #333 !important;
        font-weight: 600 !important;
        margin-bottom: 0.5rem !important;
    }

    .col-12.d-block.d-sm-none .price {
        font-size: 1.5rem !important;
        font-weight: 700 !important;
        color: #851d65 !important;
        margin-bottom: 0.5rem !important;
    }

    .col-12.d-block.d-sm-none .text-muted {
        font-size: 0.875rem !important;
        color: #666 !important;
    }

    .col-12.d-block.d-sm-none .text-dark {
        font-size: 0.875rem !important;
        color: #333 !important;
        font-weight: 500 !important;
    }

    /* Fix product page top spacing on mobile */
    main.container.product-page {
        padding-top: 80px !important;
        margin-top: 0 !important;
    }

    /* Fix book image on mobile - CRITICAL FIX */
    .col-lg-3.col-md-4.col-sm-12.col-12.text-center.book-image {
        max-width: 100% !important;
        width: 100% !important;
        margin: 30px auto 2.5rem auto !important;
        padding: 0 !important;
        display: flex !important;
        justify-content: center !important;
        align-items: flex-start !important;
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }

    /* Custom slider mobile adjustments */
    .custom-book-slider {
        max-width: 280px !important;
        width: 280px !important;
    }

    .custom-book-slider .slider-container {
        height: 400px !important;
    }

    .custom-book-slider .slider-btn {
        width: 35px !important;
        height: 35px !important;
    }

    .custom-book-slider .slider-prev {
        left: -10px !important;
    }

    .custom-book-slider .slider-next {
        right: -10px !important;
    }

    .custom-book-slider .slider-dots {
        bottom: -25px !important;
    }



    .book-details-content {
        margin-top: 10px !important;
        font-size: 0.9rem !important;
    }

    main.container.product-page {
        padding-top: 60px !important;
        margin-top: 0 !important;
    }

    .book-image {
        margin-top: 8px !important;
    }

    /* Fix price display on mobile */
    .price.font-size-larger {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        font-size: 1.25rem !important;
    }

    .price.font-size-larger span {
        font-size: 1.25rem !important;
    }

    .text.text_price {
        text-decoration: line-through !important;
        color: #999 !important;
        font-size: 1rem !important;
    }
}

/* Fix for desktop book details */
@media (min-width: 768px) {
    .d-none.d-sm-flex {
        display: flex !important;
    }

    .d-none.d-sm-block {
        display: block !important;
    }

    .book-details-content {
        margin-top: 1rem !important;
    }
}

/* Fix for book image carousel */
.book-image .owl-carousel .owl-item {
    width: 100% !important;
}

.book-image .owl-stage {
    display: flex !important;
    flex-direction: row !important;
}

.book-image .owl-stage-outer {
    overflow: hidden !important;
}

/* Hide all carousel controls on mobile */
@media (max-width: 767px) {
    .book-image .owl-carousel .owl-nav,
    .book-image .owl-carousel .owl-dots,
    .book-image .owl-item.cloned {
        display: none !important;
    }
}

/* Desktop book image */
@media (min-width: 768px) {
    .col-lg-3.col-md-4.col-sm-12.col-12.text-center.book-image {
        max-width: 100% !important;
        width: 100% !important;
        padding: 0 15px !important;
    }

    .book-image .owl-carousel {
        max-width: 100% !important;
        width: 100% !important;
    }

    .book-image .owl-stage-outer {
        max-width: 100% !important;
        width: 100% !important;
    }

    .book-image .owl-stage {
        max-width: 100% !important;
        width: 100% !important;
    }

    .book-image .owl-item {
        max-width: 100% !important;
        width: 100% !important;
    }

    .book-image .owl-item.active {
        display: block !important;
        width: 100% !important;
    }

    .item.book-image.me-2 {
        background-size: contain !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        width: 100% !important;
        height: 450px !important;
        max-height: 450px !important;
        min-width: auto !important;
        margin: 0 auto !important;
    }
}

