/**
 * Super Product Plugin - Consolidated CSS
 * Combines all public styles for optimal performance
 * Eliminates duplicate rules and reduces HTTP requests
 */

/* Product fade-in animation classes removed (2025.06.30.07.48)
   Eliminated unnecessary animation complexity for minimal visual benefit
   Products now appear instantly for better performance */

/* ========================================
   CORE STYLES - Product Layout & Structure
   ======================================== */

/* Remove unwanted focus outlines from product content */
.product-content-wrapper,
.product-content-wrapper *,
.product-header,
.product-header *,
.product-background-wrapper,
.product-background-wrapper * {
    outline: none !important;
}

/* Keep focus styles only for interactive elements */
.product-content-wrapper a:focus,
.product-content-wrapper button:focus,
.amazon-buy-button:focus {
    outline: 2px solid #0073aa !important;
    outline-offset: 2px !important;
}

/* Full-width background wrapper for odd/even products */
.product-background-wrapper {
    position: relative !important;
    margin-bottom: 20px !important;
    padding: 15px 0 !important;
    background: transparent !important;
}

/* Create full-width pseudo-element backgrounds */
.product-background-wrapper::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 50% !important;
    width: 100vw !important;
    height: 100% !important;
    transform: translateX(-50%) !important;
    z-index: -1 !important;
}

/* Background colors for odd/even products - set dynamically from admin settings */
.product-background-wrapper.product-odd::before {
    /* Background color set via inline CSS from admin settings */
}

.product-background-wrapper.product-even::before {
    /* Background color set via inline CSS from admin settings */
}

/* Product content wrapper - Hybrid Layout */
.product-content-wrapper {
    width: 100%;
    max-width: 730px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    padding: 0 15px;
    /* Create header section with flexbox, normal flow for content */
    position: relative;
}

.product-content-wrapper p {
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
}

/* ========================================
   PRODUCT HEADER STYLES
   ======================================== */

.product-header-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Account for floated number circle */
    margin-left: 0;
    margin-bottom: 20px;
    /* Clear floated number on small screens if needed */
    overflow: hidden;
}

.product-header {
    margin: 0;
    line-height: 1.4;
}

.product-header-women {
    color: #ff69b4;
}

.product-header-men {
    color: #4169e1;
}

.product-header-default {
    color: #333;
}

/* Product numbering - Positioned for header layout */
.product-numbering {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 50%;
    font-weight: bold;
    font-size: 38px;
    line-height: 1;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border: 2px solid #000;
    box-sizing: border-box;
    flex-shrink: 0;
    /* Position for horizontal layout with header */
    float: left;
    margin-right: 15px;
    margin-bottom: 20px;
}

/* Legacy alignment classes - now use float positioning */
.product-numbering.alignleft {
    /* Float positioning for horizontal layout */
    float: left;
    margin-right: 15px;
    margin-bottom: 20px;
}

