/* Premium Comparison Table Styling - Transposed (Products as Columns) */
.mct-product-table-wrapper {
    margin: 2rem 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.mct-vertical-table-container {
    display: flex;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
    overflow: hidden;
    max-width: 100%;
    position: relative;
    /* For scroll hint shadow */
}

/* 1. Labels Column (Fixed on the left) */
.mct-labels-column {
    flex: 0 0 160px;
    /* Fixed width for labels */
    background: #f8f9fa;
    border-right: 2px solid #eee;
    z-index: 10;
}

.mct-label-cell {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    /* Shared height with product cells */
    box-sizing: border-box;
}

.mct-label-cell:last-child {
    border-bottom: none;
}

/* 2. Products Scroll Wrapper */
.mct-products-scroll-wrapper {
    flex: 1;
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #DD2476 #f0f0f0;
}

/* Custom Scrollbar for Webkit */
.mct-products-scroll-wrapper::-webkit-scrollbar {
    height: 8px;
}

.mct-products-scroll-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.mct-products-scroll-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, #FF512F 0%, #DD2476 100%);
    border-radius: 10px;
}

.mct-products-scroll-wrapper::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(90deg, #e64929 0%, #c7206a 100%);
}

/* Scroll Hint Shadow */
.mct-vertical-table-container::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(0, 0, 0, 0.1));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 15;
}

.mct-vertical-table-container.has-scroll-right::after {
    opacity: 1;
}

/* 3. Product Column */
.mct-product-column {
    flex: 0 0 240px;
    /* Width of each product column */
    border-right: 1px solid #f0f0f0;
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        width 0.3s ease,
        flex-basis 0.3s ease,
        margin 0.3s ease,
        padding 0.3s ease;
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: scale(1);
    overflow: hidden;
}

.mct-product-column.filtering-out {
    opacity: 0;
    transform: scale(0);
    flex-basis: 0;
    width: 0;
    margin: 0;
    padding: 0;
    border-right-width: 0;
    pointer-events: none;
}

/* FLIP animation state */
.mct-product-column.is-sorting {
    transition: none !important;
    z-index: 10;
}

.mct-product-column {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.4s ease,
        width 0.4s ease,
        flex-basis 0.4s ease,
        margin 0.4s ease,
        padding 0.4s ease;
}

/* FLIP animation state */
.mct-product-column.is-sorting {
    transition: none !important;
    z-index: 10;
}

.mct-product-column:hover {
    background: #fff;
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
    z-index: 5;
}

.mct-product-column:last-child {
    border-right: none;
}

.mct-product-cell {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 100px;
    /* Shared height with labels */
    box-sizing: border-box;
    word-wrap: break-word;
    color: #444;
}

.mct-product-cell:last-child {
    border-bottom: none;
}

/* Vertical Sticky Header within Column */
/* If we want the top cell (image/name) to stay top when scrolling vertically? 
   The user asked for horizontal transposition, so labels are on the left.
   Vertical stickiness would apply to the labels and all products' top cells. */
/* Specific Cell Visuals */
.mct-product-cell img {
    max-width: 120px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

.mct-no-image {
    padding: 20px;
    background: #f5f5f5;
    color: #999;
    border-radius: 8px;
    font-size: 0.8rem;
}

.mct-price-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1a1a1a;
}

/* 商品バッジとハイライト（テーブル用） */
.mct-product-column.has-highlight-badge {
    background: rgba(255, 215, 0, 0.03);
}

.mct-product-column.has-highlight-badge .mct-cell-name {
    color: #d4af37;
}

.mct-product-cell-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

.mct-product-cell-image-wrapper .mct-product-badge {
    position: absolute;
    top: -5px;
    left: -5px;
    z-index: 20;
    background: #ff4757;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    pointer-events: none;
}

.mct-product-cell-image-wrapper .mct-product-badge.color-red {
    background: #ff4757;
}

.mct-product-cell-image-wrapper .mct-product-badge.color-gold {
    background: #ffa502;
}

.mct-product-cell-image-wrapper .mct-product-badge.color-blue {
    background: #3742fa;
}

.mct-product-cell-image-wrapper .mct-product-badge.color-green {
    background: #2ed573;
}

.mct-tax-note {
    font-size: 0.75rem;
    color: #999;
    margin-left: 2px;
}

/* Rating visualization */
/* Rating visualization (Aligned with ranking card) */
.mct-rating-container.my_comparison_rating {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0;
    /* Centered in cell */
}

.mct-rating-container .my_comparison_star {
    font-size: 1.1rem;
    line-height: 1;
}

.mct-rating-container .my_comparison_btn_affiliate:hover {
    background: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.my_comparison_btn:active {
    transform: translateY(-1px) scale(0.97);
}

.mct-rating-container .my_comparison_rating_value {
    font-size: 1rem;
    color: #444;
}

.rating-num {
    font-size: 0.9rem;
    font-weight: 800;
    color: #333;
}

/* Tags */
.mct-tags-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

.mct-table-tag {
    display: inline-block;
    background: #f0f4f8;
    color: #546e7a;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Buttons */
.mct-table-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    align-items: center;
}

.mct-table-btn {
    display: inline-block;
    width: 100%;
    max-width: 160px;
    padding: 0.7rem 1rem;
    border-radius: 50px;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    text-align: center;
    box-sizing: border-box;
}

.mct-table-btn-affiliate {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: #fff !important;
    box-shadow: 0 4px 15px rgba(221, 36, 118, 0.2);
}

.mct-table-btn-affiliate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(221, 36, 118, 0.3);
}

.mct-table-btn-detail {
    background: #fff;
    color: #2271B1 !important;
    border: 1px solid #2271B1;
}

.mct-table-btn-detail:hover {
    background: #f0f7ff;
    transform: translateY(-4px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}

.mct-table-btn:active {
    transform: translateY(-1px) scale(0.96);
}

/* Filter Bar */
.mct-table-filter-bar {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.mct-filter-label {
    font-weight: 800;
    font-size: 0.95rem;
    color: #1a1a1a;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mct-filter-label .dashicons {
    color: #DD2476;
    font-size: 18px;
}

.mct-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.mct-filter-item {
    cursor: pointer;
    position: relative;
    user-select: none;
}

.mct-filter-item input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.mct-filter-text {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    transition: all 0.2s ease;
}

.mct-filter-item input:checked+.mct-filter-text {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.2);
}

.mct-filter-reset-btn {
    margin-left: auto;
    background: #f1f3f5;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #868e96;
    cursor: pointer;
}

/* Cell Height Adjustments for specific columns */
.mct-cell-image {
    min-height: 160px;
}

.mct-cell-button {
    min-height: 140px;
}

.mct-cell-tags {
    min-height: 120px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mct-labels-column {
        flex: 0 0 90px;
        /* Reduced width */
    }

    .mct-label-cell {
        padding: 0.8rem 0.4rem;
        font-size: 0.75rem;
        line-height: 1.2;
    }

    .mct-product-column {
        flex: 0 0 180px;
        /* Slightly narrower to show next column */
    }

    .mct-label-cell,
    .mct-product-cell {
        padding: 1rem 0.5rem;
        font-size: 0.8rem;
    }

    .mct-cell-image {
        min-height: 140px;
    }

    .mct-product-cell img {
        max-width: 80px;
    }
}