/* ---------- Shared toast (used by compare, reusable elsewhere) ---------- */
.tf-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1f2933;
    color: #fff;
    padding: 10px 20px;
    border-radius: 24px;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .2);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    z-index: 2100;
    max-width: 90vw;
    text-align: center;
}

    .tf-toast.show {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
        pointer-events: auto;
    }

/* =========================================================================
   Compare tray — floating bottom bar, slides in once >=1 item is compared
   ========================================================================= */
.tf-compare-tray {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1500;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, .12);
    transform: translateY(110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .32s cubic-bezier(.22, 1, .36, 1), opacity .32s ease;
}

    .tf-compare-tray.is-visible {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

.tf-compare-tray-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.tf-compare-tray-items {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

    .tf-compare-tray-items::-webkit-scrollbar {
        display: none;
    }

.tf-compare-tray-item {
    position: relative;
    flex: 0 0 auto;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    overflow: hidden;
    background: #e5e7eb;
    border: 1px solid #e5e7eb;
    animation: tfCompareItemIn .25s ease;
}

    .tf-compare-tray-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

.tf-compare-tray-item-remove {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #e11d48;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

@keyframes tfCompareItemIn {
    from {
        transform: scale(.7);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.tf-compare-tray-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    white-space: nowrap;
}

.tf-compare-tray-count {
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
}

.tf-compare-tray-clear {
    border: 0;
    background: none;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
}

    .tf-compare-tray-clear:hover {
        color: #daa520;
    }

.tf-compare-tray-cta {
    border: 0;
    background: #2563eb;
    color: #fff;
    border-radius: 22px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .35);
}

    .tf-compare-tray-cta:hover {
        background: #1d4ed8;
    }

@media (max-width: 576px) {
    .tf-compare-tray-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .tf-compare-tray-count {
        display: none;
    }

    .tf-compare-tray-cta {
        padding: 9px 14px;
        font-size: 12.5px;
    }
}

/* =========================================================================
   Compare overlay — custom backdrop + slide-up panel (no Bootstrap modal)
   ========================================================================= */
.tf-compare-overlay {
    position: fixed;
    inset: 0;
    z-index: 1600;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
}

    .tf-compare-overlay.is-open {
        visibility: visible;
    }

.tf-compare-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    opacity: 0;
    transition: opacity .3s ease;
}

.tf-compare-overlay.is-open .tf-compare-overlay-backdrop {
    opacity: 1;
}

.tf-compare-panel {
    position: relative;
    width: 100%;
    max-width: 1400px;
    max-height: 88vh;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, .2);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform .35s cubic-bezier(.22, 1, .36, 1);
}

.tf-compare-overlay.is-open .tf-compare-panel {
    transform: translateY(0);
}

@media (min-width: 992px) {
    .tf-compare-panel {
        max-width: 96vw;
    }
}

.tf-compare-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

    .tf-compare-panel-header h2 {
        font-size: 17px;
        font-weight: 700;
        margin: 0;
        color: #1f2933;
    }

#compareOverlayCount {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.tf-compare-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

    .tf-compare-panel-close:hover {
        background: #f3f4f6;
        color: #1f2933;
    }

.tf-compare-panel-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.tf-compare-panel-footer {
    padding: 14px 22px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

.tf-compare-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    color: #6b7280;
}

    .tf-compare-empty svg {
        width: 40px;
        height: 40px;
        margin-bottom: 12px;
        color: #9ca3af;
    }

    .tf-compare-empty p {
        margin: 0;
        font-size: 14px;
        max-width: 380px;
    }

.tf-compare-table-wrap {
    overflow-x: auto;
}

.tf-compare-table {
    width: 100%;
    border-collapse: collapse;
}

    .tf-compare-table th,
    .tf-compare-table td {
        border: 1px solid #e5e7eb;
        padding: 14px 20px;
        font-size: 14.5px;
        vertical-align: top;
        min-width: 260px;
    }

    .tf-compare-table th {
        text-align: left;
        background: #f9fafb;
        color: #6b7280;
        font-weight: 600;
        white-space: nowrap;
        min-width: 140px;
        position: sticky;
        left: 0;
        z-index: 2;
        box-shadow: 2px 0 4px rgba(0, 0, 0, .06);
    }

    .tf-compare-table .tf-compare-head-row th,
    .tf-compare-table .tf-compare-head-row td {
        background: #fff;
        border-bottom: 2px solid #e5e7eb;
    }

.tf-compare-col-head {
    position: relative;
    text-align: center;
}

    .tf-compare-col-head a {
        display: block;
        text-decoration: none;
        color: inherit;
    }

    .tf-compare-col-head img {
        width: 100%;
        max-width: 220px;
        height: 160px;
        object-fit: cover;
        border-radius: 8px;
        margin: 0 auto 10px;
        display: block;
        background: #e5e7eb;
    }

.tf-compare-col-name {
    font-size: 14px;
    font-weight: 700;
    color: #1f2933;
    line-height: 1.35;
}

.tf-compare-remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #e11d48;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .tf-compare-remove-btn:hover {
        background: #fef2f2;
    }

.tf-compare-clear-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    border-radius: 20px;
    padding: 9px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .tf-compare-clear-btn:hover {
        border-color: #daa520;
        color: #daa520;
        background: #fdf8ec;
    }

@media (max-width: 576px) {
    .tf-compare-panel {
        max-height: 92vh;
    }

    .tf-compare-panel-header {
        padding: 14px 16px;
    }

    .tf-compare-panel-body {
        padding: 14px 16px;
    }

    .tf-compare-panel-footer {
        padding: 12px 16px;
    }

    .tf-compare-table th,
    .tf-compare-table td {
        padding: 8px 12px;
        font-size: 12.5px;
        min-width: 180px;
    }

    .tf-compare-table th {
        min-width: 100px;
    }
}
