/* Styling for the Comparison Tool */

/* --- States Controlled by JavaScript --- */
.comparison-tool-active .desktop-comparison-sidebar-block,
.comparison-tool-active #mobile-comparison-bar {
    transform: translate(0, 0);
}

/* UPDATED: Changed from # to . */
.desktop-compare-btn.disabled,
#mobile-compare-btn.disabled {
    background-color: #d1d5db;
    /* gray-300 */
    cursor: not-allowed;
    pointer-events: none;
}

.desktop-compare-btn {
    margin-top: 5px;
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 300ms;
    border-radius: var(--rounded-lg);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    width: 100%;
    color: #ffffff;
    display: block;
    text-align: center;
    background-color: var(--color-600);
}

@media (max-width: 48em) {
    .device-sidebar #comparison-tool-container {
        display: none;
    }
}

.device-sidebar #comparison-tool-container {
    padding: 0.75rem;
    border-radius: 0.5rem;
    background-color: #fff;
    margin: 0;
    margin-bottom: 2rem;
    min-height: 220px;
}

.desktop-comparison-sidebar-block .desktop-comparison-slots-block {
    min-height: 100px;
    display: flex;
    gap: 5px;
    flex-direction: column;
}

#desktop-comparison-sidebar .empty-slot-desktop {
    border: 2px dashed #dedede;
}

/* --- Desktop Sidebar Styles --- */
#desktop-comparison-sidebar .comparison-slot-img {
    margin-right: 5px;
}

/* --- Mobile Sticky Bar Styles --- */

.compare-block {
    display: none;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: #fff;
    margin-bottom: 2.5rem;
    min-height: 200px;
}

#mobile-comparison-bar .mobile-comparison-bar-inner {
    flex-direction: column;
    justify-content: flex-start;
    /* Hide scrollbar for a cleaner look */
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

#mobile-comparison-slots {
    flex-direction: column;
    flex: 1;
    min-height: 100%;
}

#mobile-comparison-bar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, and Opera */
}

/* Mobile slot styling */
#mobile-comparison-slots .comparison-slot {
    flex-shrink: 0;
    gap: 10px;
    width: 100%;

}

#mobile-comparison-slots .empty-slot-mobile {
    flex-shrink: 0;
    gap: 5px;
    width: 100%;
    height: 44px;
    padding: 0.5rem;
    border: 2px dashed #dedede;
}

#mobile-comparison-slots .comparison-slot img {
    margin-right: 5px;
}

.comparison-slot button i {
    margin-top: 4px;
    line-height: normal;
}

.comparison-slot button {
    margin-bottom: 0;
    padding: 12px;
}

#mobile-comparison-bar #mobile-compare-btn {
    max-width: 140px;
    margin-right: auto;
    margin-left: auto;
}

/* --- NEW: Dynamic Button State --- */
.add-to-compare-btn.is-added {
    border: 1px solid #065f46;
    background-color: #d1fae554;
    color: #065f46;
    cursor: default;
    pointer-events: none;
}


/* --- NEW: Toast Notification Styles --- */
.toast-notification {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
        0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateX(100%);
    opacity: 0;
    animation: toast-slide-in 0.5s forwards;
    position: fixed;
    z-index: 9999;
    top: 5rem;
    right: 1rem;
    max-width: 360px;
    width: auto;
    background-color: rgba(0, 0, 0, 0.40);
    font-size: 1.125rem;
    font-weight: normal;
    flex-shrink: 0;
}

.toast-notification.is-fading-out {
    animation: toast-fade-out 0.5s forwards;
}

.toast-notification.is-error {
    background-color: #c53030;
    /* red-700 */
}

.toast-notification i {
    font-size: 1.25rem;
    flex-shrink: 0;
    color: yellow;
}

/* Slide in from right to its final position */
@keyframes toast-slide-in {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Fade out and slightly move up */
@keyframes toast-fade-out {
    to {
        opacity: 0;
        transform: translateX(0) translateY(-10px);
    }
}

/* Container for the text with truncation */
.toast-notification .note-text {
    font-size: 0.875rem;
    /* sm */
    line-height: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 240px;
    /* Adjust based on icon + padding */
    flex-shrink: 1;
}

/* Responsive: Adjust on small screens */
@media (max-width: 480px) {
    .toast-notification {
        max-width: calc(100vw - 2rem);
        right: 0.5rem;
        left: auto;
        width: auto;
    }

    .toast-notification .note-text {
        max-width: calc(100vw - 70px);
        /* Adjust based on icon + spacing */
        font-size: 0.8125rem;
        /* Slightly smaller on mobile */
    }

    .toast-notification i {
        font-size: 1rem;
    }
}