/* =============================================================
   COMPARE PAGE — coerente con FAQ / Contatti
   ============================================================= */

@keyframes compareFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Hero stats ──────────────────────────────────────────── */
.compare-hero-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.compare-hero-stat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 20px;
    min-width: 90px;
    text-align: center;
}

.compare-hero-stat strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}

.compare-hero-stat span {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.45);
    font-weight: 600;
}

.compare-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 12px 18px;
    background: rgba(224, 32, 32, 0.1);
    border: 1px solid rgba(224, 32, 32, 0.35);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
}

.compare-clear-btn:hover {
    background: var(--primary, #e02020);
    border-color: var(--primary, #e02020);
    color: #fff;
}

/* ─── Body ────────────────────────────────────────────────── */
.compare-body {
    background: var(--dark-2, #161a20);
    padding: 2.5rem 0 4rem;
    min-height: 55vh;
    animation: compareFadeIn 0.5s ease-out;
}

.compare-container {
    max-width: 1380px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ─── Alert ───────────────────────────────────────────────── */
.compare-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    margin-bottom: 1.5rem;
    border-radius: 10px;
    background: rgba(37, 211, 102, 0.1);
    border: 1px solid rgba(37, 211, 102, 0.3);
    color: #86efac;
    font-size: 0.9rem;
}

/* ─── Slots bar ───────────────────────────────────────────── */
.compare-slots {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.25rem;
}

.compare-slot {
    flex: 1;
    height: 4px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.08);
    max-width: 120px;
    transition: background 0.3s;
}

.compare-slot--filled {
    background: var(--primary, #e02020);
}

.compare-slots__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-left: 8px;
    white-space: nowrap;
}

/* ─── Toolbar ─────────────────────────────────────────────── */
.compare-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 1.25rem;
}

.compare-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.65);
    user-select: none;
}

.compare-diff-toggle input { display: none; }

.compare-diff-toggle__track {
    width: 40px;
    height: 22px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    transition: all 0.25s;
}

.compare-diff-toggle__track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transition: transform 0.25s;
}

.compare-diff-toggle input:checked + .compare-diff-toggle__track {
    background: rgba(224, 32, 32, 0.25);
    border-color: rgba(224, 32, 32, 0.5);
}

.compare-diff-toggle input:checked + .compare-diff-toggle__track::after {
    transform: translateX(18px);
    background: var(--primary, #e02020);
}

.compare-add-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none !important;
    transition: all 0.2s;
}

.compare-add-more:hover {
    border-color: rgba(224, 32, 32, 0.4);
    color: #fff !important;
    background: rgba(224, 32, 32, 0.08);
}

/* ─── Empty state ─────────────────────────────────────────── */
.compare-empty {
    background: linear-gradient(135deg, var(--dark-3, #1e2430) 0%, rgba(224, 32, 32, 0.06) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.compare-empty__icon {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.25);
}

.compare-empty__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
}

.compare-empty__text {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
    max-width: 420px;
    line-height: 1.6;
}

.compare-empty__steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0.5rem 0;
    text-align: left;
    max-width: 380px;
    width: 100%;
}

