/* «Порівняння» (compare.html): products side by side, characteristics below. The page header and
   breadcrumbs come from privacy.css; the first column stays put while the table scrolls sideways. */

.cmp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.cmp-tabs[hidden] { display: none; }
.cmp-tab {
    display: inline-flex; align-items: center; border: 1px solid var(--border-light); border-radius: 999px;
    background: #fff; color: var(--text-main); transition: 0.2s;
}
.cmp-tab button { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; }
.cmp-tab-main { display: inline-flex; align-items: flex-start; gap: 4px; padding: 9px 4px 9px 16px; font-size: 14px; line-height: 1.2; }
.cmp-tab-main sup { font-size: 11px; color: var(--text-secondary); }
.cmp-tab-x {
    width: 26px; height: 26px; margin-right: 6px; border-radius: 50%; font-size: 11px !important; color: var(--text-muted) !important;
    display: inline-flex; align-items: center; justify-content: center;
}
.cmp-tab.is-active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cmp-tab.is-active .cmp-tab-main { font-weight: 600; }
.cmp-tab.is-active .cmp-tab-main sup { color: var(--accent); }
@media (hover: hover) and (pointer: fine) {
    .cmp-tab:not(.is-active):hover { border-color: var(--accent); }
    .cmp-tab-x:hover { background: rgba(0, 0, 0, 0.07); color: var(--danger) !important; }
}
.cmp-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.cmp-toolbar[hidden], .cmp-scroll[hidden], .cmp-empty[hidden] { display: none; }
.cmp-diff { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-main); cursor: pointer; }
.cmp-diff input { width: 16px; height: 16px; accent-color: var(--accent); }
.cmp-clear { background: none; border: 0; padding: 6px 0; font-size: 14px; color: var(--text-secondary); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
@media (hover: hover) and (pointer: fine) { .cmp-clear:hover { color: var(--danger); } }

.cmp-scroll { overflow-x: auto; border: 1px solid var(--border-light); border-radius: 12px; background: #fff; }
.cmp-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 640px; table-layout: fixed; }
.cmp-table th, .cmp-table td { padding: 14px 16px; text-align: left; vertical-align: top; font-size: 14px; line-height: 1.5; border-bottom: 1px solid var(--border-light); }
.cmp-table tr:last-child th, .cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table th.cmp-label {
    position: sticky; left: 0; z-index: 2; width: 170px; background: var(--bg-soft); color: var(--text-secondary); font-weight: 500;
}
.cmp-table td { color: var(--text-main); border-left: 1px solid var(--border-light); word-break: break-word; }
.cmp-table tr.cmp-same td { color: var(--text-secondary); }

.cmp-prod { position: relative; display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.cmp-remove {
    position: absolute; top: -4px; right: -6px; width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--border-light); background: #fff; color: var(--text-secondary); cursor: pointer; font-size: 12px; z-index: 1;
}
@media (hover: hover) and (pointer: fine) { .cmp-remove:hover { color: var(--danger); border-color: var(--danger); } }
.cmp-photo { display: block; aspect-ratio: 1 / 1; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.cmp-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cmp-name { color: var(--text-main); font-weight: 500; font-size: 14px; line-height: 1.4; text-decoration: none; }
@media (hover: hover) and (pointer: fine) { .cmp-name:hover { color: var(--accent); } }
.cmp-price { font-size: 20px; font-weight: 600; color: var(--navy); }
.cmp-price small { font-size: 12px; font-weight: 400; color: var(--text-secondary); margin-left: 4px; }
.cmp-price s { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--text-muted); }
.cmp-stock { font-size: 13px; }
.cmp-stock.in { color: var(--success); }
.cmp-stock.out { color: var(--danger); }
.cmp-buy {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px;
    border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 14px; font-weight: 500; cursor: pointer;
}
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-actions > button { flex: 1 1 150px; }
.cmp-quick {
    display: inline-flex; align-items: center; justify-content: center; height: 40px; padding: 0 14px;
    border: 1px solid var(--border-strong, var(--border-light)); border-radius: 8px; background: #fff; color: var(--text-main); font-size: 14px; font-weight: 500; cursor: pointer;
}
@media (hover: hover) and (pointer: fine) { .cmp-quick:hover { border-color: var(--accent); color: var(--accent); } }
.cmp-buy:disabled { opacity: 0.5; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) { .cmp-buy:not(:disabled):hover { background: var(--accent-hover, var(--accent)); filter: brightness(1.08); } }

.cmp-table td.cmp-wait-cell { vertical-align: middle; background: var(--bg-soft); }
.cmp-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 280px; margin: 0 auto; padding: 24px 12px; text-align: center; color: var(--text-secondary); font-size: 14px; line-height: 1.5; }
.cmp-wait b { font-size: 16px; font-weight: 500; color: var(--text-main); }
.cmp-wait-plus { width: 52px; height: 52px; border-radius: 50%; border: 2px dashed var(--border-strong, var(--border-light)); display: inline-flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 18px; }
.cmp-wait a { margin-top: 6px; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.cmp-empty { max-width: 520px; padding: 40px 0; color: var(--text-secondary); font-size: 15px; line-height: 1.6; }
.cmp-empty-title { font-size: 19px; font-weight: 500; color: var(--text-main); margin-bottom: 8px; }
.cmp-empty-btn {
    display: inline-block; margin-top: 18px; padding: 12px 20px; border-radius: 8px; background: var(--accent); color: #fff; text-decoration: none; font-weight: 500;
}

@media (max-width: 700px) {
    .cmp-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; position: relative; }
    .cmp-tabs::-webkit-scrollbar { display: none; }
    .cmp-tab { flex-shrink: 0; white-space: nowrap; }
}


