/* ========================================
   PRODUCT DETAILS PAGE RESPONSIVE FIXES
   Ensures proper mobile responsiveness
   ======================================== */

/* Mobile Fixes - Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Container padding */
    .main-details-page .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Remove gap before product image */
    #content {
        padding-top: 0 !important;
    }

    .details_slider,
    .dimage_item,
    .block__pic,
    .product-image-section,
    .product-details-left {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Product images */
    .details_slider img,
    .dimage_item img,
    .block__pic {
        max-width: 100% !important;
        height: auto !important;
        width: 100% !important;
        object-fit: contain;
        margin-top: 0 !important;
    }

    /* Thumbnail slider */
    .indicator_thumb {
        margin-top: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .indicator-item {
        flex-shrink: 0;
    }

    .indicator-item img {
        max-width: 70px !important;
        height: 70px !important;
        object-fit: cover;
    }

    /* Product details right section */
    .details_right {
        padding: 15px 10px;
        margin-top: 20px;
    }

    /* Breadcrumb */
    .breadcrumb ul {
        flex-wrap: wrap;
        font-size: 12px;
    }

    .breadcrumb li {
        margin: 2px 0;
    }

    /* Product name */
    .product-cart .name {
        font-size: 18px !important;
        line-height: 1.4;
        margin-bottom: 10px;
    }

    /* Price */
    .details-price {
        font-size: 20px !important;
    }

    .details-price del {
        font-size: 16px !important;
    }

    /* Product options (size, color) */
    .single_product,
    .qty-cart {
        margin-bottom: 15px;
    }

    .single_product select,
    .qty-cart select {
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Quantity selector */
    .quantity {
        width: 100% !important;
        max-width: 120px;
    }

    .quantity input {
        max-width: 50px !important;
    }

    /* Add to cart buttons */
    .single_product .cart_btn,
    .single_product .order_btn {
        width: 100% !important;
        margin-bottom: 10px;
        padding: 12px 20px !important;
        font-size: 14px !important;
    }

    /* Product description tabs */
    .product-description-tabs {
        padding: 15px 10px;
    }

    .product-description-tabs .nav-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-bottom: 1px solid #dee2e6;
    }

    .product-description-tabs .nav-link {
        white-space: nowrap;
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Related products */
    .related-products .owl-carousel .owl-item {
        padding: 0 5px;
    }

    /* Fix overflow issues */
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    .row > * {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* Ensure no horizontal scroll */
    body {
        overflow-x: hidden;
    }

    .main-details-page {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Images that might cause overflow */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Tables */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Product discount badge */
    .product-details-discount-badge {
        top: 10px;
        right: 10px;
        transform: scale(0.8);
    }

    .sale-badge-text p {
        font-size: 14px !important;
    }
}

/* Small Devices (tablets, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .details_right {
        padding: 20px;
    }

    .product-cart .name {
        font-size: 20px !important;
    }

    .details-price {
        font-size: 24px !important;
    }

    .single_product .cart_btn,
    .single_product .order_btn {
        padding: 12px 25px !important;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .details_right {
        padding: 25px;
    }

    .product-cart .name {
        font-size: 22px !important;
    }
}

/* Ensure proper image aspect ratio on all devices */
.details_slider,
.dimage_item {
    position: relative;
    width: 100%;
}

.details_slider img {
    display: block;
    margin: 0 auto;
}

/* Fix for owl carousel on mobile */
@media (max-width: 575.98px) {
    .owl-carousel .owl-stage-outer {
        overflow: hidden;
    }

    .owl-carousel .owl-item img {
        width: auto !important;
        max-width: 100%;
        display: block;
        margin: 0 auto;
    }
}
