/* =========================================================================
   AGL Directory — comparison.css
   Comparison tray, fixed to bottom
   ========================================================================= */

.agl-compare {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 90;
    pointer-events: none;
}
/* Default hidden — both the HTML5 hidden attribute and an explicit empty-state class.
   The JS toggles `hidden` once the user adds anything to compare. */
.agl-compare,
.agl-compare[hidden],
.agl-compare.is-empty { display: none; }
.agl-compare:not([hidden]):not(.is-empty) { display: block; }

.agl-compare-tab {
    pointer-events: auto;
    position: absolute;
    bottom: 100%;
    right: 32px;
    background: var(--accent-violet);
    color: #fff;
    border: 0;
    border-radius: 8px 8px 0 0;
    padding: 10px 20px;
    cursor: pointer;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
}
.agl-compare-tab:hover { background: #6b1fe8; }
.agl-compare-count {
    display: inline-block;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 999px;
    padding: 1px 8px;
    margin-left: 6px;
    font-size: 12px;
}

.agl-compare-panel {
    position: relative;
    pointer-events: auto;
    background: rgba(13, 13, 26, 0.98);
    backdrop-filter: blur(14px);
    border-top: 1px solid rgba(123, 47, 255, 0.4);
    padding: 20px 32px;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform .25s ease;
}
.agl-compare-panel::before {
    content: "";
    position: absolute;
    top: -1px; left: 0; right: 0;
    height: 2px;
    background: var(--gradient-spectrum);
    pointer-events: none;
}
.agl-compare.is-open .agl-compare-panel { transform: translateY(0); }

.agl-compare-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.agl-compare-head h3 { margin: 0; font-size: 16px; }
.agl-compare-clear {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-family: inherit;
}
.agl-compare-clear:hover { color: var(--accent-red); }

.agl-compare-slots {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}
@media (max-width: 720px) {
    .agl-compare-slots { grid-template-columns: 1fr; }
    .agl-compare-panel { padding: 16px; }
    .agl-compare-tab { right: 16px; }
}

.agl-compare-slot {
    background: var(--bg-card);
    border: var(--border-card);
    border-radius: var(--radius-card);
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    min-height: 64px;
}
.agl-compare-slot--empty {
    border-style: dashed;
    color: var(--text-secondary);
    font-size: 13px;
    justify-content: center;
}
.agl-compare-slot img { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.agl-compare-slot-body { flex: 1; min-width: 0; }
.agl-compare-slot-title { font-size: 13px; margin: 0; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.agl-compare-slot-title a { color: var(--text-primary); }
.agl-compare-slot-remove {
    background: transparent;
    border: 0;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    padding: 0;
    line-height: 1;
}
.agl-compare-slot-remove:hover { color: var(--accent-red); }
.agl-compare-slot-affiliate {
    margin-left: auto;
    font-size: 11px;
    color: var(--accent-green);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.agl-compare-specs {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.agl-compare-specs th, .agl-compare-specs td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(123, 47, 255, 0.15);
}
.agl-compare-specs thead th { color: var(--text-secondary); font-weight: 500; font-size: 12px; }
.agl-compare-specs tbody th { color: var(--text-secondary); font-weight: 500; width: 100px; }

@media (max-width: 720px) {
    .agl-compare-specs thead { display: none; }
    .agl-compare-specs, .agl-compare-specs tbody, .agl-compare-specs tr, .agl-compare-specs td, .agl-compare-specs th { display: block; width: 100%; }
    .agl-compare-specs tr { border: 1px solid rgba(123, 47, 255, 0.18); border-radius: 6px; margin-bottom: 8px; padding: 8px; }
    .agl-compare-specs td:empty, .agl-compare-specs td:has(:empty) { display: none; }
}

/* Compare button toggle state on cards */
.agl-compare-add.is-added {
    background: var(--accent-violet);
    color: #fff;
    border-color: var(--accent-violet);
}

/* Toast confirming compare add */
.agl-compare-toast {
    position: fixed;
    left: 50%;
    bottom: 120px;
    transform: translate(-50%, 20px);
    z-index: 95;
    background: var(--accent-green);
    color: #000;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    padding: 12px 20px;
    border-radius: 999px;
    box-shadow: 0 8px 32px rgba(57, 255, 20, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.agl-compare-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}
@media (max-width: 720px) {
    .agl-compare-toast { bottom: 96px; font-size: 12px; padding: 10px 16px; max-width: 90vw; text-align: center; }
}