/* Flexbox header layout */
.product-header-wrapper .product-numbering {
    /* Numbers should not be inside header wrapper with flexbox */
    /* This rule maintained for backward compatibility only */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: #f5f5f5;
    color: #333;
    border-radius: 50%;
    font-weight: bold;
    font-size: 38px;
    border: 2px solid #000 !important;
    box-sizing: border-box !important;
    margin: 0 15px 0 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Legacy alignment classes */
.alignleft {
    float: left;
    margin-right: 15px;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* ========================================
   LIST STYLES
   ======================================== */

.super-product-list {
    list-style-type: disc;
    margin-left: 0;
    padding-left: 20px;
    margin-bottom: 20px;
}

.super-product-list li {
    margin-bottom: 10px;
    padding-left: 0;
}

.super-product-list.no-indent {
    padding-left: 18px;
    margin-left: 0;
}

.super-product-list.no-indent li {
    padding-left: 0;
    text-indent: 0;
}

/* ========================================
   AMAZON BUY BUTTON STYLES
   ======================================== */

.columnC {
    margin: 15px 0;
    text-align: center;
}

.columnC a,
.custom-row .columnC a,
.amazon-buy-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: linear-gradient(to bottom, #ff9900, #ff8c00) !important;
    border: 1px solid #cc7700 !important;
    color: #111 !important;
    text-decoration: none !important;
    padding: 8px 19px !important;
    border-radius: 25px !important;
    font-weight: bold !important;
    font-size: 17px !important;
    line-height: 1.2 !important;
    min-height: 30px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15) !important;
    transition: all 0.15s ease !important;
    gap: 8px !important;
}

.columnC a:hover,
.custom-row .columnC a:hover,
.amazon-buy-button:hover {
    background: linear-gradient(to bottom, #ff8800, #ff7700) !important;
    border-color: #bb6600 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
}

.columnC a:active,
.custom-row .columnC a:active,
.amazon-buy-button:active {
    background: linear-gradient(to bottom, #ff7700, #ee6600) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2) inset !important;
    transform: translateY(1px) !important;
}

.columnC svg,
.custom-row .columnC a svg,
.amazon-buy-button svg {
    width: 16px !important;
    height: 16px !important;
    flex-shrink: 0 !important;
    vertical-align: middle !important;
}

.columnC .icon_svg-stroke,
.custom-row .columnC a .icon_svg-stroke,
.amazon-buy-button .icon_svg-stroke {
    stroke: #111 !important;
    stroke-width: 1.5px !important;
}

/* ========================================
   TABLE STYLES - Core Structure
   ======================================== */

/* Table wrapper - optimized for all devices */
.super_product_table_wrapper {
    max-width: 720px !important;
    margin: 0 auto !important;
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-bottom: 20px !important;
    position: relative;
    contain: layout;
}

/* Custom scrollbar styling */
.super_product_table_wrapper::-webkit-scrollbar {
    height: 8px;
}

.super_product_table_wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.super_product_table_wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.super_product_table_wrapper::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Scroll indicators */
.scroll-indicator {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

/* Force table structure - override theme interference */
.super_product_table {
    width: 100% !important;
    min-width: 600px !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    display: table !important;
    contain: layout style;
    will-change: auto;
}

.super_product_table thead {
    display: table-header-group !important;
}

.super_product_table tbody {
    display: table-row-group !important;
}

.super_product_table tr {
    display: table-row !important;
    width: auto !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.super_product_table th,
.super_product_table td {
    display: table-cell !important;
    border: 1px solid #eee !important;
    padding: 8px 5px !important;
    vertical-align: middle !important;
    position: static !important;
    min-height: 0 !important;
}

/* Remove mobile data-title attributes */
.super_product_table td:before,
.super_product_table td::before {
    display: none !important;
    content: none !important;
}

/* ========================================
   TABLE STYLES - Headers & Row Colors
   ======================================== */

/* Header styling */
.super_product_table th,
.product-content-wrapper .super_product_table th,
.super_product_table_wrapper .super_product_table th {
    font-weight: bold !important;
    background-color: #d3d3d3 !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Row coloring - dynamically set via PHP */
.super_product_table tr.odd,
.super_product_table tr.odd td {
    background-color: inherit !important;
    position: relative !important;
    z-index: 2 !important;
}

.super_product_table tr.even,
.super_product_table tr.even td {
    background-color: inherit !important;
    position: relative !important;
    z-index: 2 !important;
}

/* Remove any cell-specific backgrounds */
.super_product_table td {
    font-weight: normal !important;
    background: transparent !important;
}

/* Ensure score column inherits row background */
.super_product_table .column-score {
    background: inherit !important;
}

/* ========================================
   TABLE STYLES - Column Specific
   ======================================== */

/* Column widths */
.super_product_table .column-number {
    width: 50px !important;
    min-width: 50px !important;
    text-align: center !important;
}

.super_product_table .column-title {
    width: 120px !important;
    min-width: 120px !important;
}

.super_product_table .column-image {
    width: 130px !important;
    min-width: 130px !important;
    text-align: center !important;
}

.super_product_table .column-features {
    width: 200px !important;
    min-width: 200px !important;
}

.super_product_table .column-score {
    width: 60px !important;
    min-width: 60px !important;
    text-align: center !important;
    font-weight: normal !important;
}

/* Image styling */
.super_product_table .column-image img {
    max-width: 100%;
    height: auto;
    max-height: 100px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* Feature lists */
.super_product_table .column-features ul,
.super_product_table .table-features-list {
    list-style-type: disc !important;
    margin: 0 !important;
    padding-left: 15px !important;
    list-style-position: outside !important;
}

.super_product_table .column-features li,
.super_product_table .table-features-list li {
    margin-bottom: 6px !important;
    line-height: 1.3 !important;
    padding-left: 0 !important;
    text-align: left !important;
}

.super_product_table .table-features-list li:last-child {
    margin-bottom: 0 !important;
}

/* Table numbering in cells */
.super_product_table .product-table-numbering,
.super_product_table_wrapper .super_product_table .product-table-numbering {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 30px !important;
    height: 30px !important;
    background-color: #f5f5f5 !important;
    color: #333 !important;
    border-radius: 50% !important;
    font-weight: bold !important;
    font-size: 16px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
    border: 2px solid #000 !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
    flex-shrink: 0 !important;
}

/* ========================================
   TABLE STYLES - Gender-Based Colors
   ======================================== */

/* Women's products - hot pink */
.super_product_table .column-title.product-gender-women a,
.super_product_table .column-title.product-gender-women strong {
    color: rgb(255, 105, 180) !important;
}

/* Men's products - royal blue */
.super_product_table .column-title.product-gender-men a,
.super_product_table .column-title.product-gender-men strong {
    color: rgb(65, 105, 225) !important;
}

/* Unknown gender - default */
.super_product_table .column-title.product-gender-unknown a,
.super_product_table .column-title:not(.product-gender-women):not(.product-gender-men) a {
    color: #333 !important;
}

/* ========================================
   RESPONSIVE STYLES - Tablet (768px and below)
   ======================================== */

@media only screen and (max-width: 768px) {
    /* Remove desktop max-width constraint */
    .super_product_table_wrapper {
        max-width: none !important;
        margin: 0 !important;
    }
    
    /* Apply full-width styles when enhanced by JavaScript */
    .super_product_table_wrapper[data-super-product-processed="true"] {
        position: relative !important;
        left: 50% !important;
        width: 100vw !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        max-width: none !important;
    }
    
    /* Table adjustments */
    .super_product_table {
        font-size: 14px !important;
        min-width: 100% !important;
        table-layout: fixed !important;
    }
    
    /* Adjust column widths for tablet */
    .super_product_table .column-number {
        width: 40px !important;
        min-width: 40px !important;
    }
    
    .super_product_table .column-title {
        width: 22% !important;
        min-width: 100px !important;
    }
    
    .super_product_table .column-image {
        width: 22% !important;
        min-width: 110px !important;
        max-width: 150px !important;
    }
    
    .super_product_table .column-features {
        width: 40% !important;
    }
    
    .super_product_table .column-score {
        width: 50px !important;
        min-width: 50px !important;
    }
    
    /* Cell padding adjustments */
    .super_product_table td,
    .super_product_table th {
        padding: 8px 5px !important;
        word-break: break-word !important;
    }
    
    /* Image size adjustments */
    .super_product_table .column-image img {
        max-height: 100px !important;
    }
    
    /* Feature lists on tablet */
    .super_product_table .column-features ul,
    .super_product_table .table-features-list {
        padding-left: 15px !important;
        font-size: 13px !important;
    }
    
    .super_product_table .column-features li,
    .super_product_table .table-features-list li {
        margin-bottom: 3px !important;
        line-height: 1.2 !important;
    }
    
    /* Product header on tablet */
    .product-header-wrapper {
        flex-direction: row !important;
        padding-left: 0 !important;
    }
    
    .product-numbering {
        margin-right: 8px !important;
    }
}

/* ========================================
   RESPONSIVE STYLES - Mobile (480px and below)
   ======================================== */

@media only screen and (max-width: 480px) {
    /* Increase table numbering by 30% on mobile only */
    .super_product_table .product-table-numbering,
    .super_product_table_wrapper .super_product_table .product-table-numbering {
        width: 33px !important; /* 30% larger than original 25px */
        height: 33px !important; /* 30% larger than original 25px */
        font-size: 17px !important; /* 30% larger than original 13px */
        border: 2px solid #000 !important;
    }
    
    /* Further image size reduction */
    .super_product_table .column-image img {
        max-height: 80px !important;
    }
    
    /* Tighter feature lists */
    .super_product_table .table-features-list {
        font-size: 0.9em !important;
        line-height: 1.3 !important;
    }
}

/* ========================================
   RESPONSIVE STYLES - Small Mobile (414px and below)
   ======================================== */

@media only screen and (max-width: 414px) {
    /* Ensure data-title is never displayed */
    .super_product_table td {
        padding-left: 8px !important;
        padding-top: 8px !important;
        padding-right: 8px !important;
        padding-bottom: 8px !important;
    }
    
    .super_product_table td:before,
    .super_product_table td::before,
    .super_product_table td[data-title]:before,
    .super_product_table td[data-title]::before {
        display: none !important;
        content: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        width: 0 !important;
        font-size: 0 !important;
    }
}

/* ========================================
   DEVICE-SPECIFIC FIXES
   ======================================== */

/* iOS specific overrides */
.ios-device .super_product_table_wrapper {
    -webkit-overflow-scrolling: touch;
}

/* Override mobile-view class */
.super_product_table.mobile-view {
    display: table !important;
}

.super_product_table.mobile-view thead {
    display: table-header-group !important;
}

.super_product_table.mobile-view tbody {
    display: table-row-group !important;
}

.super_product_table.mobile-view tr {
    display: table-row !important;
    width: auto !important;
    margin-bottom: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

.super_product_table.mobile-view th,
.super_product_table.mobile-view td {
    display: table-cell !important;
    width: auto !important;
    border: 1px solid #eee !important;
    min-height: 0 !important;
    position: static !important;
}

/* ========================================
   MOBILE-FIRST TABLE REDESIGN (<430px)
   ======================================== */

@media only screen and (max-width: 430px) {
    /* Container modifications */
    .super_product_table_wrapper {
        overflow-x: auto !important;
        scroll-behavior: smooth !important;
        scrollbar-width: none !important; /* Firefox */
        -ms-overflow-style: none !important; /* IE and Edge */
        position: relative !important;
        width: 100vw !important; /* Full viewport width */
        margin: 2px 0 !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    /* Hide default scrollbar */
    .super_product_table_wrapper::-webkit-scrollbar {
        display: none !important;
    }

    /* Container for table */
    .super_product_container {
        position: relative !important;
        margin: 0 !important;
        padding: 15px 0 !important; /* Match indicator height */
        width: 100% !important;
    }

    /* Make table use full width */
    .super_product_table {
        width: 100% !important;
        margin: 0 !important;
    }

    /* Scroll indicators */
    .scroll-progress-bar {
        position: absolute !important;
        left: 15px !important; /* Add margin for rounded corners */
        right: 15px !important;
        height: 15px !important;
        line-height: 15px !important;
        background: black !important;
        color: white !important;
        font-size: 12px !important;
        text-align: center !important;
        font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
        white-space: nowrap !important;
        border-radius: 7.5px !important; /* Half of height for rounded ends */
    }

    /* Indicator text */
    .scroll-progress-bar::after {
        content: "<-- Scroll Table -->" !important;
        display: inline-block !important;
        padding: 0 5px !important;
        letter-spacing: 0.5px !important;
    }

    /* Position indicators */
    .scroll-progress-top {
        top: 1px !important;
    }

    .scroll-progress-bottom {
        bottom: 1px !important;
    }

    /* Table structure */
    .super_product_table {
        border-collapse: collapse !important;
        white-space: normal !important;
        margin: 0 !important;
        width: calc(100vw + 50px) !important;
        table-layout: fixed !important;
        position: relative !important;
    }

    /* Column widths for mobile - hide column 1, make others 30%, 40%, 30%, add column 5 */
    .super_product_table .column-number {
        display: none !important;
    }

    .super_product_table .column-title {
        width: 30% !important;
        min-width: 30% !important;
        padding: 8px !important;
    }

    .super_product_table .column-image {
        width: 40% !important;
        min-width: 40% !important;
        padding: 8px !important;
    }

    .super_product_table .column-features {
        width: 30% !important;
        min-width: 30% !important;
        padding: 8px !important;
    }

    .super_product_table .column-score {
        width: 50px !important;
        min-width: 50px !important;
        padding: 8px !important;
        background: white !important;
    }

    /* iOS specific fixes without JS detection */
    @supports (-webkit-touch-callout: none) {
        .super_product_table_wrapper {
            -webkit-overflow-scrolling: touch !important;
        }
    }
}

/* ========================================
   ACCESSIBILITY ENHANCEMENTS
   ======================================== */

/* Screen reader only text */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Keyboard navigation focus styles */
.super_product_table_wrapper:focus {
    outline: 2px solid #0073aa !important;
    outline-offset: 2px !important;
}

.super_product_table th:focus,
.super_product_table td:focus {
    outline: 2px solid #0073aa !important;
    outline-offset: -2px !important;
    position: relative !important;
    z-index: 1 !important;
}

/* Enhanced focus for interactive elements */
.super_product_table a:focus,
.super_product_table button:focus {
    outline: 2px solid #0073aa !important;
    outline-offset: 2px !important;
    background-color: rgba(0, 115, 170, 0.1) !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .super_product_table {
        border: 2px solid !important;
    }
    
    .super_product_table th,
    .super_product_table td {
        border: 1px solid !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .super_product_table_wrapper {
        scroll-behavior: auto !important;
    }
    
    .super_product_table * {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== RESPONSIVE LINK TARGET SYSTEM ===== */
/* Show desktop links by default, hide mobile links */
.product-link-desktop {
    display: inline !important;
}

.product-link-mobile {
    display: none !important;
}

/* On mobile devices, show mobile links and hide desktop links */
@media screen and (max-width: 768px) {
    .product-link-desktop {
        display: none !important;
    }
    
    .product-link-mobile {
        display: inline !important;
    }
}

/* ========================================
   TABLE SCROLL INDICATORS
   ======================================== */

.scroll-progress-bar {
    position: absolute !important;
    left: 15px !important;
    right: 15px !important;
    height: 15px !important;
    background: black !important;
    color: white !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-size: 12px !important;
    border-radius: 7.5px !important;
    z-index: 10 !important;
}

.scroll-progress-top {
    top: 1px !important;
}

.scroll-progress-bottom {
    bottom: 1px !important;
}

/* Hide scrollbars but keep functionality */
.super_product_table_wrapper {
    -ms-overflow-style: none !important;  /* IE and Edge */
    scrollbar-width: none !important;  /* Firefox */
    position: relative !important;
    overflow-x: auto !important;
    margin: 2px 0 !important;
    scroll-behavior: smooth !important;
    padding: 0 !important;
}

.super_product_table_wrapper::-webkit-scrollbar {
    display: none !important; /* Chrome, Safari and Opera */
}

/* Only show scroll indicators on mobile */
@media only screen and (max-width: 430px) {
    .scroll-progress-bar {
        display: flex !important;
    }
    
    .super_product_table_wrapper {
        margin: 2px 0 !important;
    }

    /* Ensure table sits directly against wrapper edges */
    .super_product_table {
        margin: 0 !important;
        border-spacing: 0 !important;
    }
}

@media only screen and (min-width: 431px) {
    .scroll-progress-bar {
        display: none !important;
    }
    
    .super_product_table_wrapper {
        margin: 0 !important;
    }
}