.compare-empty__step {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

.compare-empty__step-num {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(224, 32, 32, 0.15);
    border: 1px solid rgba(224, 32, 32, 0.3);
    color: var(--primary, #e02020);
    font-size: 0.78rem;
    font-weight: 800;
}

.compare-empty__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary, #e02020);
    color: #fff !important;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0.8rem 1.75rem;
    border-radius: 10px;
    text-decoration: none !important;
    margin-top: 0.5rem;
    transition: all 0.25s;
}

.compare-empty__cta:hover {
    background: var(--primary-hover, #c81a1a);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(224, 32, 32, 0.35);
}

/* ─── Table ───────────────────────────────────────────────── */
.compare-table-wrap {
    background: var(--dark-3, #1e2430);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 700px;
}

.compare-table thead th {
    padding: 0;
    vertical-align: bottom;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.compare-table thead th:last-child { border-right: none; }

.compare-table__label-col {
    width: 170px;
    min-width: 140px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
    padding: 1.25rem 1rem !important;
    text-align: left;
    vertical-align: bottom;
    position: sticky;
    left: 0;
    z-index: 2;
}

.compare-label-header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.35);
}

/* ─── Product card (header) ───────────────────────────────── */
.compare-product-card {
    padding: 2.75rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0.55rem;
    text-align: center;
    position: relative;
    min-width: 170px;
    min-height: 268px;
    height: 100%;
    box-sizing: border-box;
}

.compare-best-badge {
    position: absolute;
    top: 0.85rem;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(37, 211, 102, 0.15);
    border: 1px solid rgba(37, 211, 102, 0.35);
    color: #86efac;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    z-index: 1;
}

.compare-best-badge--sm {
    font-size: 0.62rem;
    padding: 3px 8px;
    margin-bottom: 4px;
}

.compare-product-card__image {
    width: 96px;
    height: 96px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: border-color 0.2s;
    text-decoration: none !important;
}

.compare-product-card__image:hover {
    border-color: rgba(224, 32, 32, 0.4);
}

.compare-product-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.compare-product-card__name {
    font-size: 0.85rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none !important;
    transition: color 0.2s;
    min-height: 2.7em;
    width: 100%;
}

.compare-product-card__name:hover { color: var(--primary, #e02020); }

.compare-product-card__price {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    align-content: center;
    gap: 4px 6px;
    min-height: 2.75rem;
    width: 100%;
}

.compare-price--regular,
.compare-price--sale {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.compare-price--regular { font-size: 1.2rem; color: #fff; }
.compare-price--sale    { font-size: 1.2rem; color: var(--primary, #e02020); }

.compare-price--old {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.35);
    text-decoration: line-through;
}

.compare-price--badge {
    font-size: 0.68rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(224, 32, 32, 0.2);
    color: #fca5a5;
}

.compare-product-card__actions {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
    justify-content: center;
    margin-top: 0;
    width: 100%;
}

.compare-btn-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    background: var(--primary, #e02020);
    color: #fff;
    border: none;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.compare-btn-cart:hover {
    background: var(--primary-hover, #c81a1a);
    transform: translateY(-1px);
}

.compare-btn-cart--block { width: 100%; padding: 0.7rem; font-size: 0.85rem; }

.compare-btn-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: rgba(224, 32, 32, 0.1);
    border: 1px solid rgba(224, 32, 32, 0.3);
    color: #fca5a5;
    text-decoration: none !important;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.compare-btn-remove:hover {
    background: var(--primary, #e02020);
    border-color: var(--primary, #e02020);
    color: #fff;
}

/* ─── Empty slot ──────────────────────────────────────────── */
.compare-slot-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-height: 268px;
    height: 100%;
    min-width: 170px;
    padding: 1rem 1.5rem 1.5rem;
    box-sizing: border-box;
    color: rgba(255, 255, 255, 0.35) !important;
    text-decoration: none !important;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin: 1rem;
    transition: all 0.2s;
    font-size: 0.82rem;
    font-weight: 600;
}

.compare-slot-empty i { font-size: 1.5rem; }

.compare-slot-empty:hover {
    border-color: rgba(224, 32, 32, 0.35);
    color: rgba(255, 255, 255, 0.7) !important;
    background: rgba(224, 32, 32, 0.05);
}

.compare-slot-cell {
    color: rgba(255, 255, 255, 0.15) !important;
    background: rgba(0, 0, 0, 0.1);
}

/* ─── Table body ──────────────────────────────────────────── */
.compare-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s;
}

.compare-table tbody tr:last-child { border-bottom: none; }

.compare-table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }

.compare-table tbody tr.compare-row--diff {
    background: rgba(224, 32, 32, 0.04);
}

.compare-table tbody tr.compare-row--diff:hover {
    background: rgba(224, 32, 32, 0.07);
}

.compare-table tbody tr.compare-row--highlight td:first-child {
    color: var(--primary, #e02020);
}

.compare-table tbody td:first-child {
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.65rem 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    white-space: nowrap;
    text-align: left;
    position: sticky;
    left: 0;
    z-index: 1;
}

.compare-table tbody td:first-child i {
    margin-right: 6px;
    color: rgba(224, 32, 32, 0.6);
}

.compare-table tbody td {
    padding: 0.75rem 1.1rem;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
    vertical-align: bottom;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}



.compare-table tbody td:last-child { border-right: none; }

.compare-table tbody tr[hidden] { display: none; }

/* ─── Badges ──────────────────────────────────────────────── */
.compare-badge--stock {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(37, 211, 102, 0.12);
    color: #86efac;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    border: 1px solid rgba(37, 211, 102, 0.25);
}

.compare-badge--soon {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: rgba(251, 191, 36, 0.1);
    color: #fcd34d;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    border: 1px solid rgba(251, 191, 36, 0.25);
}

.compare-badge--universal {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(59, 130, 246, 0.12);
    color: #93c5fd;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.3rem 0.7rem;
    border-radius: 99px;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.compare-badge--specific {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.45);
}

.compare-mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.2rem 0.55rem;
    border-radius: 4px;
    display: inline-block;
}

.compare-rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 700;
    color: #fcd34d;
}

.compare-rating i { font-size: 0.75rem; }
.compare-rating small { color: rgba(255, 255, 255, 0.4); font-weight: 500; }

/* ─── Mobile cards ────────────────────────────────────────── */
.compare-mobile { display: none; }

.compare-mobile-card {
    background: linear-gradient(135deg, var(--dark-3, #1e2430) 0%, rgba(224, 32, 32, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.compare-mobile-card__header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.compare-mobile-card__image {
    width: 72px;
    height: 72px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.compare-mobile-card__image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.compare-mobile-card__info { flex: 1; min-width: 0; }

.compare-mobile-card__name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none !important;
    line-height: 1.35;
    margin-bottom: 6px;
}

.compare-mobile-card__remove {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(224, 32, 32, 0.1);
    border: 1px solid rgba(224, 32, 32, 0.25);
    color: #fca5a5;
    text-decoration: none !important;
    font-size: 0.85rem;
}

.compare-mobile-card__specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 0 0 1rem;
}

.compare-mobile-spec dt {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.35);
    margin-bottom: 3px;
}

.compare-mobile-spec dd {
    margin: 0;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 500;
}

.compare-mobile-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1.5rem;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.4) !important;
    text-decoration: none !important;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.compare-mobile-add:hover {
    border-color: rgba(224, 32, 32, 0.35);
    color: #fff !important;
}

/* ─── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
    .compare-table-wrap--desktop { display: none; }
    .compare-mobile { display: block; }
    .compare-toolbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 768px) {
    .compare-container { padding: 0 1rem; }
    .compare-body { padding: 1.5rem 0 3rem; }
    .compare-hero-stats { width: 100%; }
    .compare-hero-stat { flex: 1; }
    .compare-empty { padding: 3rem 1.25rem; }
    .compare-mobile-card__specs { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .compare-slots { flex-wrap: wrap; }
    .compare-slot { max-width: none; }
    .compare-slots__label { width: 100%; margin-left: 0; margin-top: 4px; }
}