/**
 * ANE Product Compare — Styles
 * Follows ui-ux-pro-max: 60-30-10 rule, ANE brand tokens
 */

/* Compare button on product cards */
.ane-compare-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-family: Inter, system-ui, sans-serif;
    font-weight: 500;
    color: var(--color-primary, #415097);
    background: rgba(255,255,255,0.92);
    border: 1px solid var(--color-primary, #415097);
    border-radius: 4px;
    cursor: pointer;
    z-index: 5;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}
.ane-compare-btn:hover {
    background: var(--color-primary, #415097);
    color: #fff;
}
.ane-compare-btn.active {
    background: var(--color-primary, #415097);
    color: #fff;
    border-color: var(--color-primary, #415097);
}

/* Floating compare bar */
#ane-compare-bar {
    position: fixed;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    transition: bottom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#ane-compare-bar.visible { bottom: 20px; }

.ane-compare-bar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    background: rgba(10, 10, 20, 0.92);
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    backdrop-filter: blur(12px);
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
}
.ane-compare-bar-actions { display: flex; gap: 8px; }
#ane-compare-go {
    padding: 8px 20px;
    background: var(--color-cta, #f27131);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s;
}
#ane-compare-go:disabled { opacity: 0.4; cursor: not-allowed; }
#ane-compare-go:not(:disabled):hover { filter: brightness(1.1); }
#ane-compare-clear {
    padding: 8px 12px;
    background: transparent;
    color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
#ane-compare-clear:hover { color: #fff; border-color: rgba(255,255,255,0.5); }

/* Modal */
#ane-compare-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
}
#ane-compare-modal.visible { display: flex; align-items: center; justify-content: center; }
.ane-compare-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
}
.ane-compare-content {
    position: relative;
    width: 90vw;
    max-width: 960px;
    max-height: 85vh;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 64px rgba(0,0,0,0.3);
    animation: compareSlideUp 0.3s ease-out;
}
@keyframes compareSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.ane-compare-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    z-index: 5;
    line-height: 1;
}
.ane-compare-close:hover { color: #000; }
.ane-compare-body { overflow-x: auto; overflow-y: auto; max-height: 80vh; }

/* Loading */
.ane-compare-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 3rem;
    color: #888;
    font-family: Inter, system-ui, sans-serif;
}
.ane-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: var(--color-primary, #415097);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Comparison table */
.ane-compare-table-wrap { padding: 24px; }
.ane-compare-table {
    width: 100%;
    border-collapse: collapse;
    font-family: Inter, system-ui, sans-serif;
    font-size: 14px;
}
.ane-compare-table th,
.ane-compare-table td {
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}
.ane-compare-label {
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    width: 160px;
    background: #fafafa;
}
.ane-compare-product-header {
    text-align: center;
    padding: 20px 12px;
    background: #fafafa;
}
.ane-compare-product-header img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 8px;
}
.ane-compare-product-header h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
    line-height: 1.3;
}
.ane-compare-cta {
    display: inline-block;
    padding: 6px 16px;
    background: var(--color-cta, #f27131);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: filter 0.2s;
}
.ane-compare-cta:hover { filter: brightness(1.1); color: #fff; }
.ane-compare-diff { background: rgba(242, 113, 49, 0.05); }
.ane-compare-diff td:not(.ane-compare-label) { font-weight: 500; }

/* Mobile */
@media (max-width: 768px) {
    .ane-compare-bar-inner { padding: 10px 16px; font-size: 12px; }
    .ane-compare-content { width: 95vw; max-height: 90vh; }
    .ane-compare-table-wrap { padding: 12px; }
    .ane-compare-label { width: 100px; font-size: 12px; }
    .ane-compare-product-header img { width: 80px; height: 80px; }
}
