/**
 * Murakumo - Design Aligned with My Comparison Table (v1.2.4)
 */

:root {
    --mct-primary-color: #3498db;
    --mct-secondary-color: #2c3e50;
    --mct-accent-color: #e74c3c;
    --mct-bg-color: #ffffff;
    --mct-text-color: #333333;
    --mct-border-color: #eeeeee;
    --mct-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    --mct-radius: 8px;
    --mct-transition: 0.3s ease;

    --rank-1-color: #FFD700;
    --rank-2-color: #C0C0C0;
    --rank-3-color: #CD7F32;
}

.murakumo-fe-wrap {
    max-width: 1000px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    line-height: 1.6;
    /* Unified Card Style */
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    /* Soft, deep shadow */
    border-radius: 24px;
    /* Large rounded corners */
    overflow: hidden;
    /* Clip children */
}

.murakumo-fe-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 2rem;
    text-align: center;
    color: var(--mct-secondary-color);
}

/* Controls Update - Aligned with Reference Page & Control Bar Concept */
/* Controls Update - Integrated Header */
.murakumo-fe-controls {
    margin-bottom: 0;
    padding: 24px;
    background: #f8fafc;
    /* Light gray header */
    border: none;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
    z-index: 2;
    border-radius: 0;
    /* Handled by wrap */
}

/* "Condition" Label */
.murakumo-fe-controls::before {
    content: '条件で絞り込み:';
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.murakumo-controls-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Common Pill Style */
/* Common Pill Style */
.murakumo-sort-item,
.mct-filter-item,
.mct-filter-reset-btn {
    border-radius: 50px;
    /* Pill Shape */
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    /* Minimal shadow */
    user-select: none;
}

/* Micro-interaction: Active Press */
.murakumo-sort-item:active,
.mct-filter-item:active,
.mct-filter-reset-btn:active {
    transform: scale(0.96);
}

/* Sort Section */
.murakumo-sort-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px dashed #e2e8f0;
    /* Separate sort from filters */
}

.murakumo-sort-header,
.murakumo-filter-header {
    display: none;
    /* Hide old labels, replaced by container label */
}

.murakumo-sort-options,
.mct-filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    flex: 1;
}

.murakumo-sort-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    padding: 8px 16px;
}

.murakumo-sort-item:hover {
    background: #fff;
    border-color: #cbd5e1;
    color: #334155;
    transform: translateY(-1px);
}

.murakumo-sort-item.active {
    background: #3b82f6;
    color: #fff;
    border: 1px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* Remove old underline effect */
.murakumo-sort-item::after {
    display: none;
}

/* Filter Section */
.murakumo-filter-section {
    /* No top border/padding needed here as sort has bottom border */
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.mct-filter-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    cursor: pointer;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.mct-filter-checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    inset: 0;
    z-index: 10;
}

.mct-filter-text {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Slightly wider gap */
    padding: 8px 16px;
    pointer-events: none;
}

/* Filter Icon (Plus / Check) */
.mct-filter-text::before {
    content: '+';
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #94a3b8;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s ease;
}

/* Active State: Checkmark */
.mct-filter-item:has(.mct-filter-checkbox:checked) .mct-filter-text::before {
    content: '✓';
    color: #fff;
    transform: scale(1.1);
}

.mct-filter-item:has(.mct-filter-checkbox:checked) {
    background: #3b82f6;
    color: #fff;
    border: 1px solid #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

.mct-filter-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.mct-filter-item:has(.mct-filter-checkbox:checked):hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* Reset Button */
/* Reset Button */
.mct-filter-reset-btn {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: auto;
}

.mct-filter-reset-btn::before {
    content: '↺';
    font-size: 14px;
}

.mct-filter-reset-btn:hover {
    background: #f1f5f9;
    color: #ef4444;
    border-color: #ef4444;
}

/* Table Animation Specifics */
.murakumo-fe-table tr {
    transition: opacity 0.4s ease, transform 0.4s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.murakumo-fe-table tr.filtering-out {
    opacity: 0;
    transform: scale(0.95);
    pointer-events: none;
}

.murakumo-fe-table tr.sorting-active {
    background-color: rgba(52, 152, 219, 0.05);
}

/* Product Badge (おすすめ) */
.mct-product-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 10;
    background-color: #FF4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 0 0 8px 0;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.mct-product-badge.color-red {
    background-color: #FF4757;
}

.mct-product-badge.color-gold {
    background-color: #FFD700;
    color: #333;
}

/* Highlighted Item */
.murakumo-fe-item.has-recommend-badge {
    border: 2px solid #FFD700 !important;
    /* Tighter shadow + inset glow to focus attention inward */
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.1) !important;
    background-color: #fffef9;
}

/* Ensure table columns also support this class if JS applies it */
.mct-product-column.has-recommend-badge,
.mct-product-column.has-highlight-badge {
    background: #fffef9;
    border: 2px solid #FFD700;
    /* Match highlight style */
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.4), inset 0 0 10px rgba(255, 215, 0, 0.1);
    position: relative;
    /* For badge positioning */
}

