/* Comparison Manager - pubblico */
.oc-container { width: min(1120px, 92%); margin: 0 auto; }
.oc-hero {
    position: relative;
    background: linear-gradient(135deg, #1a2332 0%, #2c3e50 55%, #1f6f5b 100%);
    color: #fff;
    padding: 4.5rem 0 3.5rem;
    overflow: hidden;
}
.oc-hero-inner {
    width: min(1120px, 92%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2rem;
    align-items: center;
}
.oc-hero-copy h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; margin: 0 0 0.75rem; }
.oc-hero-sub { opacity: 0.9; font-size: 1.1rem; margin-bottom: 1.5rem; }
.oc-hero-vs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.5rem;
    align-items: center;
    min-height: 180px;
}
.oc-hero-panel {
    display: block;
    height: 180px;
    border-radius: 12px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
}
.oc-hero-panel-a { background: linear-gradient(160deg, rgba(255,255,255,0.2), rgba(46, 204, 113, 0.25)); }
.oc-hero-panel-b { background: linear-gradient(200deg, rgba(255,255,255,0.2), rgba(52, 152, 219, 0.25)); }
.oc-vs-badge, .oc-sticky-vs, .oc-vs-mini {
    font-weight: 800;
    letter-spacing: 0.04em;
}
.oc-vs-badge {
    width: 48px; height: 48px; border-radius: 50%;
    display: grid; place-items: center;
    background: #fff; color: #1a2332; font-size: 0.85rem;
}
.oc-btn {
    display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 8px; padding: 0.85rem 1.4rem;
    font-weight: 700; text-decoration: none; cursor: pointer;
}
.oc-btn-primary { background: #1f6f5b; color: #fff; }
.oc-btn-primary:hover { background: #185a4a; color: #fff; }
.oc-btn-sm { padding: 0.55rem 0.9rem; font-size: 0.9rem; }
.oc-section { padding: 3rem 0; }
.oc-section-sub { color: #5b6573; margin-bottom: 1.5rem; }
.oc-popular-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}
.oc-popular-card {
    display: block;
    border: 1px solid #e6e9ee;
    border-radius: 12px;
    padding: 1rem 0.85rem;
    text-decoration: none;
    color: inherit;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.oc-popular-card:hover { box-shadow: 0 10px 24px rgba(26,35,50,0.08); transform: translateY(-2px); }
.oc-popular-pair {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.35rem;
    align-items: start;
    position: relative;
}
.oc-popular-pair::before {
    content: "";
    position: absolute;
    top: 0.25rem;
    bottom: 0.25rem;
    left: 50%;
    width: 1px;
    background: #e6e9ee;
    transform: translateX(-50%);
    pointer-events: none;
}
.oc-popular-side {
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    text-align: center;
    min-width: 0;
    padding: 0 0.25rem;
}
.oc-popular-side img {
    width: 100%;
    max-width: 140px;
    height: 72px;
    object-fit: contain;
    margin-top: 0.35rem;
}
.oc-popular-title {
    font-size: 0.95rem;
    line-height: 1.25;
    font-weight: 700;
    word-break: break-word;
}
.oc-vs-mini {
    align-self: center;
    z-index: 1;
    background: #fff;
    color: #6b7280;
    font-size: 0.72rem;
    padding: 0.15rem 0.2rem;
}
.oc-start-form {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 1rem;
    align-items: end;
    background: #f6f8fa;
    border-radius: 14px;
    padding: 1.25rem;
}
.oc-combo-wrap label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.oc-combo { position: relative; }
.oc-combo-panel {
    position: fixed;
    z-index: 10050;
    max-height: 260px;
    overflow: auto;
    background: #fff;
    border: 1px solid #d7dde5;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.12);
    display: none;
}
.oc-combo-panel.is-open { display: block !important; }
.oc-combo-option,
.dbb-combo-option {
    display: block;
    width: 100%;
    text-align: left;
    border: 0;
    background: #fff;
    padding: 0.65rem 0.8rem;
    cursor: pointer;
}
.oc-combo-option.is-active,
.oc-combo-option:hover,
.dbb-combo-option.is-active,
.dbb-combo-option:hover { background: #eef6f3; }
.oc-combo-empty,
.dbb-combo-empty { padding: 0.75rem; color: #6b7280; }
.oc-form-hint { grid-column: 1 / -1; color: #b45309; margin: 0; }
.oc-compare-sticky {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e6e9ee;
    padding: 0.85rem 0;
}
.oc-sticky-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0.75rem;
    align-items: center;
}
.oc-sticky-card {
    display: grid;
    gap: 0.2rem;
    justify-items: center;
    text-align: center;
    min-width: 0;
}
.oc-sticky-card img { max-height: 64px; width: auto; max-width: 100%; object-fit: contain; }
.oc-sticky-card h2 {
    font-size: 1rem;
    margin: 0;
    line-height: 1.25;
    word-break: break-word;
}
.oc-brand {
    margin: 0;
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}
.oc-link { font-size: 0.85rem; }
.oc-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}
.oc-detail-title { font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; }
.oc-toggle { display: inline-flex; gap: 0.5rem; align-items: center; font-weight: 600; }
.oc-param-section { margin-bottom: 2rem; }
.oc-param-section h2 {
    font-size: 1.15rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid #1f6f5b;
}
.oc-compare-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed;
}
.oc-compare-table th,
.oc-compare-table td {
    border-bottom: 1px solid #eef1f4;
    padding: 0.75rem 0.6rem;
    vertical-align: top;
    word-break: break-word;
}
.oc-compare-table thead th {
    background: #f6f8fa;
    font-size: 0.85rem;
}
.oc-compare-table col.oc-col-label { width: 34%; }
.oc-compare-table col.oc-col-a,
.oc-compare-table col.oc-col-b { width: 33%; }
.oc-compare-table tr.is-diff td { background: #fff9ef; }
.oc-compare-table td.is-better { font-weight: 700; color: #145c4a; }
.oc-badge-better {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.7rem;
    background: #d8f3eb;
    color: #145c4a;
    border-radius: 999px;
    padding: 0.1rem 0.45rem;
    vertical-align: middle;
}
.oc-unit { color: #6b7280; font-weight: 400; }
.oc-verdict {
    background: #f3faf7;
    border-left: 4px solid #1f6f5b;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 2rem 0;
}
.oc-related ul { padding-left: 1.1rem; }
.oc-empty { color: #6b7280; }
.oc-hub-diff-only .oc-compare-table tr.is-same,
body.oc-diff-only .oc-compare-table tr.is-same { display: none; }
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    border: 0;
}

/* Mobile: confronto SEMPRE a due colonne (come DriveK) */
@media (max-width: 768px) {
    .oc-hero-inner {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    .oc-hero-vs {
        grid-template-columns: 1fr auto 1fr;
        min-height: 110px;
    }
    .oc-hero-panel { height: 100px; }
    .oc-start-form {
        grid-template-columns: 1fr;
    }
    .oc-popular-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    .oc-popular-card { padding: 0.85rem 0.5rem; }
    .oc-popular-pair {
        grid-template-columns: 1fr auto 1fr !important;
    }
    .oc-popular-side img {
        height: 56px;
        max-width: 110px;
    }
    .oc-popular-title { font-size: 0.82rem; }
    .oc-brand { font-size: 0.68rem; }

    /* Sticky header A | VS | B sempre affiancati */
    .oc-sticky-grid {
        grid-template-columns: 1fr auto 1fr !important;
        gap: 0.35rem;
    }
    .oc-sticky-card img { max-height: 44px; }
    .oc-sticky-card h2 { font-size: 0.82rem; }
    .oc-sticky-card .oc-link,
    .oc-sticky-card .oc-btn { display: none; }
    .oc-sticky-vs { font-size: 0.75rem; }

    .oc-toolbar { margin-bottom: 1rem; }
    .oc-detail-title { font-size: 1.15rem; }

    /* Tabella: etichetta a tutta larghezza, valori A|B sempre affiancati */
    .oc-compare-table thead { display: none; }
    .oc-compare-table,
    .oc-compare-table tbody {
        display: block;
        width: 100%;
    }
    .oc-compare-table tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.15rem 0.5rem;
        padding: 0.7rem 0;
        border-bottom: 1px solid #eef1f4;
        align-items: start;
    }
    .oc-compare-table th[scope="row"] {
        grid-column: 1 / -1;
        border: 0;
        padding: 0 0 0.25rem;
        font-size: 0.8rem;
        color: #5b6573;
        font-weight: 600;
    }
    .oc-compare-table td {
        border: 0;
        padding: 0.15rem 0;
        font-size: 0.9rem;
        text-align: center;
    }
    .oc-badge-better {
        display: block;
        margin: 0.2rem auto 0;
        width: fit-content;
    }
}

@media (max-width: 420px) {
    .oc-container { width: min(1120px, 94%); }
    .oc-sticky-card h2 { font-size: 0.75rem; }
    .oc-popular-title { font-size: 0.76rem; }
    .oc-compare-table td { font-size: 0.82rem; }
}