/* ---- phone: Horoshop-like columns ---- */
.cmp-phone { display: none; }
@media (max-width: 700px) {
    .cmp-toolbar, .cmp-scroll { display: none !important; }
    .cmp-phone { display: block; }
}
.cmp-phone .cmp-m-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.cmp-m-link { display: inline-flex; align-items: center; gap: 8px; padding: 6px 0; border: 0; background: none; color: var(--accent); font-size: 15px; cursor: pointer; }
.cmp-m-link i { font-size: 15px; }
.cmp-m-scroll { margin: 0 -16px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.cmp-m-scroll::-webkit-scrollbar { display: none; }
.cmp-m-grid { display: flex; flex-direction: column; min-width: 100%; width: max-content; padding: 0 8px; box-sizing: border-box; }
.cmp-m-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(40vw, calc(50vw - 8px)); }
.cmp-m-cell { padding: 12px 8px; font-size: 14px; line-height: 1.4; color: var(--text-main); word-break: break-word; }
.cmp-m-pill {
    position: sticky; left: 8px; width: calc(100vw - 20px); box-sizing: border-box; margin: 4px 0 0 2px; padding: 7px 10px;
    font-size: 13px; font-weight: 700; color: var(--text-main); background: rgba(25, 24, 22, 0.08); border-radius: 12px; z-index: 1;
}
.cmp-m-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px; min-width: 0; }
.cmp-m-remove { position: absolute; top: 6px; right: 6px; z-index: 2; width: 32px; height: 32px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.9); color: var(--accent); font-size: 16px; cursor: pointer; }
.cmp-m-photo { display: block; aspect-ratio: 1 / 1; background: var(--bg-soft); border-radius: 8px; overflow: hidden; }
.cmp-m-photo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cmp-m-name { font-size: 13px; line-height: 1.35; color: var(--text-main); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-m-price { font-size: 16px; font-weight: 700; color: var(--accent); }
.cmp-m-price s { margin-left: 6px; font-size: 12px; font-weight: 400; color: var(--text-muted); }
.cmp-m-buy { display: flex; flex-direction: column; gap: 6px; }
.cmp-m-buy .cmp-buy, .cmp-m-buy .cmp-quick { height: 38px; padding: 0 8px; font-size: 13px; }
.cmp-m-wait { align-items: center; justify-content: center; text-align: center; border: 1px dashed var(--border-strong, var(--border-light)); border-radius: 12px; margin: 8px 0; color: var(--text-secondary); font-size: 13px; line-height: 1.4; }
.cmp-m-wait b { font-size: 14px; font-weight: 500; color: var(--text-main); }
.cmp-m-wait a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* the compact strip that sticks under the header once the cards have scrolled away */
.cmp-m-sticky {
    position: fixed; left: 0; right: 0; z-index: 40; overflow: hidden; background: #fff; border-bottom: 1px solid var(--border-light);
    visibility: hidden; opacity: 0; transition: opacity 0.15s; pointer-events: none;
}
.cmp-m-sticky.is-visible { visibility: visible; opacity: 1; }
.cmp-m-sticky-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(40vw, calc(50vw - 8px)); padding: 0 8px; width: max-content; box-sizing: border-box; will-change: transform; }
.cmp-m-mini { display: flex; gap: 8px; padding: 8px; align-items: center; min-width: 0; }
.cmp-m-mini img { width: 32px; height: 32px; object-fit: contain; flex-shrink: 0; }
.cmp-m-mini-name { font-size: 12px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmp-m-mini-price { font-size: 13px; font-weight: 700; margin-top: 2px; }