.mct-product-column.has-recommend-badge .mct-cell-name,
.mct-product-column.has-highlight-badge .mct-cell-name {
    color: #d4af37;
    font-weight: bold;
}

/* Specific adjustment for table rows which don't support border easily in all browsers */
.murakumo-fe-table tr.has-recommend-badge td {
    border-top: 2px solid #FFD700;
    border-bottom: 2px solid #FFD700;
}

.murakumo-fe-table tr.has-recommend-badge td:first-child {
    border-left: 2px solid #FFD700;
}

.murakumo-fe-table tr.has-recommend-badge td:last-child {
    border-right: 2px solid #FFD700;
}

/* Fix for Table Mobile Border Color Artifact */
@media (max-width: 768px) {
    .mct-product-column {
        border-color: #f0f0f0 !important;
    }
}

.murakumo-rank {
    position: relative;
    text-align: center;
}

/* Ranking Items (Grid Layout) */
/* Ranking Items (Integrated List Style) */
.murakumo-rank-card {
    display: grid;
    grid-template-columns: 60px 140px 1fr 180px;
    gap: 1.5rem;
    align-items: center;
    background: #fff;
    border: none;
    border-bottom: 1px solid #e2e8f0;
    /* Divider style */
    border-radius: 0;
    padding: 2rem;
    margin-bottom: 0;
    box-shadow: none;
    /* Removed individual shadow */
    transition: background-color 0.2s ease;
    position: relative;
}

.murakumo-rank-card:last-child {
    border-bottom: none;
}

.murakumo-rank-card:hover {
    background-color: #fafbfc;
    /* Subtle highlight */
    transform: none;
    /* No float */
}

/* Rank & Crown Section */
.murakumo-rank {
    text-align: center;
}

.mct-rank-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.mct-rank-crown {
    display: block;
    width: 32px;
    height: 32px;
    margin-bottom: 4px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.rank-1 .mct-rank-crown {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23FFD700"><path d="M5 16L3 5L8.5 10L12 4L15.5 10L21 5L19 16H5ZM19 19C19 19.5523 18.5523 20 18 20H6C5.44772 20 5 19.5523 5 19V18H19V19Z"></path></svg>');
}

.rank-2 .mct-rank-crown {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23C0C0C0"><path d="M5 16L3 5L8.5 10L12 4L15.5 10L21 5L19 16H5ZM19 19C19 19.5523 18.5523 20 18 20H6C5.44772 20 5 19.5523 5 19V18H19V19Z"></path></svg>');
}

.rank-3 .mct-rank-crown {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23CD7F32"><path d="M5 16L3 5L8.5 10L12 4L15.5 10L21 5L19 16H5ZM19 19C19 19.5523 18.5523 20 18 20H6C5.44772 20 5 19.5523 5 19V18H19V19Z"></path></svg>');
}

.mct-rank-num {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--mct-secondary-color);
}

