: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;
}

.my_comparison_wrapper {
    max-width: 100%;
    margin: 2rem 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: var(--mct-text-color);
}

/* Controls */
.my_comparison_controls {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fdfdfd;
    border: 1px solid var(--mct-border-color);
    border-radius: var(--mct-radius);
}

.my_comparison_category_tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.my_comparison_category_tab {
    padding: 0.6rem 1.2rem;
    background: #f8f9fa;
    border: 1px solid var(--mct-border-color);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #495057;
    cursor: pointer;
    transition: all var(--mct-transition);
}

.my_comparison_category_tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #fff;
    border-color: #bfdbfe;
}

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

.my_comparison_category_tab.active {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.2);
}

.my_comparison_sort {
    display: flex;
    gap: 0.5rem;
}

.my_comparison_sort_btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    background: #fff;
    border: 1px solid var(--mct-border-color);
    border-radius: 50px;
    color: #495057;
    cursor: pointer;
    transition: all var(--mct-transition);
}

.my_comparison_sort_btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #bfdbfe;
}

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

.my_comparison_sort_btn.active {
    background: linear-gradient(135deg, #FF512F 0%, #DD2476 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 10px rgba(221, 36, 118, 0.2);
}

/* Items */
.my_comparison_container {
    display: grid;
    gap: 1.5rem;
}

.my_comparison_item {
    display: grid;
    grid-template-columns: 60px 140px 1fr auto;
    gap: 1.5rem;
    align-items: center;
    background: var(--mct-bg-color);
    border: 1px solid var(--mct-border-color);
    border-radius: var(--mct-radius);
    padding: 1.5rem;
    box-shadow: var(--mct-shadow);
    transition:
        opacity 0.3s ease,
        transform 0.3s ease,
        max-height 0.3s ease,
        margin 0.3s ease,
        padding 0.3s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
    max-height: 1000px;
    /* Large enough for content */
}

.my_comparison_item {
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1),
        opacity 0.4s ease,
        max-height 0.4s ease,
        margin 0.4s ease,
        padding 0.4s ease,
        box-shadow 0.3s ease,
        border-color 0.3s ease;
}

.my_comparison_item.filtering-out {
    opacity: 0;
    transform: scale(0);
    max-height: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
    pointer-events: none;
}

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

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

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

.my_comparison_item:active {
    transform: translateY(-2px) scale(0.99);
}

/* Rank section */
.my_comparison_rank {
    text-align: center;
}

.my_comparison_rank_crown {
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.my_comparison_rank_1 .my_comparison_rank_crown {
    content: 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>');
}

.my_comparison_rank_2 .my_comparison_rank_crown {
    content: 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>');
}

.my_comparison_rank_3 .my_comparison_rank_crown {
    content: 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>');
}

.my_comparison_rank_number {
    display: block;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--mct-secondary-color);
}

/* Image section */
/* 商品バッジとハイライト */
.my_comparison_item.has-highlight-badge {
    border: 2px solid #ffd700;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.2);
}

.my_comparison_image {
    position: relative;
    width: 120px;
    height: 120px;
    flex-shrink: 0;
    display: flex;
    /* Added from original */
    align-items: center;
    /* Added from original */
    justify-content: center;
    /* Added from original */
    background: #fdfdfd;
    border-radius: 8px;
    overflow: hidden;
    /* バッジのはみ出しを制御 */
}

.mct-product-badge {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    /* Increased to be above rank on mobile */
    background: #ff4757;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-bottom-right-radius: 8px;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
    pointer-events: none;
}

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

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

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

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

.my_comparison_image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.my_comparison_no_image {
    color: #ccc;
    font-size: 0.8rem;
}

/* Info section */
.my_comparison_info {
    flex-grow: 1;
}

.my_comparison_name {
    margin: 0 0 0.75rem 0;
    font-size: 1.25rem;
    color: var(--mct-secondary-color);
}

.my_comparison_rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.my_comparison_star {
    color: #f1c40f;
    font-size: 1.2rem;
}

/* Catchphrase */
.my_comparison_catchphrase {
    font-size: 13px;
    color: #888;
    margin-bottom: 5px;
}

/* Points */
.my_comparison_points {
    background: #fdfdfd;
    padding: 15px;
    border-top: 1px dashed #eee;
    margin: 15px 0;
}

.my_comparison_points h4 {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #333;
    display: flex;
    align-items: center;
}

.my_comparison_points h4 .dashicons {
    margin-right: 5px;
    color: #ff4757;
}

.my_comparison_points ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.my_comparison_points li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
    line-height: 1.4;
}

.my_comparison_points li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #ff4757;
    font-weight: bold;
}

/* Spec Grid */
.my_comparison_spec_grid {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #74c3e1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 20px;
}

.my_comparison_spec_item {
    flex: 0 0 50%;
    /* 2 items per row */
    display: flex;
    border-bottom: 1px solid #74c3e1;
}

.my_comparison_spec_item:nth-last-child(-n+2) {
    border-bottom: none;
}

/* For single item last row */
.my_comparison_spec_item:last-child:nth-child(odd) {
    flex: 0 0 100%;
}

.my_comparison_spec_label {
    flex: 0 0 40%;
    background: #74c3e1;
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my_comparison_spec_value {
    flex: 1;
    background: #fff;
    padding: 8px 10px;
    font-size: 13px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-left: 1px solid #74c3e1;
}

@media (max-width: 600px) {
    .my_comparison_spec_item {
        flex: 0 0 100%;
    }

    .my_comparison_spec_item:nth-last-child(2) {
        border-bottom: 1px solid #74c3e1;
    }
}

.my_comparison_star_empty {
    color: #ddd;
}

.my_comparison_rating_value {
    font-weight: bold;
    font-size: 1.1rem;
}

.my_comparison_price {
    margin-bottom: 0.75rem;
}

.my_comparison_price_value {
    font-size: 1.3rem;
    font-weight: bold;
    color: #e67e22;
}

.my_comparison_price_tax {
    font-size: 0.8rem;
    color: #888;
}

.my_comparison_tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.my_comparison_filter_item {
    cursor: pointer;
    position: relative;
    user-select: none;
    display: inline-block;
}

.my_comparison_filter_checkbox {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.my_comparison_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;
}

.my_comparison_filter_checkbox:checked+.my_comparison_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);
}

.my_comparison_tag {
    background: #f0f4f8;
    color: #546e7a;
    padding: 0.2rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* Buttons section */
.my_comparison_buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 180px;
}

.my_comparison_btn {
    text-align: center;
    padding: 0.8rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all var(--mct-transition);
}

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

.my_comparison_btn_detail:hover {
    background: var(--mct-secondary-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

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

/* Responsive */
@media (max-width: 768px) {
    .my_comparison_item {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1.5rem;
    }

    .my_comparison_rank {
        position: absolute;
        top: 8px;
        /* Slightly adjusted */
        left: 8px;
        /* Slightly adjusted */
        z-index: 10;
        background: rgba(255, 255, 255, 0.9);
        padding: 5px;
        border-radius: 4px;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .my_comparison_image {
        margin: 0 auto;
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .my_comparison_rating {
        justify-content: center;
    }

    .my_comparison_tags {
        justify-content: center;
    }

    .my_comparison_buttons {
        width: 100%;
    }
}