/**
 * Comparison Feature Styles
 */

/* Card Button (Overlay on image) */
.js-add-to-compare {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0,0,0,0.1);
    color: #333;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.js-add-to-compare:hover {
    background: #fff;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.js-view-compare {
    position: absolute;
    top: 45px; /* Matches inline style, ensures CSS wins */
    right: 10px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    /* Removed opacity/transform transition for robustness */
    display: none; 
}

.js-view-compare:not(.is-hidden) {
    display: inline-flex !important;
    animation: hs-fade-in 0.2s ease forwards;
}

@keyframes hs-fade-in {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Global utility for JS toggling */
.is-hidden {
    display: none !important;
}

.js-add-to-compare.is-active {
    background: var(--hs-primary, #000);
    color: #fff;
    border-color: var(--hs-primary, #000);
}

/* Floating Bar */
#hs-comparison-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(0);
    background: #1a1a1a;
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

#hs-comparison-bar.is-hidden {
    transform: translateX(-50%) translateY(200%);
    pointer-events: none;
}

#hs-comparison-list {
    display: flex;
    gap: 0.5rem;
    margin-right: 0.5rem;
}

.hs-comp-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px; /* Square with slight radius */
    overflow: hidden;
    background: #333;
    border: 1px solid rgba(255,255,255,0.2);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 10px;
    font-weight: bold;
    position: relative;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hs-comp-thumb:hover {
    transform: translateY(-2px);
    border-color: #ff3b30; /* Red border on hover */
    z-index: 2;
}

.hs-comp-thumb::after {
    content: "×";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.hs-comp-thumb:hover::after {
    opacity: 1;
}

.hs-comp-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#hs-comparison-bar strong {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#hs-comparison-bar .hs-btn {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    border-radius: 999px;
}

#hs-comparison-clear {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

#hs-comparison-clear:hover {
    background: rgba(255,255,255,0.1);
}

/* Table Section Headers */
.hs-comp-section-header th {
    background: #f0f0f0;
    color: #111;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem 0.75rem;
    border: 1px solid var(--hs-border, #eee);
    border-bottom: 2px solid #ddd;
}