/* Image Section */
.murakumo-img-wrap {
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fdfdfd;
    border-radius: 4px;
    overflow: hidden;
}

.murakumo-card-img,
.murakumo-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* Info Section */
.murakumo-card-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.murakumo-card-name {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--mct-secondary-color);
}

.murakumo-rating-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mct-stars {
    color: #f1c40f;
    font-size: 1.1rem;
    letter-spacing: 1px;
}

.mct-rating-num {
    font-weight: 800;
    font-size: 1rem;
}

.mct-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.mct-tag {
    background: #f0f4f8;
    color: #546e7a;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}

.murakumo-card-price {
    margin-top: 0.25rem;
}

.mct-price-val {
    font-size: 1.3rem;
    font-weight: 800;
    color: #e67e22;
}

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

/* Buttons Section */
.murakumo-card-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mct-btn {
    display: block;
    text-align: center;
    padding: 0.7rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all var(--mct-transition);
}

.mct-btn-det {
    background: #fff;
    border: 2px solid var(--mct-secondary-color);
    color: var(--mct-secondary-color);
}

.mct-btn-det:hover {
    background: var(--mct-secondary-color);
    color: #fff;
}

.mct-btn-aff {
    background: var(--mct-primary-color);
    border: 2px solid var(--mct-primary-color);
    color: #fff;
}

.mct-btn-aff:hover {
    background: #2980b9;
    border-color: #2980b9;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Table Style Alignment */
/* Table Style Alignment */
.murakumo-table-responsive {
    overflow-x: auto;
    border-radius: 0;
    /* Handled by wrap */
    box-shadow: none;
    /* Handled by wrap */
    border: none;
    background: #fff;
    margin-top: 0;
}

.murakumo-fe-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

.murakumo-fe-table th {
    background: #fff;
    /* White header */
    padding: 1.25rem 1rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    /* Muted text */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.murakumo-fe-table td {
    padding: 1.5rem 1rem;
    /* More whitespace */
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}

.murakumo-fe-table tr:last-child td {
    border-bottom: none;
}

.murakumo-fe-table .murakumo-img-cell {
    width: 100px;
}

.murakumo-fe-table .murakumo-img {
    width: 80px;
    max-width: 100%;
    height: 80px;
    object-fit: cover;
}

/* Animations */
.murakumo-fe-item {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.4s ease;
}

.murakumo-fe-item.hidden {
    opacity: 0;
    transform: scale(0.95);
    display: none;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .murakumo-rank-card {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
    }

    .murakumo-rank {
        position: absolute;
        top: 10px;
        left: 10px;
        z-index: 5;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .mct-rank-crown {
        width: 24px;
        height: 24px;
    }

    .murakumo-img-wrap {
        margin: 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 4/3;
    }

    .murakumo-rating-row,
    .mct-tags {
        justify-content: center;
    }

    .murakumo-card-buttons {
        width: 100%;
    }

    /* Mobile Sort & Filter Alignment */
    .murakumo-sort-options {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 5px;
        margin-right: -1.5rem;
        /* Bleed to edge */
        padding-right: 1.5rem;
    }

    .murakumo-sort-options::-webkit-scrollbar {
        display: none;
    }

    .murakumo-sort-item {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 10px 20px;
        /* Increase to match filter buttons */
    }

    /* Ensure Filter Buttons also have consistent padding if needed, but Sort was the main request */
    .mct-filter-text {
        padding: 10px 20px;
        white-space: nowrap;
        /* Prevent vertical layout */
    }

    /* Reduce shadow intensity on mobile */
    /* Unified List Style on Mobile */
    .murakumo-rank-card {
        box-shadow: none;
        border: none;
        border-bottom: 1px solid #e2e8f0;
        border-radius: 0;
        margin-bottom: 0;
    }

    .murakumo-rank-card:hover {
        transform: none;
        box-shadow: none;
    }

    /* Tone down "Recommend" glow on mobile */
    .murakumo-fe-item.has-recommend-badge {
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.15) !important;
    }

    /* Disable scale on table columns to prevent overlap on mobile */
    .mct-product-column.rank-1 {
        transform: none !important;
        z-index: 1;
        /* Reset z-index to avoid stacking issues */
    }
}

/* 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;
}

/* =========================================
   7. Improved Table Layout (Structure) - REMOVED for revert
   ========================================= */

.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;
    margin-top: -1px;
    /* Overlap border */
    border-top: none;
    border-radius: 0 0 12px 12px;
    /* Bottom rounded only */
}

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

.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;
    overflow-y: hidden;
    padding-top: 10px;
    /* Space for badges/shadows */
    /* Fix vertical movement */
    -webkit-overflow-scrolling: touch;
    background: #fff;
    scrollbar-width: thin;
    scrollbar-color: #DD2476 #f0f0f0;
}

.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%);
}

