/* Toolvizion Product Page Responsive Styles */

/* Mobile First Approach */
@media screen and (max-width: 768px) {
    /* Container adjustments */
    .itemmodouter,
    .itemmod {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 10px !important;
    }
    
    /* Product title responsive */
    h1.toolvizionH1 {
        font-size: 16px !important;
        line-height: 1.3 !important;
        word-wrap: break-word !important;
    }
    
    /* Make tables responsive with horizontal scroll */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        margin-bottom: 20px !important;
    }
    
    /* Tables - both toolviziontd and woocommerce-product-attributes */
    table,
    .woocommerce-product-attributes,
    table:has(.toolviziontd) {
        min-width: 600px !important; /* Minimum width to maintain readability */
        font-size: 11px !important;
    }
    
    /* Table cells */
    .toolviziontd,
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value,
    table th,
    table td {
        padding: 5px 3px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }
    
    /* Ensure table wrapper for scrolling */
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
    }
    
    /* Product description text */
    .itemmod p {
        font-size: 13px !important;
        line-height: 1.5 !important;
        text-align: left !important;
    }
    
    /* Lists in product description */
    .itemmod ul,
    .itemmod ol {
        padding-left: 20px !important;
        font-size: 13px !important;
    }
    
    /* Headers in product content */
    .itemmod h2 {
        font-size: 18px !important;
        margin-top: 15px !important;
        margin-bottom: 10px !important;
    }
}

/* Small tablets and large phones */
@media screen and (min-width: 481px) and (max-width: 768px) {
    table,
    .woocommerce-product-attributes {
        font-size: 12px !important;
    }
    
    .toolviziontd,
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value,
    table th,
    table td {
        padding: 6px 4px !important;
        font-size: 12px !important;
    }
}

/* iPad and tablets */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .itemmod {
        margin-left: 10% !important;
        margin-right: 10% !important;
    }
    
    table,
    .woocommerce-product-attributes {
        font-size: 11pt !important;
    }
    
    h1.toolvizionH1 {
        font-size: 14pt !important;
    }
}

/* Very small phones */
@media screen and (max-width: 480px) {
    /* Even smaller font sizes for tiny screens */
    table,
    .woocommerce-product-attributes {
        font-size: 10px !important;
        min-width: 500px !important;
    }
    
    .toolviziontd,
    .woocommerce-product-attributes-item__label,
    .woocommerce-product-attributes-item__value,
    table th,
    table td {
        padding: 4px 2px !important;
        font-size: 10px !important;
    }
    
    h1.toolvizionH1 {
        font-size: 14px !important;
    }
    
    .itemmod h2 {
        font-size: 16px !important;
    }
    
    /* Make content full width on very small screens */
    .itemmodouter,
    .itemmod {
        padding: 5px !important;
    }
}

/* Ensure proper scrolling indicators */
@media screen and (max-width: 768px) {
    /* Add visual indicator for scrollable tables */
    .table-responsive:after {
        content: '→';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255,255,255,0.9);
        padding: 5px;
        font-size: 20px;
        color: #666;
        pointer-events: none;
        opacity: 0.7;
    }
    
    /* Hide scroll indicator when scrolled */
    .table-responsive.scrolled:after {
        display: none;
    }
}

/* Ensure text remains readable */
@media screen and (max-width: 768px) {
    /* Prevent text from being too small */
    p, li {
        font-size: 13px !important;
        line-height: 1.6 !important;
    }
    
    /* Strong text should remain visible */
    strong {
        font-weight: bold !important;
    }
}

/* Portrait orientation specific */
@media screen and (orientation: portrait) and (max-width: 768px) {
    /* Additional adjustments for portrait mode */
    .itemmod {
        max-width: 100% !important;
    }
}

/* Landscape orientation specific */
@media screen and (orientation: landscape) and (max-width: 896px) {
    /* Better use of horizontal space in landscape */
    .itemmod {
        margin-left: 5% !important;
        margin-right: 5% !important;
    }
}

/* Print styles */
@media print {
    /* Ensure tables print properly */
    table,
    .woocommerce-product-attributes {
        page-break-inside: avoid !important;
    }
    
    .table-responsive {
        overflow: visible !important;
    }
}