/**
 * Versus Comparison Three-Column Layout
 *
 * Styles for the versus-style mobile comparison layout matching v1.2.0.png
 * Layout: Left Product | Center Spec Labels | Right Product
 */

/* ===== MAIN CONTAINER ===== */
.mobzella-versus-comparison {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    max-width: 100%;
    margin: 20px auto;
    padding: 20px 10px;
    background-color: #ffffff;
    border-radius: 8px;
    /* box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); */
    border: 1px solid #e9e4fa;
}
.mobzella-versus-comparison[data-products="1"],
.mobzella-versus-comparison[data-products="2"] {
    justify-content: center;
    align-items: center;
}
/* ===== PRODUCT HEADERS SECTION ===== */

.versus-products-header {
    position: relative;
    margin-bottom: 30px;
}

/* Products track */
.versus-products-track {
    display: flex !important;
    align-items: stretch;
    justify-content: flex-start;
    gap: 15px;
    padding: 10px 0;
    min-width: 100%;
    width: max-content; /* Let the track grow with columns so horizontal borders stay continuous */
}

/* For 1-2 products, center them */
.versus-products-track[data-products="1"],
.versus-products-track[data-products="2"] {
    justify-content: center;
}


/* Force proper flexbox layout - override any theme conflicts */
.mobzella-versus-comparison .versus-products-track {
    display: flex !important;
}

/* Fallback for older browsers or conflicts */
.versus-products-track > * {
    box-sizing: border-box !important;
}


/* Individual product columns - Responsive width for mobile-first design */
.versus-product-column {
    flex: 0 0 auto;
    text-align: center;
    padding: 15px 8px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9e4fa;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    box-sizing: border-box;
}