/* 3. Product Column */
.mct-product-column {
    flex: 0 0 240px;
    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;
}

.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;
    box-sizing: border-box;
    word-wrap: break-word;
    color: #444;
}

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

.mct-product-cell img {
    width: 120px;
    max-width: 100%;
    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%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.mct-product-cell-image-wrapper .mct-product-badge {
    top: 0;
    left: 0;
}

/* Rating visualization */
.mct-rating-container.my_comparison_rating {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0;
}

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

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

/* 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);
}

/* 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;
    }

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

    .mct-product-column {
        flex: 0 0 180px;
    }

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

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

    .mct-product-cell img {
        width: auto;
        max-width: 90%;
        max-height: 150px;
        object-fit: contain;
    }

    /* =========================================
   1. Sticky Header (Top Row)
   ========================================= */
    .mct-vertical-table-container {
        overflow: unset;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .mct-label-cell:first-child,
    .mct-product-cell:first-child {
        position: sticky;
        top: 0;
        z-index: 20;
        background: inherit;
        border-bottom: 2px solid #ddd;
    }

    .mct-labels-column .mct-label-cell:first-child {
        z-index: 30;
        background: #f8f9fa;
    }

    .mct-product-cell:first-child {
        background: #fff;
    }

    /* =========================================
   2. Horizontal Scroll Hint (Shadow)
   ========================================= */
    .mct-products-scroll-wrapper {
        background:
            linear-gradient(to right, #fff 30%, rgba(255, 255, 255, 0)),
            linear-gradient(to left, #fff 30%, rgba(255, 255, 255, 0)) 0 100%,
            radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)),
            radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0)) 0 100%;

        background-repeat: no-repeat;
        background-color: #fff;
        background-size: 40px 100%, 40px 100%, 14px 100%, 14px 100%;
        background-attachment: local, local, scroll, scroll;
    }

    /* =========================================
   3. Ranking Highlighting (Gold/Silver/Bronze)
   ========================================= */
    .mct-product-column.rank-1 {
        border: 2px solid #FFD700;
        background: linear-gradient(to bottom, #fffae6 0%, #ffffff 150px);
        position: relative;
        z-index: 5;
        transform: scale(1.02);
        box-shadow: 0 10px 40px rgba(255, 215, 0, 0.15);
    }

    .mct-product-column.rank-1 .mct-product-cell {
        border-bottom-color: rgba(255, 215, 0, 0.2);
    }

    .mct-product-column.rank-2 {
        border: 2px solid #C0C0C0;
        background: linear-gradient(to bottom, #f8f9fa 0%, #ffffff 100px);
    }

    .mct-product-column.rank-3 {
        border: 2px solid #CD7F32;
        background: linear-gradient(to bottom, #fff8f0 0%, #ffffff 100px);
    }

    /* =========================================
   4. Shine Effect for CTA
   ========================================= */
    .mct-btn-aff {
        position: relative;
        overflow: hidden;
    }

    .mct-btn-aff::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 50%;
        height: 100%;
        background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0) 100%);
        transform: skewX(-25deg);
        animation: shine-effect 3s infinite;
        pointer-events: none;
    }

    @keyframes shine-effect {
        0% {
            left: -100%;
        }

        20% {
            left: 200%;
        }

        100% {
            left: 200%;
        }
    }
}

