/* MOBILE RESPONSIVE STYLES */

/* Keep header titles visible - restore original header layout */
@media only screen and (max-width: 768px) {
    /* Removed display: none for #labcare-title and #company-title to restore original header */
    
    /* REMOVE ALL OWL CAROUSEL MODIFICATIONS TO RESTORE ORIGINAL */
    
    /* REMOVED ALL HERO SLIDER MODIFICATIONS - BACK TO ORIGINAL */
}
    
    /* FORCE override inline styles and fit mobile screen - 422×294px (211:147 ratio) */
    p[style*="text-align:justify"] img[style*="height:698px"][style*="width:1000px"],
    p img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="height:698px"],
    img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="width:1000px"],
    img[style="height:698px; width:1000px"] {
        width: 422px !important;
        height: 294px !important;
        max-width: 422px !important;
        max-height: 294px !important;
        /* Keep original layout - remove margin auto, display block, object-fit */
        box-sizing: border-box !important;
        /* Maintain 211:147 aspect ratio */
        aspect-ratio: 211 / 147 !important;
    }
    
    /* Responsive sizing for smaller screens while maintaining 211:147 ratio */
    @media (max-width: 480px) {
        p[style*="text-align:justify"] img[style*="height:698px"][style*="width:1000px"],
        p img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="height:698px"],
        img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="width:1000px"],
        img[style="height:698px; width:1000px"] {
            width: 320px !important;
            height: 223px !important; /* 320 * 147/211 ≈ 223 */
            max-width: 320px !important;
            max-height: 223px !important;
        }
    }
    
    @media (max-width: 380px) {
        p[style*="text-align:justify"] img[style*="height:698px"][style*="width:1000px"],
        p img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="height:698px"],
        img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"][style*="width:1000px"],
        img[style="height:698px; width:1000px"] {
            width: 280px !important;
            height: 195px !important; /* 280 * 147/211 ≈ 195 */
            max-width: 280px !important;
            max-height: 195px !important;
        }
    }

    /* NUCLEAR TARGET image in main-container with maximum specificity */
    html body div.main-container img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
    html body .main-container img[src*="upload/images/"][src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
    html body img[src*="labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
    html body img[src="https://labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"] {
        width: 422px !important;
        height: 294px !important;
        max-width: 422px !important;
        min-width: 422px !important;
        max-height: 294px !important;
        min-height: 294px !important;
        margin: 20px auto !important;
        display: block !important;
        object-fit: cover !important;
        box-sizing: border-box !important;
        /* Force override any aspect ratio */
        aspect-ratio: 211 / 147 !important;
        /* Remove any transform or scale */
        transform: none !important;
        scale: none !important;
    }

    /* RESPONSIVE NUCLEAR OVERRIDE */
    @media (max-width: 480px) {
        html body div.main-container img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body .main-container img[src*="upload/images/"][src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body img[src*="labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body img[src="https://labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"] {
            width: 320px !important;
            height: 223px !important;
            max-width: 320px !important;
            min-width: 320px !important;
            max-height: 223px !important;
            min-height: 223px !important;
        }
    }
    
    @media (max-width: 380px) {
        html body div.main-container img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body .main-container img[src*="upload/images/"][src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body img[src*="labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"],
        html body img[src="https://labcare.com.vn/upload/images/Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"] {
            width: 280px !important;
            height: 195px !important;
            max-width: 280px !important;
            min-width: 280px !important;
            max-height: 195px !important;
            min-height: 195px !important;
        }
    }

    /* Ensure main-container allows proper image sizing */
    .main-container {
        overflow: visible !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Ensure parent containers don't crop the image */
    p[style*="text-align:justify"]:has(img[src*="Thie%CC%82%CC%81t%20ke%CC%82%CC%81%20chu%CC%9Ba%20co%CC%81%20te%CC%82n.png"]),
    p:has(img[style*="height:698px"]) {
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }
    
    /* Ensure main content container doesn't restrict width */
    #noidungtrong,
    #khungchinh1,
    #khungchinh2 {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: visible !important;
    }
}

/* Tablet responsive */
@media only screen and (min-width: 769px) and (max-width: 1024px) {
    #company-title {
        font-size: 16px !important;
        line-height: 1.1 !important;
    }
}

/* MOBILE PRODUCT LISTING PAGE IMPROVEMENTS */
@media (max-width: 768px) {
    /* Improve product grid layout */
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        padding: 10px !important;
    }
    
    /* Enhance product cards */
    .product-card {
        height: 320px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
        transition: all 0.3s ease !important;
        background: white !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .product-card:hover {
        transform: translateY(-4px) !important;
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    }
    
    /* Optimize product image */
    .product-image {
        height: 180px !important;
        position: relative !important;
        overflow: hidden !important;
        background: #f8f9fa !important;
    }
    
    .product-image img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transition: transform 0.3s ease !important;
    }
    
    .product-card:hover .product-image img {
        transform: scale(1.05) !important;
    }
    
    /* Enhanced product overlay */
    .product-grid .product-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.7) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        z-index: 10 !important;
    }
    
    .product-grid .product-card:hover .product-overlay,
    .product-grid .product-card:active .product-overlay {
        opacity: 1 !important;
    }
    
    .product-overlay .btn-view {
        background: #667eea !important;
        color: white !important;
        padding: 10px 20px !important;
        border-radius: 25px !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 13px !important;
        transform: translateY(10px) !important;
        transition: all 0.3s ease !important;
    }
    
    .product-card:hover .btn-view {
        transform: translateY(0) !important;
    }
    
    /* Improve product content */
    .product-content {
        padding: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        height: calc(100% - 180px) !important;
    }
    
    .product-name {
        font-size: 14px !important;
        font-weight: 600 !important;
        line-height: 1.3 !important;
        margin: 0 0 8px 0 !important;
        color: #2d3748 !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        height: 36px !important;
    }
    
    .product-name a {
        color: inherit !important;
        text-decoration: none !important;
        transition: color 0.3s ease !important;
    }
    
    .product-name a:hover {
        color: #667eea !important;
    }
    
    .product-price {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #e53e3e !important;
        margin: 8px 0 0 0 !important;
        text-align: center !important;
    }
    
    /* Improve sidebar on mobile */
    .sidebar {
        order: -1 !important;
        margin-bottom: 20px !important;
    }
    
    .featured-section {
        padding: 15px !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1) !important;
    }
    
    .sidebar-title {
        font-size: 18px !important;
        margin-bottom: 15px !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
    }
}

