/* ==========================================
   Global Variables & Reset
   ========================================== */
:root {
    --fcs-primary: #00b521;
    --fcs-primary-hover: #007f16;
    --fcs-bg-muted: #f8fafc;
    --fcs-border: #D3D3D3;
    --fcs-icon-color: #1e293b;
    --fcs-text: #1e293b;
    --fcs-text-light: #64748b;
    --fcs-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.fcs-comparison-page {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--fcs-text);
    line-height: 1.5;
}

/* Compare Buttons (Frontend) */
.fcs-compare-btn {
    border: 1px solid var(--fcs-border);
    background: #fff;
    padding: 10px;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    color: #094F3A;
}

.fcs-compare-btn:hover {
    background: var(--fcs-bg-muted);
    border-color: var(--fcs-primary);
    color: var(--fcs-primary);
    transform: translateY(-2px);
    box-shadow: var(--fcs-shadow);
}

.fcs-compare-btn.active {
    background: var(--fcs-primary);
    color: #fff;
    border-color: var(--fcs-primary);
}

.fcs-compare-btn svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
}

/* Header Count Badge */
.fcs-header-comparison {
    position: relative;
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: #fff !important;
}

.fcs-header-comparison .fcs-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ff4d4d;
    color: #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}



/* ==========================================
   CSS Flex/Grid Responsive Matrix Page
   ========================================== */
.fcs-comparison-matrix-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.fcs-comparison-matrix {
    display: grid;
    /* Set flexible width for product columns */
    grid-template-columns: repeat(var(--product-count, 4), minmax(200px, 1fr));
    grid-template-rows: repeat(calc(var(--row-count, 10) + 1), auto);
    /* Ensure matrix does not exceed container width */
    min-width: 100%;
    width: 100%;
    box-sizing: border-box;
    column-gap: 8px;
}

.fcs-comparison-product-column {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: 1 / span calc(var(--row-count, 10) + 1);
    min-width: 180px;
    padding: 0 12px;
    border: 1px solid #dee2e6;
    /* Ensure it participates correctly in grid subgrid */
}

.fcs-matrix-cell {
    padding: 12px 0;
    gap: 4px;
    font-size: 14px;
    background: #ffffff;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}
.fcs-matrix-cell.border-top:first-child {
    border-top: none !important;
}

.fcs-matrix-header-cell, .fcs-matrix-value-cell {
    scroll-snap-align: start;
}

/* .fcs-matrix-corner-cell {
    position: sticky;
    top: 0;
    z-index: 25;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.fcs-matrix-header-cell {
    position: sticky;
    top: 0;
    z-index: 15;
    background: #fff;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
} */

.fcs-matrix-label-cell {
    background: #ffffff;
    font-weight: bold;
    color: var(--fcs-text-light);
}

.fcs-matrix-value-cell {
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.fcs-attributes-lable {
    font-weight: 400;
    color: #777777;
}

.fcs-attributes-value {
    color: #333333;
    font-weight: 700;
}

.fcs-attributes-value .custom-price-block {
    min-height: unset;
    flex-direction: row;
    align-items: center;
    gap: 5px;
}

/* Identical & Differences Styling */
.fcs-row-identical.unchecked {
    display: none !important;
}

/* Portrait Image Switcher inside Header Cell */
.fcs-product-image {
    width: 100%;
    max-width: 192px;
    aspect-ratio: 2/3;
    margin-bottom: 12px;
    overflow: hidden;
}

.fcs-product-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.fcs-main-image-display {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: opacity 0.2s ease-in-out;
}

/* Alternate Switcher gallery thumbnails */
.fcs-thumb-selector {
    display: flex;
    justify-content: center;
}

.fcs-thumb-item {
    width: 32px;
    height: 32px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: all 0.2s ease;
}

.fcs-thumb-item:hover, .fcs-thumb-item.active {
    border-color: #094F3A;
    transform: scale(1.05);
}

/* Empty Page msg */
.fcs-empty-msg {
    text-align: center;
    padding: 80px 20px;
    color: var(--fcs-text-light);
    font-size: 18px;
}

/* Responsive Swiper sticky cells labels overrides */
@media (max-width: 768px) {
    .fcs-comparison-matrix {
        grid-template-columns: repeat(var(--product-count, 4), minmax(200px, 1fr));
    }
    .fcs-matrix-cell {
        padding: 12px 0;
        font-size: 14px;
    }
    .fcs-matrix-header-cell {
        padding: 12px 0;
    }
    .fcs-comparison-product-column .card-title a {
        font-size: 16px;
    }
}