/* Centered VS Labels - Fixed width for perfect alignment */
.versus-center-label {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 10px;
    font-weight: bold;
    font-size: 24px;
    color: #007cba;
    background: linear-gradient(45deg, #007cba, #005a87);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    box-sizing: border-box;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Tablet: Increase product column width for better readability */
@media (min-width: 480px) {
    .versus-product-column {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        padding: 18px 10px;
    }
}

/* Small Desktop: Further increase for better desktop experience */
@media (min-width: 768px) {
    .versus-product-column {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
        padding: 20px 15px;
    }
}

/* Large Desktop: Maximum size for optimal viewing */
@media (min-width: 1024px) {
    .versus-product-column {
        width: 350px !important;
        min-width: 350px !important;
        max-width: 350px !important;
        padding: 20px 15px;
    }
}
@media (max-width: 767px) {
    .versus-product-header {
        padding-top: 30px;
    }
    
    .versus-product-column {
        padding: 8px 8px;
    }
    .versus-view-product{
        font-size:12px;
        padding: 6px 12px;
    }
}

/* ===== MOBILE-SPECIFIC OPTIMIZATIONS ===== */

/* Mobile: Compact layout */
@media (max-width: 479px) {
    .versus-product-img {
        width: 80px !important;
        height: 80px !important;
    }

    .versus-product-title h3 {
        font-size: 12px !important;
        line-height: 1.2 !important;
        margin: 8px 0 !important;
    }

    .versus-product-price {
        font-size: 11px !important;
    }

    .product-release-date {
        font-size: 10px !important;
    }

    .product-weight {
        font-size: 10px !important;
    }

    .versus-center-label span {
        font-size: 18px !important;
    }

    .mobzella-versus-comparison {
        padding: 15px 5px !important;
    }

    .versus-products-track {
        gap: 8px !important;
    }

    .versus-spec-row {
        gap: 8px !important;
    }
}

/* Tablet: Medium-sized images */
@media (min-width: 480px) and (max-width: 767px) {
    .versus-product-img {
        width: 100px !important;
        height: 100px !important;
    }

    .versus-product-title h3 {
        font-size: 14px !important;
    }
}

/* No navigation controls - removed for simplicity */

/* Product Header Content */
.versus-product-header {
    width: 100%;
    position: relative;
}

/* Remove from Comparison Button */
.versus-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    font-size: 18px;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.versus-remove-btn:hover {
    background: rgba(239, 68, 68, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.versus-remove-btn:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

.versus-remove-btn .remove-icon {
    font-weight: bold;
    line-height: 1;
    color: white;
}

.versus-product-info {
    margin-bottom: 15px;
    min-height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.product-release-date {
    margin-bottom: 5px;
}

.release-year {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.release-month {
    font-size: 11px;
    color: #666;
}

.product-weight {
    font-size: 12px;
    color: #666;
}

/* Product Image */
.versus-product-image {
    margin-bottom: 15px;
    position: relative;
}

.versus-product-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 8px;
}

/* Product badges */
.product-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #007cba;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: bold;
}

.sale-badge {
    background: #e74c3c;
}

.featured-badge {
    background: #f39c12;
}

/* Product Title */
.versus-product-title h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 10px 0;
    line-height: 1.3;
    color: #333;
}

.versus-product-title a {
    text-decoration: none;
    color: inherit;
}

.versus-product-title a:hover {
    color: #007cba;
}

/* Product Price */
.versus-product-price {
    margin-bottom: 15px;
    font-weight: bold;
    color: #007cba;
}

/* Product Actions */
.versus-product-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.versus-add-to-cart,
.versus-view-product {
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.versus-add-to-cart {
    background: #007cba;
    color: white;
}

.versus-add-to-cart:hover {
    background: #005a87;
    color: white;
}

.versus-view-product {
    background: #764ab0;
    color: white;
}

.versus-view-product:hover {
    background: #2c1051;
    color: white;
}

/* ===== SPECIFICATIONS SECTION ===== */

.versus-specifications {
    border-top: 2px solid #e9e4fa;
    padding-top: 20px;
}

/* Scrollable specs track */
.versus-specs-track {
    position: relative;
    min-width: 100%;
    width: max-content; /* Match content width to keep spec rows aligned with the header track */
}

.versus-spec-row {
    display: flex !important;
    gap: 15px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e9e4fa;
    min-height: 60px;
    position: relative;
    min-width: 100%;
    width: max-content; /* Extend row width beyond viewport so the divider spans the full scrollable area */
}

.versus-spec-row:last-child {
    border-bottom: none;
}

/* For 1-2 products, center the content */
.versus-spec-row[data-products="1"],
.versus-spec-row[data-products="2"] {
    justify-content: center;
}

/* For 3+ products, start from left for scrolling */
.versus-spec-row[data-products="3"],
.versus-spec-row[data-products="4"],
.versus-spec-row[data-products="5"],
.versus-spec-row[data-products="6"] {
    justify-content: flex-start;
}

/* Individual product value cells - MUST match header widths exactly */
.versus-product-value {
    flex: 0 0 auto;
    text-align: center;
    padding: 15px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
    box-sizing: border-box;
    flex-shrink: 0;
    /* background: #f8f9fa; */
    border-radius: 12px;
    border: 1px solid #e9e4fa;
}

/* Center Specification Label - MUST match header VS label widths exactly */
.versus-center-spec {
    flex: 0 0 auto;
    text-align: center;
    padding: 8px 12px;
    background: rgb(222 215 247 / 67%);
    border-radius: 8px;
    border: 1px solid #e9e4fa;
    width: 50px !important;
    min-width: 50px !important;
    max-width: 50px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

/* ===== RESPONSIVE BREAKPOINTS FOR SPEC VALUES ===== */

/* Tablet: Match product column widths for perfect alignment */
@media (min-width: 480px) {
    .versus-product-value {
        width: 180px !important;
        min-width: 180px !important;
        max-width: 180px !important;
        padding: 18px 10px;
    }
}

/* Small Desktop: Match product column widths */
@media (min-width: 768px) {
    .versus-product-value {
        width: 250px !important;
        min-width: 250px !important;
        max-width: 250px !important;
        padding: 20px 15px;
    }
    .versus-center-spec {
        width: 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
    }
}

/* Large Desktop: Match product column widths */
@media (min-width: 1024px) {
    .versus-product-value {
        width: 350px !important;
        min-width: 350px !important;
        max-width: 350px !important;
        padding: 20px 15px;
    }

}

/* Add decorative separator between spec rows */
/* .versus-spec-row:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #007cba, transparent);
    z-index: 1;
} */

/* Alternative: dotted separator */
/* .versus-spec-row:not(:last-child)::before {
    content: '• • •';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    color: #007cba;
    font-size: 12px;
    letter-spacing: 8px;
    background: #ffffff;
    padding: 0 10px;
    z-index: 2;
} */

/* Product value styling */

.versus-spec-value {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    word-wrap: break-word;
}

/* Multiline stripe styling for better Arabic text readability */
.spec-stripe-dark {
    color: #1a1a1a;
    font-weight: 500;
    display: inline-block;
    padding: 2px 0;
    line-height: 1.5;
}

.spec-stripe-light {
    color: #4a4a4a;
    font-weight: 400;
    display: inline-block;
    padding: 2px 0;
    line-height: 1.5;
}

.versus-spec-value br {
    margin-bottom: 3px;
}

/* Separator between multiline values */
.multiline-separator {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
    margin: 4px 0;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}

.no-data {
    color: #aaa;
    font-style: italic;
}

/* Update spec label styling for sticky positioning */

.versus-spec-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.versus-spec-icon {
    font-size: 20px;
    line-height: 1;
    margin-bottom: 4px;
}

.spec-text {
    font-size: 12px;
    font-weight: 500;
    color: #3b248a;
    text-align: center;
    line-height: 1.2;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet and larger screens */
@media (min-width: 768px) {
    .mobzella-versus-comparison {
        padding: 30px 20px;
    }

    .versus-products-header {
        margin-bottom: 40px;
    }

    .versus-products-track {
        gap: 20px;
    }

    .versus-product-column {
        min-width: clamp(280px, 45vw, 400px);
    }

    .versus-product-img {
        width: 150px;
        height: 150px;
    }

    .versus-product-title h3 {
        font-size: 18px;
    }

    .versus-spec-row {
        gap: 20px;
        padding: 15px 0;
    }

    .versus-spec-label-sticky {
        min-width: 140px;
        max-width: 160px;
        padding: 11px 16px;
    }

    .versus-product-value {
        min-width: clamp(240px, 42vw, 320px);
    }

    .versus-spec-value {
        font-size: 15px;
    }

    .spec-text {
        font-size: 13px;
    }

}

/* Desktop screens */
@media (min-width: 1024px) {
    .mobzella-versus-comparison {
        max-width: 100%;
        /* max-width: 1200px; */
        padding: 40px 30px;
    }

    .versus-products-track {
        gap: 25px;
    }

    .versus-product-column {
        min-width: clamp(320px, 30vw, 380px);
    }

    .versus-product-img {
        width: 180px;
        height: 180px;
    }

    .versus-spec-row {
        gap: 25px;
        padding: 15px 0;
    }

    .versus-spec-label-sticky {
        min-width: 160px;
        max-width: 180px;
        padding: 11px 16px;
    }

    .versus-product-value {
        min-width: clamp(280px, 28vw, 350px);
        padding: 10px 15px;
    }

    .versus-spec-value {
        font-size: 15px;
        text-align: center;
    }

    .spec-text {
        font-size: 13px;
    }

    .versus-spec-icon {
        font-size: 20px;
    }

}

/* ===== YES/NO FEATURES STYLING ===== */

.yes-no-feature {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13px;
    line-height: 1.3;
    transition: all 0.2s ease;
}

.yes-feature {
    background: rgba(34, 197, 94, 0.1);
    color: #629171;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.no-feature {
    background: rgba(239, 68, 68, 0.1);
    color: #9e6a6a;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Icon styling for different styles */
.yes-no-feature .icon-element{
    opacity: 0.5;
}
.yes-icon, .no-icon {
    font-style: normal;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
}

.yes-icon {
    color: #22c55e;
}

.no-icon {
    color: #ef4444;
}

/* Hover effects for better interactivity */
.yes-feature:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
}

.no-feature:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Responsive sizing for mobile */
@media (max-width: 767px) {
    .yes-no-feature {
        font-size: 12px;
        padding: 3px 6px;
        gap: 4px;
    }

    .yes-icon, .no-icon {
        font-size: 12px;
    }

    /* Mobile remove button sizing */
    .versus-remove-btn {
        width: 28px;
        height: 28px;
        font-size: 16px;
        top: 3px;
        right: 3px;
    }
}

/* Dark mode support (if theme supports it) */
@media (prefers-color-scheme: dark) {
    .yes-feature {
        background: rgba(34, 197, 94, 0.08);
        color: #61d089;
        border-color: rgba(34, 197, 94, 0.15);
    }

    .no-feature {
        background: rgb(239 68 68 / 8%);
        color: #ec8a8a;
        border-color: rgb(239 68 68 / 15%);
    }
}

/* ===== DEBUG STYLING ===== */

.versus-debug-message {
    padding: 20px;
    text-align: center;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    margin: 20px 0;
}

.versus-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
}

.versus-spec-row:not([data-spec*="release_date"]) .versus-spec-icon svg, .versus-spec-row .versus-spec-icon, .versus-spec-row .versus-spec-icon img{
    width: 40px;
    height: 40px;
    fill: #563cae;
}

.mobzella-versus-comparison {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    flex-direction: column;
    align-items: flex-start; /* Prevent flex stretching so child widths match their intrinsic content */
}

.mobzella-versus-comparison > div {
    flex: 0 0 auto;
}

body .re-search-result-thumb img {
    max-height: 55px;
}
body .re-search-result-info {
    min-height: 50px;
}
body .comp-search-input {
    font-size: 4vw;
}
body .comp-ajax-search-wrap.comp-ajax-search-overflow {
    max-height: initial;
    overflow-y: initial;
}