/* Small mobile optimization */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        padding: 8px !important;
    }
    
    .product-card {
        height: 280px !important;
    }
    
    .product-image {
        height: 150px !important;
    }
    
    .product-content {
        padding: 8px !important;
        height: calc(100% - 150px) !important;
    }
    
    .product-name {
        font-size: 13px !important;
        height: 32px !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }
    
    .product-price {
        font-size: 14px !important;
    }
}

/* Very small screens - single column */
@media (max-width: 360px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        padding: 10px !important;
    }
    
    .product-card {
        height: 350px !important;
        max-width: 300px !important;
        margin: 0 auto !important;
    }
    
    .product-image {
        height: 200px !important;
    }
    
    .product-content {
        height: calc(100% - 200px) !important;
        padding: 12px !important;
    }
    
    .product-name {
        font-size: 14px !important;
        height: 40px !important;
    }
    
    .product-price {
        font-size: 16px !important;
    }
}

/* MOBILE PRODUCT DETAIL PAGE ENHANCED */
@media (max-width: 768px) {
    /* Beautiful product detail layout */
    .product-detail-page {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
        background: #f8f9fa !important;
        padding: 15px 0 !important;
    }
    
    .product-detail-page .container {
        max-width: 100% !important;
        padding: 0 15px !important;
        box-sizing: border-box !important;
    }
    
    .product-detail-page .main-content {
        display: block !important;
        max-width: 100% !important;
        gap: 20px !important;
    }
    
    .product-detail-page .product-section {
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
        margin-bottom: 20px !important;
        overflow: hidden !important;
    }
    
    /* Fix product overlay ONLY for product listing page */
    .product-grid .product-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0,0,0,0.7) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        opacity: 0 !important;
        transition: opacity 0.3s ease !important;
        z-index: 10 !important;
    }
    
    .product-grid .product-card:hover .product-overlay,
    .product-grid .product-card:active .product-overlay {
        opacity: 1 !important;
    }
    
    /* Clean product-main-info layout */
    .product-detail-page .product-main-info {
        display: block !important;
        padding: 20px !important;
        gap: 20px !important;
        width: 100% !important;
        max-width: 100% !important;
        background: white !important;
    }
    
    /* Clean product gallery - override all inline mess */
    .product-detail-page .product-gallery,
    .product-detail-page .product-gallery-container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 25px 0 !important;
        overflow: hidden !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
        background: white !important;
        padding: 15px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Clean main image container */
    .product-detail-page .main-image-container {
        width: 100% !important;
        height: 280px !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        background: #f8f9fa !important;
        margin-bottom: 15px !important;
        position: relative !important;
    }
    
    .product-detail-page .main-image-container img,
    .product-detail-page #main-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center !important;
        background: white !important;
        cursor: pointer !important;
        transition: transform 0.3s ease !important;
    }
    
    .product-detail-page .main-image-container img:hover,
    .product-detail-page #main-image:hover {
        transform: scale(1.02) !important;
    }
    
    /* Clean thumbnail section - FORCE SHOW */
    .product-detail-page .thumbnail-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        margin: 15px 0 0 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 80px !important;
    }
    
    /* Clean thumbnail grid - FORCE SHOW */
    .product-detail-page .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px !important;
        margin: 0 !important;
        padding: 10px 0 !important;
        background: #f8f9fa !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 85px !important;
    }
    
    .product-detail-page .thumbnail-item {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 65px !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        border: 2px solid #e2e8f0 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        background: white !important;
        position: relative !important;
        z-index: 10 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }
    
    .product-detail-page .thumbnail-item:hover {
        border-color: #667eea !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    }
    
    .product-detail-page .thumbnail-item.active {
        border-color: #667eea !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Clean thumbnails - NO DEBUG COLORS */
    .product-detail-page .thumbnail-section {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        margin: 15px 0 !important;
        border-radius: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        min-height: 90px !important;
        box-sizing: border-box !important;
    }
    
    .product-detail-page .thumbnail-grid {
        background: #f8f9fa !important;
        border: 1px solid #e2e8f0 !important;
        min-height: 85px !important;
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        padding: 10px !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        border-radius: 8px !important;
    }
    
    .product-detail-page .thumbnail-item {
        background: white !important;
        border: 2px solid #e2e8f0 !important;
        min-height: 65px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 65px !important;
        box-sizing: border-box !important;
        position: static !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }
    
    .product-detail-page .thumbnail-item:hover {
        border-color: #667eea !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    }
    
    .product-detail-page .thumbnail-item.active {
        border-color: #667eea !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
    }
    
    .product-detail-page .thumbnail-item img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px !important;
        background: white !important;
    }
    
    /* Video container in gallery */
    .product-detail-page #flexvi {
        width: 100% !important;
        height: 280px !important;
        background: #000 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        position: relative !important;
    }
    
    .product-detail-page #videoif {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
    }
    
    /* Main gallery image container - DEVICE-SPECIFIC RESPONSIVE HEIGHTS */
    .product-detail-page .main-gallery {
        border-radius: 8px !important;
        overflow: hidden !important;
        background: #f8f9fa !important;
        margin-bottom: 15px !important;
        position: relative !important;
        width: 100% !important;
        /* Base height for mobile, will be overridden by device-specific rules */
        height: 200px !important;
    }
    
    /* Enhanced lightSlider container */
    .product-detail-page .lSSlideOuter {
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        margin: 0 !important;
        position: relative !important;
        border-radius: 8px !important;
        background: white !important;
    }
    
    .product-detail-page .lightSlider {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        /* Base height for mobile, will be overridden by device-specific rules */
        height: 200px !important;
        position: relative !important;
    }
    
    .product-detail-page .lightSlider li {
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
        display: block !important;
        position: relative !important;
        /* Base height for mobile, will be overridden by device-specific rules */
        height: 200px !important;
    }
    
    .product-detail-page .lightSlider li img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
        border-radius: 8px !important;
        background: white !important;
    }
    
    /* Fix for YouTube videos and iframes in lightSlider */
    .product-detail-page .lightSlider li iframe,
    .product-detail-page .lightSlider li video {
        width: 100% !important;
        height: 100% !important;
        max-width: 100% !important;
        max-height: 280px !important;
        object-fit: contain !important;
        border-radius: 8px !important;
        border: none !important;
    }
    
    /* Navigation arrows enhancement */
    .product-detail-page .lSAction > a {
        background: rgba(0,0,0,0.7) !important;
        color: white !important;
        border-radius: 50% !important;
        width: 40px !important;
        height: 40px !important;
        line-height: 40px !important;
        font-size: 16px !important;
        opacity: 0.8 !important;
        transition: all 0.3s ease !important;
        z-index: 100 !important;
    }
    
    .product-detail-page .lSAction > a:hover {
        opacity: 1 !important;
        transform: scale(1.1) !important;
    }
    
    /* Fix YouTube video container */
    .product-detail-page .video-container,
    .product-detail-page .youtube-container {
        position: relative !important;
        width: 100% !important;
        height: 280px !important;
        max-width: 100% !important;
        overflow: hidden !important;
        border-radius: 8px !important;
        background: #000 !important;
    }
    
    /* Responsive video wrapper */
    .product-detail-page .video-wrapper {
        position: relative !important;
        padding-bottom: 56.25% !important; /* 16:9 aspect ratio */
        height: 0 !important;
        overflow: hidden !important;
        max-width: 100% !important;
        background: #000 !important;
        border-radius: 8px !important;
    }
    
    .product-detail-page .video-wrapper iframe,
    .product-detail-page .video-wrapper video {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        border-radius: 8px !important;
    }
    
    /* Beautiful product title */
    .product-detail-page .product-title {
        font-size: 20px !important;
        line-height: 1.4 !important;
        margin: 0 0 20px 0 !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
        white-space: normal !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        color: #2d3748 !important;
        font-weight: 600 !important;
        border-bottom: 2px solid #667eea !important;
        padding-bottom: 10px !important;
    }
    
    /* Enhanced product info container */
    .product-detail-page .product-info {
        padding: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        overflow: visible !important;
        background: white !important;
        margin-top: 15px !important;
        clear: both !important;
    }
    
    /* Force override all inline gallery mess */
    .product-detail-page .product-gallery * {
        position: static !important;
        z-index: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Override inline CSS in lightslider2.php */
    .product-detail-page .product-gallery * {
        all: unset;
    }
    
    /* Force override ALL inline styles and conflicting CSS */
    .product-detail-page .product-gallery .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        margin: 15px 0 0 0 !important;
        padding: 10px !important;
        background: #f8f9fa !important;
        border: 1px solid #e2e8f0 !important;
        border-radius: 8px !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: auto !important;
        min-height: 85px !important;
        box-sizing: border-box !important;
        position: static !important;
        z-index: 10 !important;
    }
    
    .product-detail-page .product-gallery .thumbnail-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        margin: 15px 0 0 0 !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 100px !important;
        position: static !important;
        z-index: 10 !important;
    }
    
    .product-detail-page .product-gallery .thumbnail-item {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        width: 100% !important;
        height: 75px !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        border: 2px solid #e2e8f0 !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        background: white !important;
        position: static !important;
        z-index: 10 !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
        box-sizing: border-box !important;
    }
    
    .product-detail-page .product-gallery .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: static !important;
        z-index: 10 !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        background: transparent !important;
    }
    
    /* Clean up lightSlider mess */
    .product-detail-page .lSSlideOuter,
    .product-detail-page .lSSlideWrapper,
    .product-detail-page .lightSlider,
    .product-detail-page .lSPager,
    .product-detail-page .lSAction {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    /* Force show our clean gallery - EVERYTHING VISIBLE */
    .product-detail-page .product-gallery-container,
    .product-detail-page .main-image-container,
    .product-detail-page .thumbnail-section,
    .product-detail-page .thumbnail-grid,
    .product-detail-page .thumbnail-item {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .product-detail-page .thumbnail-grid {
        display: grid !important;
    }
    
    /* Override any hiding CSS from other sources */
    .product-detail-page .thumbnail-section *,
    .product-detail-page .thumbnail-grid *,
    .product-detail-page .thumbnail-item * {
        visibility: visible !important;
        opacity: 1 !important;
        display: block !important;
    }
    
    .product-detail-page .thumbnail-item img {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Modal styling */
    .product-detail-page .image-modal {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background: rgba(0,0,0,0.95) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 999999 !important;
        cursor: pointer !important;
    }
    
    .product-detail-page .image-modal img {
        max-width: 90% !important;
        max-height: 90% !important;
        object-fit: contain !important;
        border-radius: 8px !important;
    }
    
    /* Beautiful product meta */
    .product-detail-page .product-meta {
        background: #f8f9fa !important;
        border-radius: 8px !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .product-detail-page .meta-item {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #e2e8f0 !important;
    }
    
    .product-detail-page .meta-item:last-child {
        border-bottom: none !important;
    }
    
    .product-detail-page .meta-label {
        font-weight: 600 !important;
        color: #4a5568 !important;
        font-size: 14px !important;
    }
    
    .product-detail-page .meta-value {
        color: #2d3748 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
    }
    
    .product-detail-page .price-item .meta-value {
        color: #e53e3e !important;
        font-weight: 700 !important;
        font-size: 16px !important;
    }
    
    /* Beautiful thumbnail gallery */
    .product-detail-page .lSGallery {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: flex-start !important;
        margin-top: 15px !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        padding: 10px !important;
        max-width: 100% !important;
        width: 100% !important;
        list-style: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: 70px !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    .product-detail-page .lSGallery li {
        width: 55px !important;
        height: 55px !important;   
        margin-right: 0 !important;
        flex-shrink: 0 !important;
        overflow: hidden !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transition: all 0.3s ease !important;
        background: white !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }
    
    .product-detail-page .lSGallery li img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .product-detail-page .lSGallery li:hover,
    .product-detail-page .lSGallery li.active {
        border-color: #667eea !important;
        transform: scale(1.1) !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    }
    
    /* Enhanced action buttons */
    .product-detail-page .product-actions {
        display: flex !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
        margin-top: 20px !important;
        padding: 20px 0 !important;
        border-top: 1px solid #e2e8f0 !important;
    }
    
    .product-detail-page .btn-download,
    .product-detail-page .btn-quote {
        padding: 12px 20px !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        transition: all 0.3s ease !important;
        flex: 1 !important;
        min-width: 140px !important;
        text-align: center !important;
    }
    
    .product-detail-page .btn-download {
        background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3) !important;
    }
    
    .product-detail-page .btn-download:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(72, 187, 120, 0.4) !important;
    }
    
    .product-detail-page .btn-quote {
        background: linear-gradient(135deg, #f6ad55 0%, #ed8936 100%) !important;
        color: white !important;
        box-shadow: 0 4px 12px rgba(246, 173, 85, 0.3) !important;
    }
    
    .product-detail-page .btn-quote:hover {
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(246, 173, 85, 0.4) !important;
    }
    
    /* Beautiful product description */
    .product-detail-page .product-description-full {
        background: white !important;
        border-radius: 12px !important;
        padding: 20px !important;
        margin-top: 20px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    }
    
    .product-detail-page .product-description-full h2 {
        font-size: 18px !important;
        color: #2d3748 !important;
        margin: 0 0 15px 0 !important;
        font-weight: 600 !important;
        border-bottom: 2px solid #667eea !important;
        padding-bottom: 8px !important;
    }
    
    .product-detail-page .description-content {
        color: #4a5568 !important;
        line-height: 1.6 !important;
        font-size: 14px !important;
    }
    
    .product-detail-page .description-content p {
        margin-bottom: 12px !important;
    }
    
    /* Enhanced categories sidebar */
    .product-detail-page .categories-column {
        order: -1 !important;
        margin-bottom: 20px !important;
    }
    
    .product-detail-page .categories-sidebar {
        background: white !important;
        border-radius: 12px !important;
        padding: 20px !important;
        box-shadow: 0 4px 20px rgba(0,0,0,0.1) !important;
    }
    
    .product-detail-page .categories-title {
        font-size: 18px !important;
        color: #2d3748 !important;
        margin: 0 0 15px 0 !important;
        font-weight: 600 !important;
        border-bottom: 2px solid #667eea !important;
        padding-bottom: 8px !important;
    }
    
    .product-detail-page .categories-list {
        list-style: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    .product-detail-page .categories-list li {
        margin-bottom: 8px !important;
    }
    
    .product-detail-page .categories-list a {
        display: block !important;
        padding: 8px 12px !important;
        color: #4a5568 !important;
        text-decoration: none !important;
        border-radius: 6px !important;
        transition: all 0.3s ease !important;
        font-size: 14px !important;
    }
    
    .product-detail-page .categories-list a:hover,
    .product-detail-page .categories-list a.active {
        background: #667eea !important;
        color: white !important;
        transform: translateX(5px) !important;
    }
    
    /* ONLY target product detail page elements - NOT global */
    .product-detail-page * {
        box-sizing: border-box !important;
    }
    
    .product-detail-page img:not(.hero-logo):not(.owl-carousel img):not(.product-grid img) {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Fix all videos and iframes to prevent horizontal scroll */
    .product-detail-page video,
    .product-detail-page iframe {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
        max-height: 280px !important;
        border: none !important;
        border-radius: 8px !important;
    }
    
    .product-detail-page table {
        max-width: 100% !important;
        height: auto !important;
        overflow-x: auto !important;
    }
    
    /* Force any YouTube embeds to be responsive */
    .product-detail-page iframe[src*="youtube.com"],
    .product-detail-page iframe[src*="youtu.be"] {
        width: 100% !important;
        max-width: 100% !important;
        height: 200px !important;
        aspect-ratio: 16/9 !important;
    }
    
    /* Fix any other video embeds */
    .product-detail-page embed,
    .product-detail-page object {
        max-width: 100% !important;
        width: 100% !important;
        height: auto !important;
    }
}

/* Small mobile product detail optimization */
@media (max-width: 480px) {
    .product-detail-page .container {
        padding: 0 10px !important;
    }
    
    .product-detail-page .product-main-info {
        padding: 15px !important;
    }
    
    /* Small mobile clean gallery */
    .product-detail-page .main-image-container {
        height: 220px !important;
    }
    
    .product-detail-page .main-image-container img,
    .product-detail-page #main-image {
        height: 100% !important;
    }
    
    .product-detail-page #flexvi {
        height: 220px !important;
    }
    
    .product-detail-page .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    
    .product-detail-page .thumbnail-item {
        height: 50px !important;
    }
    
    .product-detail-page iframe[src*="youtube.com"],
    .product-detail-page iframe[src*="youtu.be"] {
        height: 180px !important;
    }
    
    .product-detail-page .video-container,
    .product-detail-page .youtube-container {
        height: 220px !important;
    }
    
    .product-detail-page .product-title {
        font-size: 18px !important;
    }
    
    .product-detail-page .lSGallery li {
        width: 45px !important;
        height: 45px !important;
    }
    
    .product-detail-page .btn-download,
    .product-detail-page .btn-quote {
        padding: 10px 16px !important;
        font-size: 13px !important;
        min-width: 120px !important;
    }
    
    .product-detail-page .product-description-full,
    .product-detail-page .categories-sidebar {
        padding: 15px !important;
    }
}

/* Very small screens product detail */
@media (max-width: 360px) {
    .product-detail-page .product-actions {
        flex-direction: column !important;
        gap: 10px !important;
    }
    
    .product-detail-page .btn-download,
    .product-detail-page .btn-quote {
        flex: none !important;
        width: 100% !important;
    }
    
    .product-detail-page .main-image-container {
        height: 180px !important;
    }
    
    .product-detail-page #flexvi {
        height: 180px !important;
    }
    
    .product-detail-page .thumbnail-grid {
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 4px !important;
    }
    
    .product-detail-page .thumbnail-item {
        height: 40px !important;
    }
    
    .product-detail-page .product-gallery-container {
        margin-bottom: 30px !important;
        padding-bottom: 20px !important;
        border-bottom: 2px solid #f0f0f0 !important;
    }
}

/* ==== PRODUCT GALLERY LIGHTSLIDER CSS - Moved from PHP file ==== */

/* Completely override LightSlider CSS */
html body .lSSlideOuter,
html body .lSSlideWrapper,
html body .lightSlider,
html body .lSPager,
html body .lSAction {
    all: unset !important;
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    transform: none !important;
    transition: none !important;
}

/* FORCE lSGallery thumbnail gallery to display on mobile */
html body .lSGallery {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    justify-content: flex-start !important;
    margin-top: 15px !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 10px !important;
    max-width: 100% !important;
    width: 100% !important;
    list-style: none !important;
    height: auto !important;
    min-height: 70px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    border: 1px solid #e2e8f0 !important;
    transform: translate3d(0px, 0px, 0px) !important;
}

/* Force remove LightSlider specific classes */
html body .lSSlideOuter * {
    position: static !important;
    transform: none !important;
    display: block !important;
}

/* FORCE lSGallery li elements to display properly */
html body .lSGallery li {
    width: 55px !important;
    height: 55px !important;   
    margin-right: 0 !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border: 2px solid #e2e8f0 !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transition: all 0.3s ease !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    transform: none !important;
    position: static !important;
}

html body .lSGallery li img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: none !important;
    position: static !important;
}

html body .lSGallery li:hover,
html body .lSGallery li.active {
    border-color: #667eea !important;
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
}

/* NUCLEAR FORCE lSGallery to display on mobile - STRONGEST POSSIBLE SELECTORS */
@media (max-width: 768px) {
    html body div .lSGallery,
    html body .product-detail-page .lSGallery,
    html body .lSPager.lSGallery,
    ul.lSPager.lSGallery,
    .lSGallery {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 10px !important;
        padding: 8px !important;
        gap: 6px !important;
        min-height: 60px !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
        transform: translate3d(0px, 0px, 0px) !important;
        transition-duration: 500ms !important;
        width: auto !important;
        height: auto !important;
        position: static !important;
        z-index: 999 !important;
        flex-wrap: wrap !important;
        justify-content: flex-start !important;
        list-style: none !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    html body div .lSGallery li,
    html body .product-detail-page .lSGallery li,
    html body .lSPager.lSGallery li,
    ul.lSPager.lSGallery li,
    .lSGallery li {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        flex-shrink: 0 !important;
        margin-right: 5px !important;
        margin-left: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
        position: static !important;
        overflow: hidden !important;
        border: 2px solid #e2e8f0 !important;
        border-radius: 6px !important;
        cursor: pointer !important;
        background: white !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
        transition: all 0.3s ease !important;
        float: none !important;
        clear: none !important;
    }
    
    html body div .lSGallery li a,
    html body .product-detail-page .lSGallery li a,
    html body .lSPager.lSGallery li a,
    ul.lSPager.lSGallery li a,
    .lSGallery li a {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        text-decoration: none !important;
        border: none !important;
        background: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    
    html body div .lSGallery li img,
    html body .product-detail-page .lSGallery li img,
    html body .lSPager.lSGallery li img,
    ul.lSPager.lSGallery li img,
    .lSGallery li img {
        width: 100% !important;
        height: 100% !important;
        min-width: 100% !important;
        min-height: 100% !important;
        max-width: 100% !important;
        max-height: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        object-fit: cover !important;
        object-position: center !important;
        display: block !important;
        transform: none !important;
        position: static !important;
        border: none !important;
        margin: 0 !important;
        padding: 0 !important;
        background: white !important;
    }
    
    /* Active state */
    html body div .lSGallery li:hover,
    html body div .lSGallery li.active,
    html body .product-detail-page .lSGallery li:hover,
    html body .product-detail-page .lSGallery li.active,
    .lSGallery li:hover,
    .lSGallery li.active {
        border-color: #667eea !important;
        transform: scale(1.05) !important;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
    }
}

/* OVERRIDE ANY JAVASCRIPT HIDING - FORCE DISPLAY REGARDLESS */
@media (max-width: 768px) {
    /* Override display: none from JavaScript */
    .lSGallery[style*="display: none"],
    .lSGallery[style*="display:none"],
    .lSGallery[style*="visibility: hidden"],
    .lSGallery[style*="visibility:hidden"],
    .lSGallery[style*="opacity: 0"],
    .lSGallery[style*="opacity:0"] {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .lSGallery li[style*="display: none"],
    .lSGallery li[style*="display:none"], 
    .lSGallery li[style*="visibility: hidden"],
    .lSGallery li[style*="visibility:hidden"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Force show even if hidden by classes */
    .lSGallery.hidden,
    .lSGallery.hide,
    .lSGallery.d-none,
    .lSGallery li.hidden,
    .lSGallery li.hide,
    .lSGallery li.d-none {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .lSGallery li.hidden,
    .lSGallery li.hide,
    .lSGallery li.d-none {
        display: block !important;
    }
}

/* GLOBAL FORCE DISPLAY - NO MEDIA QUERY */
.lSGallery {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
    list-style: none !important;
    margin-top: 10px !important;
    padding: 8px !important;
    background: #f8f9fa !important;
    border-radius: 8px !important;
    min-height: 60px !important;
}

.lSGallery li {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 55px !important;
    height: 55px !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
    border-radius: 6px !important;
    background: white !important;
    border: 2px solid #e2e8f0 !important;
}

.lSGallery li img {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* Clean lSGallery styling - no debug borders */
@media (max-width: 768px) {
    .lSGallery {
        background: #f8f9fa !important;
        border-radius: 8px !important;
        min-height: 60px !important;
        position: relative !important;
        border: 1px solid #e2e8f0 !important;
    }
    
    .lSGallery li {
        background: white !important;
        border: 2px solid #e2e8f0 !important;
    }
    
    .lSGallery li img {
        border: none !important;
    }
}

/* Perfect Product Gallery Layout */
html body .product-gallery-container {
    width: 100% !important;
    max-width: 500px !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Main display area */
html body .main-image-container {
    width: 100% !important;
    margin-bottom: 15px !important;
    background: white !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    position: relative !important;
    z-index: 1 !important;
}

html body .main-image-container img {
    width: 100% !important;
    height: 350px !important;
    object-fit: cover !important;
    display: block !important;
    cursor: pointer !important;
    transition: transform 0.3s ease !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Đảm bảo main-image không đè lên content */
html body #main-image {
    position: relative !important;
    z-index: 1 !important;
    margin: 0 !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

html body .main-image-container img:hover {
    transform: scale(1.02) !important;
}

/* Thumbnail grid */
html body .thumbnail-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-top: 15px !important;
}

html body .thumbnail-item {
    width: 100% !important;
    height: 80px !important;
    background: white !important;
    border-radius: 6px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    border: 2px solid transparent !important;
    transition: all 0.3s ease !important;
}

html body .thumbnail-item:hover {
    border-color: #007cba !important;
    transform: translateY(-2px) !important;
}

html body .thumbnail-item.active {
    border-color: #007cba !important;
    box-shadow: 0 2px 8px rgba(0,124,186,0.3) !important;
}

html body .thumbnail-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Hide original gallery structure */
html body #image-gallery {
    display: none !important;
}

/* Video container */
html body #flexvi {
    position: relative !important;
    width: 100% !important;
    height: 300px !important;
    background: #000 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

html body #videoif {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Enhanced Modal overlay */
html body .image-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0,0,0,0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 999999 !important;
    cursor: pointer !important;
    backdrop-filter: blur(8px) !important;
}

html body .image-modal img {
    max-width: 90% !important;
    max-height: 90% !important;
    object-fit: contain !important;
    border-radius: 10px !important;
    box-shadow: 0 20px 60px rgba(255,255,255,0.1) !important;
    transition: transform 0.3s ease !important;
}

html body .image-modal img:hover {
    transform: scale(1.02) !important;
}

/* Error message styling */
html body .image-error {
    padding: 40px 20px !important;
    text-align: center !important;
    background: linear-gradient(135deg, #f5f5f5, #e8e8e8) !important;
    color: #666 !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    border: 2px dashed #ddd !important;
}

/* Responsive Design for Gallery */
@media (max-width: 768px) and (min-width: 481px) {
    html body .main-image-container img {
        height: 280px !important; /* Giảm cho tablet */
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        margin-top: 12px !important;
        margin-bottom: 15px !important;
    }
    
    html body .thumbnail-item {
        height: 65px !important; /* Nhỏ gọn hơn */
        border-radius: 6px !important;
    }
    
    html body .product-gallery-container {
        margin-bottom: 20px !important;
    }
}

@media (max-width: 768px) {
    html body .product-gallery-container {
        max-width: 100% !important;
    }
    
    html body .main-image-container img {
        height: 250px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
        margin-top: 18px !important;
    }
    
    html body .thumbnail-item {
        height: 75px !important;
        border-radius: 7px !important;
    }
}

/* iPhone SE (375px width) - Ultra compact */
@media (max-width: 375px) {
    html body .product-gallery-container {
        padding: 8px !important;
        margin-bottom: 25px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    html body .main-image-container {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    html body .main-image-container img {
        height: 160px !important; /* Siêu compact cho iPhone SE */
        width: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    /* Video container responsive */
    html body #flexvi {
        height: 160px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    html body .thumbnail-section {
        width: 100% !important;
        margin-top: 10px !important;
    }
    
    html body .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 cột dễ nhìn hơn */
        gap: 4px !important;
        margin-top: 8px !important;
        width: 100% !important;
    }
    
    html body .thumbnail-item {
        height: 40px !important; /* Tăng size để dễ click */
        width: 100% !important;
        border-radius: 4px !important;
        background: white !important;
        border: 2px solid transparent !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
    }
    
    html body .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* iPhone 12 mini, iPhone 13 mini (390px width) */
@media (min-width: 376px) and (max-width: 390px) {
    html body .main-image-container img {
        height: 170px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    html body #flexvi {
        height: 170px !important;
        width: 100% !important;
    }
    
    html body .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 5px !important;
        width: 100% !important;
    }
    
    html body .thumbnail-item {
        height: 45px !important;
        width: 100% !important;
        background: white !important;
        border: 2px solid transparent !important;
        border-radius: 4px !important;
        overflow: hidden !important;
        cursor: pointer !important;
    }
    
    html body .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* iPhone XR, iPhone 11 (414px width) */
@media (min-width: 391px) and (max-width: 414px) {
    html body .main-image-container img {
        height: 180px !important;
        width: 100% !important;
        object-fit: cover !important;
    }
    
    html body #flexvi {
        height: 180px !important;
        width: 100% !important;
    }
    
    html body .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
    }
    
    html body .thumbnail-item {
        height: 50px !important;
        width: 100% !important;
        background: white !important;
        border: 2px solid transparent !important;
        border-radius: 5px !important;
        overflow: hidden !important;
        cursor: pointer !important;
    }
    
    html body .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}

/* iPhone 12 Pro, iPhone 13 Pro (390px width but taller) */
@media (min-width: 415px) and (max-width: 430px) {
    html body .main-image-container img {
        height: 190px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    
    html body .thumbnail-item {
        height: 50px !important;
    }
}

/* iPhone 14 Pro Max, Samsung Galaxy S20 Ultra (428px+ width) */
@media (min-width: 431px) and (max-width: 480px) {
    html body .main-image-container img {
        height: 200px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 8px !important;
    }
    
    html body .thumbnail-item {
        height: 55px !important;
    }
}

/* Base mobile styles for all devices under 480px */
@media (max-width: 480px) {
    /* Gallery section - Compact và tách biệt hoàn toàn */
    html body .product-gallery-container {
        margin-bottom: 40px !important;
        padding-bottom: 25px !important;
        border-bottom: 2px solid #f0f0f0 !important;
        background: white !important;
        border-radius: 8px !important;
        padding: 15px 15px 25px 15px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05) !important;
        /* Remove max-height and overflow hidden to show all thumbnails */
        min-height: auto !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        clear: both !important;
    }
    
    /* Ensure all containers are responsive */
    html body .main-image-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 15px !important;
        background: white !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
    }
    
    /* Force video containers to be responsive */
    html body #flexvi {
        position: relative !important;
        width: 100% !important;
        max-width: 100% !important;
        background: #000 !important;
        border-radius: 8px !important;
        overflow: hidden !important;
    }
    
    html body #videoif,
    html body #flexvi iframe {
        width: 100% !important;
        height: 100% !important;
        border: none !important;
        max-width: 100% !important;
    }
    
    /* Thumbnail section improvements */
    html body .thumbnail-section {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Base thumbnail grid for mobile */
    html body .thumbnail-grid {
        display: grid !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 15px !important;
        margin-bottom: 20px !important;
    }
    
    /* Base thumbnail styling */
    html body .thumbnail-item {
        background: white !important;
        border: 2px solid transparent !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        position: relative !important;
    }
    
    html body .thumbnail-item:hover {
        border-color: #007cba !important;
        transform: translateY(-1px) !important;
    }
    
    html body .thumbnail-item.active {
        border-color: #007cba !important;
        box-shadow: 0 2px 8px rgba(0,124,186,0.3) !important;
    }
    
    html body .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
}
    
    html body .thumbnail-section {
        margin-bottom: 40px !important;
        padding-bottom: 25px !important;
        border-bottom: 2px solid #ddd !important;
        background: #fafafa !important;
        padding: 10px 5px 25px 5px !important;
        margin: 10px 0 40px 0 !important;
    }
    
    html body .main-image-container {
        margin-bottom: 10px !important;
    }
    
    html body .main-image-container img {
        height: 180px !important;
    }
    
    html body .thumbnail-grid {
        display: grid !important;
        grid-template-columns: repeat(4, 1fr) !important; /* 4 cột thay vì 6 để dễ nhìn hơn */
        gap: 6px !important;
        margin-top: 12px !important;
        margin-bottom: 20px !important;
        /* Remove max-height để hiện hết thumbnail */
        height: auto !important;
        overflow: visible !important;
        padding-bottom: 15px !important;
    }
    
    html body .thumbnail-item {
        width: 100% !important;
        height: 60px !important; /* Tăng height để dễ click */
        background: white !important;
        border: 2px solid transparent !important;
        border-radius: 6px !important;
        overflow: hidden !important;
        cursor: pointer !important;
        transition: all 0.3s ease !important;
        flex-shrink: 0 !important;
    }
    
    html body .thumbnail-item img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        display: block !important;
    }
    
    /* Mobile thumbnail interactions */
    html body .thumbnail-item:hover {
        border-color: #007cba !important;
        transform: translateY(-1px) !important;
    }
    
    html body .thumbnail-item.active {
        border-color: #007cba !important;
        box-shadow: 0 2px 8px rgba(0,124,186,0.3) !important;
    }
    
    /* Ensure main image displays properly on mobile */
    html body .main-image-container {
        width: 100% !important;
        margin-bottom: 15px !important;
        background: white !important;
        border-radius: 8px !important;
        overflow: hidden !important;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1) !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    html body .main-image-container img {
        width: 100% !important;
        height: 200px !important; /* Tăng height cho mobile */
        object-fit: cover !important;
        display: block !important;
        cursor: pointer !important;
        transition: transform 0.3s ease !important;
    }
}

/* Samsung Galaxy S8+ (360px width) */
@media (min-width: 360px) and (max-width: 375px) {
    html body .main-image-container img {
        height: 155px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 3px !important;
    }
    
    html body .thumbnail-item {
        height: 32px !important;
    }
}

/* Pixel 7 (412px width) */
@media (min-width: 412px) and (max-width: 414px) {
    html body .main-image-container img {
        height: 185px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
    
    html body .thumbnail-item {
        height: 48px !important;
    }
}

/* Samsung Galaxy Fold (280px width when folded) */
@media (max-width: 320px) {
    html body .product-gallery-container {
        padding: 5px !important;
    }
    
    html body .main-image-container img {
        height: 140px !important;
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* 4 cột cho fold */
        gap: 2px !important;
    }
    
    html body .thumbnail-item {
        height: 30px !important;
    }
}

/* Large Android phones (Samsung S20 Ultra, etc.) */
@media (min-width: 481px) and (max-width: 540px) {
    html body .main-image-container img {
        height: 220px !important; /* Lớn hơn cho màn hình lớn */
    }
    
    html body .thumbnail-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 10px !important;
    }
    
    html body .thumbnail-item {
        height: 60px !important;
    }
    
    html body .product-gallery-container {
        padding: 20px !important;
    }
}

/* Đảm bảo text elements luôn hiện trên gallery */
html body .product-title, 
html body .product-meta,
html body h1.product-title,
html body .meta-item,
html body .meta-label,
html body .meta-value {
    position: relative !important;
    z-index: 10 !important;
    background: transparent !important;
}

/* Mobile: Tách biệt hoàn toàn gallery và content */
@media (max-width: 480px) {
    html body .product-title {
        margin-top: 20px !important;
        clear: both !important;
        display: block !important;
    }
    
    html body .product-meta {
        margin-top: 15px !important;
        clear: both !important;
        display: block !important;
        background: white !important;
        padding: 10px !important;
        border-radius: 6px !important;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    }
    
    /* Đảm bảo tất cả content sau gallery có margin đủ */
    html body .product-gallery-container + * {
        margin-top: 25px !important;
    }
}

/* ===== RESPONSIVE IFRAME SIZING FOR MOBILE ===== */
/* Tối ưu kích thước iframe video cho từng loại thiết bị */

/* iPhone SE và phones nhỏ (≤375px) */
@media (max-width: 375px) {
    iframe[src*="youtube.com"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo.com"],
    .video-wrapper iframe,
    .video-container iframe,
    .youtube-embed-wrapper iframe {
        width: 100% !important;
        height: 180px !important;
        max-height: 180px !important;
        min-height: 160px !important;
        aspect-ratio: 16/9 !important;
    }
}

/* iPhone 12 mini và similar (376px - 414px) */
@media (min-width: 376px) and (max-width: 414px) {
    iframe[src*="youtube.com"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo.com"],
    .video-wrapper iframe,
    .video-container iframe,
    .youtube-embed-wrapper iframe {
        width: 100% !important;
        height: 200px !important;
        max-height: 200px !important;
        min-height: 180px !important;
        aspect-ratio: 16/9 !important;
    }
}

/* iPhone Pro và large phones (415px - 480px) */
@media (min-width: 415px) and (max-width: 480px) {
    iframe[src*="youtube.com"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo.com"],
    .video-wrapper iframe,
    .video-container iframe,
    .youtube-embed-wrapper iframe {
        width: 100% !important;
        height: 220px !important;
        max-height: 220px !important;
        min-height: 200px !important;
        aspect-ratio: 16/9 !important;
    }
}

/* Large Android phones và tablets nhỏ (481px+) */
@media (min-width: 481px) and (max-width: 768px) {
    iframe[src*="youtube.com"],
    iframe[src*="youtu.be"],
    iframe[src*="vimeo.com"],
    .video-wrapper iframe,
    .video-container iframe,
    .youtube-embed-wrapper iframe {
        width: 100% !important;
        height: 250px !important;
        max-height: 280px !important;
        min-height: 220px !important;
        aspect-ratio: 16/9 !important;
    }
    
    /* Gallery images cho large phones và tablets nhỏ */
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 280px !important;
    }
}

/* Đảm bảo iframe container responsive */
.youtube-embed-wrapper,
.video-wrapper,
.video-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    border-radius: 8px !important;
}

/* Fix any hardcoded iframe sizes trong nội dung */
@media (max-width: 768px) {
    iframe[width="640"],
    iframe[height="360"] {
        width: 100% !important;
        height: auto !important;
        max-height: 220px !important;
        aspect-ratio: 16/9 !important;
    }
}

/* ===== DEVICE-SPECIFIC GALLERY IMAGE HEIGHTS ===== */

/* iPhone SE và Galaxy Fold (320px-375px) - Compact gallery */
@media (max-width: 375px) {
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 180px !important;
    }
    
    .product-detail-page .lightSlider li img {
        object-fit: cover !important;
        object-position: center !important;
    }
}

/* iPhone 12 mini và similar (376px-390px) - Medium-small gallery */
@media (min-width: 376px) and (max-width: 390px) {
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 200px !important;
    }
}

/* iPhone XR/11 và Pixel 5 (391px-414px) - Medium gallery */
@media (min-width: 391px) and (max-width: 414px) {
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 220px !important;
    }
}

/* iPhone 12/13 Pro và Samsung Galaxy S21 (415px-430px) - Medium-large gallery */
@media (min-width: 415px) and (max-width: 430px) {
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 240px !important;
    }
}

/* iPhone 14 Pro Max và Samsung Galaxy S22+ (431px-480px) - Large mobile gallery */
@media (min-width: 431px) and (max-width: 480px) {
    .product-detail-page .main-gallery,
    .product-detail-page .lightSlider,
    .product-detail-page .lightSlider li {
        height: 260px !important;
    }
}

/* ===== DEVICE-SPECIFIC THUMBNAIL RESPONSIVE SIZES ===== */

/* iPhone SE và Galaxy Fold - Compact thumbnails */
@media (max-width: 375px) {
    .product-detail-page .thumbnail-item {
        width: 50px !important;
        height: 50px !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 50px !important;
        height: 50px !important;
    }
    
    .product-detail-page .thumbnail-grid {
        gap: 8px !important;
        grid-template-columns: repeat(auto-fit, minmax(50px, 1fr)) !important;
    }
}

/* iPhone 12 mini - Medium-small thumbnails */
@media (min-width: 376px) and (max-width: 390px) {
    .product-detail-page .thumbnail-item {
        width: 55px !important;
        height: 55px !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 55px !important;
        height: 55px !important;
    }
}

/* iPhone XR/11 - Medium thumbnails */
@media (min-width: 391px) and (max-width: 414px) {
    .product-detail-page .thumbnail-item {
        width: 60px !important;
        height: 60px !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 60px !important;
        height: 60px !important;
    }
}

/* iPhone 12/13 Pro - Medium-large thumbnails */
@media (min-width: 415px) and (max-width: 430px) {
    .product-detail-page .thumbnail-item {
        width: 65px !important;
        height: 65px !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 65px !important;
        height: 65px !important;
    }
}

/* iPhone 14 Pro Max - Large thumbnails */
@media (min-width: 431px) and (max-width: 480px) {
    .product-detail-page .thumbnail-item {
        width: 70px !important;
        height: 70px !important;
    }
    
    .product-detail-page .thumbnail-item img {
        width: 70px !important;
        height: 70px !important;
    }
}

/* ===== DEVICE-SPECIFIC lSGALLERY THUMBNAIL FIXES ===== */

/* iPhone SE và Galaxy Fold - Compact lSGallery */
@media (max-width: 375px) {
    .product-detail-page .lSGallery {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 10px !important;
        padding: 8px !important;
        gap: 6px !important;
        min-height: 50px !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
    }
    
    .product-detail-page .lSGallery li {
        width: 45px !important;
        height: 45px !important;
        min-width: 45px !important;
        flex-shrink: 0 !important;
        margin-right: 0 !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .product-detail-page .lSGallery li img {
        width: 100% !important;
        height: 100% !important;
        visibility: visible !important;
        opacity: 1 !important;
        object-fit: cover !important;
    }
}

/* iPhone 12 mini - Medium-small lSGallery */
@media (min-width: 376px) and (max-width: 390px) {
    .product-detail-page .lSGallery li {
        width: 50px !important;
        height: 50px !important;
        min-width: 50px !important;
    }
}

/* iPhone XR/11 - Medium lSGallery */
@media (min-width: 391px) and (max-width: 414px) {
    .product-detail-page .lSGallery li {
        width: 55px !important;
        height: 55px !important;
        min-width: 55px !important;
    }
}

/* iPhone 12/13 Pro - Medium-large lSGallery */
@media (min-width: 415px) and (max-width: 430px) {
    .product-detail-page .lSGallery li {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
    }
}

/* iPhone 14 Pro Max - Large lSGallery */
@media (min-width: 431px) and (max-width: 480px) {
    .product-detail-page .lSGallery li {
        width: 65px !important;
        height: 65px !important;
        min-width: 65px !important;
    }
}