/* =========================================
   Requirement B: Filter Horizontal Scroll
   ========================================= */
.mct-filter-tags {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding-right: 20px;
}

.mct-filter-tags::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

.mct-filter-item {
    flex-shrink: 0;
}


/* =========================================
   Mobile Optimization (max-width: 768px)
   ========================================= */
@media screen and (max-width: 768px) {

    /* Requirement A: Table Sticky Columns */
    .mct-vertical-table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .mct-labels-column {
        position: sticky;
        left: 0;
        z-index: 40;
        /* Higher than header row(20/30) */
        width: auto;
        min-width: unset;
        filter: drop-shadow(2px 0 5px rgba(0, 0, 0, 0.05));
    }

    .mct-product-column {
        min-width: 140px;
        /* Adjust as needed */
    }

    /* Fixed Row 1 (Rank) */
    .mct-labels-column .mct-label-cell:nth-child(1),
    .mct-product-column .mct-product-cell:nth-child(1) {
        /* Already sticky from previous styles, ensure z-index */
    }

    /* Requirement C: Compress Cell Padding */
    .mct-label-cell,
    .mct-product-cell {
        padding: 8px 4px !important;
        font-size: 13px !important;
    }

    /* Requirement E: Unified Image Aspect Ratio (Table) */
    .mct-product-cell img,
    .murakumo-card-img {
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }

    /* Requirement D: Lower Rank Compact View */
    .murakumo-rank-card.is-lower-rank {
        flex-direction: row !important;
        align-items: center;
        padding: 10px !important;
        gap: 10px;
        min-height: auto;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-img-wrap {
        width: 70px;
        height: 70px;
        flex: 0 0 70px;
        margin-bottom: 0;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-card-img {
        width: 100%;
        height: 100%;
        border-radius: 4px;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-card-info {
        flex: 1;
        padding: 0;
        text-align: left;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-card-name {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-rating-row {
        justify-content: flex-start;
        font-size: 12px;
    }

    .murakumo-rank-card.is-lower-rank .mct-tags {
        display: none;
        /* Optional: hide tags on compact view to save space */
    }

    .murakumo-rank-card.is-lower-rank .murakumo-card-price {
        font-size: 14px;
        margin-top: 4px;
        justify-content: flex-start;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-card-buttons {
        flex-direction: column;
        gap: 5px;
        flex: 0 0 90px;
    }

    .murakumo-rank-card.is-lower-rank .mct-btn {
        padding: 6px 10px;
        font-size: 11px;
        width: 100%;
    }

    .murakumo-rank-card.is-lower-rank .murakumo-rank {
        position: absolute;
        top: 5px;
        left: 5px;
        transform: scale(0.8);
        z-index: 10;
        border-radius: 50%;
        padding: 2px;
    }
}

/* =========================================
   Design Mode: Stylish (Apple-like)
   ========================================= */

/* Wrapper & Fonts */
.murakumo-mode-stylish {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    color: #1d1d1f;
}

.murakumo-mode-stylish .murakumo-fe-title {
    font-weight: 600;
    color: #1d1d1f;
}

/* -- Table Styles (Frontend Divs & Preview Table) -- */
.murakumo-mode-stylish .murakumo-fe-table {
    border-collapse: collapse;
}

/* Common Cell Styles for Divs and Table Cells */
.murakumo-mode-stylish .mct-label-cell,
.murakumo-mode-stylish .mct-product-cell,
.murakumo-mode-stylish .murakumo-fe-table th,
.murakumo-mode-stylish .murakumo-fe-table td {
    border: none;
    border-bottom: 1px solid #d2d2d7;
    /* Apple's separator color */
    background: transparent !important;
    /* Remove background colors */
    text-align: center;
    vertical-align: middle;
}

/* Header Row / Label Column specific */
.murakumo-mode-stylish .murakumo-fe-table thead th,
.murakumo-mode-stylish .mct-labels-column .mct-label-cell {
    border-bottom: 1px solid #d2d2d7;
    background: transparent;
    color: #86868b;
    font-weight: 600;
    font-size: 13px;
    padding-bottom: 15px;
}

/* Ensure column background is also transparent for frontend */
.murakumo-mode-stylish .mct-product-column {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Rank Column - Simple Number */
.murakumo-mode-stylish .mct-rank-wrap {
    background: none;
    width: auto;
    height: auto;
    color: #1d1d1f;
    font-size: 18px;
    font-weight: 600;
}

.murakumo-mode-stylish .mct-rank-crown {
    display: none;
}

.murakumo-mode-stylish .mct-rank-num {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

/* Image - Larger */
.murakumo-mode-stylish .murakumo-img-wrap {
    background: transparent;
    border: none;
}

.murakumo-mode-stylish .mct-product-cell img,
.murakumo-mode-stylish .murakumo-card-img {
    max-width: 120px;
    /* Larger */
    transition: transform 0.4s ease;
}

.murakumo-mode-stylish .mct-product-cell img:hover,
.murakumo-mode-stylish .murakumo-card-img:hover {
    transform: scale(1.05);
}

/* Text & Specs */
.murakumo-mode-stylish .murakumo-card-name,
.murakumo-mode-stylish .mct-name-text {
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.murakumo-mode-stylish .mct-tags,
.murakumo-mode-stylish .mct-tags-container {
    justify-content: center;
    display: flex;
    gap: 5px;
}

.murakumo-mode-stylish .mct-tag,
.murakumo-mode-stylish .mct-table-tag {
    background: #f5f5f7;
    color: #1d1d1f;
    border: none;
    font-size: 11px;
    padding: 4px 10px;
}

/* Buttons */
.murakumo-mode-stylish .murakumo-card-buttons,
.murakumo-mode-stylish .mct-table-buttons {
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* CTA: Apple Blue Pill */
.murakumo-mode-stylish .mct-btn-aff,
.murakumo-mode-stylish .mct-table-btn-affiliate {
    background: #0071e3 !important;
    color: #fff !important;
    border-radius: 980px !important;
    /* Pill shape */
    padding: 8px 16px !important;
    font-size: 14px;
    font-weight: 400;
    min-width: 100px;
    box-shadow: none !important;
    transition: all 0.2s ease;
    border: none !important;
    display: inline-block;
    text-decoration: none;
}

.murakumo-mode-stylish .mct-btn-aff:hover,
.murakumo-mode-stylish .mct-table-btn-affiliate:hover {
    background: #0077ed !important;
    transform: none;
    box-shadow: none;
}

.murakumo-mode-stylish .mct-btn-aff::after,
.murakumo-mode-stylish .mct-table-btn-affiliate::after {
    display: none;
    /* Remove shine effect */
}

/* Detail Link: Text Link */
.murakumo-mode-stylish .mct-btn-det,
.murakumo-mode-stylish .mct-table-btn-detail {
    background: transparent !important;
    border: none !important;
    color: #0071e3 !important;
    padding: 0;
    font-size: 13px;
    box-shadow: none !important;
}

.murakumo-mode-stylish .mct-btn-det:hover,
.murakumo-mode-stylish .mct-table-btn-detail:hover {
    text-decoration: underline;
    background: transparent !important;
    color: #0071e3 !important;
}

/* -- Mobile Adjustments for Stylish Mode -- */
@media screen and (max-width: 768px) {
    .murakumo-mode-stylish .mct-labels-column {
        background: rgba(255, 255, 255, 0.95) !important;
        /* Slight backdrop for sticky */
        backdrop-filter: blur(10px);
        border-right: 1px solid #d2d2d7;
    }
}