/*!
 * ShopCore Compare 1.1.1 — Copyright (c) 2026 BoholwebWP (https://boholwebwp.com) — Commercial license
 * Colours follow ShopCore's tokens, which follow the active Template.
 */
.sccm, .sccm-form, .sccm-link {
    --sccm-accent: var(--shopcore-accent, var(--cms-accent, var(--accent, #2563eb)));
    --sccm-accent-ink: var(--shopcore-accent-ink, #fff);
    --sccm-line: var(--shopcore-line, rgba(127, 127, 127, .28));
    --sccm-soft: var(--shopcore-soft, rgba(127, 127, 127, .07));
    --sccm-muted: var(--shopcore-muted, rgba(127, 127, 127, .95));
    --sccm-ok: var(--shopcore-ok, #15803d);
    --sccm-bad: var(--shopcore-bad, #b91c1c);
    --sccm-radius: var(--shopcore-radius, 8px);
    --sccm-col: 13rem;
    --sccm-bg: var(--cms-bg, var(--bg, Canvas));
    --sccm-ink: var(--cms-text, var(--text, CanvasText));
}

.sccm-sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.sccm-muted { color: var(--sccm-muted); }

/* ---------- Button ---------- */
.sccm-form { display: inline-block; margin: .35rem 0 0; }
.sccm-loop.sccm-button, .sccm-form:has(.sccm-loop) { margin-top: .35rem; }
.sccm-button { display: inline-flex; align-items: center; gap: .4em; cursor: pointer; font: inherit; line-height: 1.2; }
.sccm-button--button {
    padding: .45em .9em; border: 1px solid var(--sccm-line); border-radius: var(--sccm-radius);
    background: transparent; color: inherit;
}
.sccm-button--button:hover { border-color: var(--sccm-accent); color: var(--sccm-accent); }
.sccm-button--button.is-added { background: var(--sccm-accent); border-color: var(--sccm-accent); color: var(--sccm-accent-ink); }
.sccm-button--link {
    padding: 0; border: 0; background: none; color: var(--sccm-accent);
    text-decoration: underline; text-underline-offset: .2em;
}
.sccm-button:focus-visible, .sccm-remove:focus-visible, .sccm-bar button:focus-visible, .sccm-bar a:focus-visible, .sccm-scroll:focus-visible {
    outline: 2px solid var(--sccm-accent); outline-offset: 2px;
}
.sccm-icon {
    width: 1em; height: .9em; flex: none;
    background:
        linear-gradient(currentColor, currentColor) left bottom / .22em 65% no-repeat,
        linear-gradient(currentColor, currentColor) center bottom / .22em 100% no-repeat,
        linear-gradient(currentColor, currentColor) right bottom / .22em 40% no-repeat;
}
.sccm-button.is-added .sccm-icon {
    background: none; width: .38em; height: .7em; margin: 0 .25em 0 .15em;
    border: solid currentColor; border-width: 0 .14em .14em 0; transform: rotate(45deg) translateY(-.1em);
}
.sccm-button[aria-busy="true"] { opacity: .6; cursor: progress; }

/* ---------- Compare page ---------- */
.sccm-page { margin: 1rem 0 2rem; }
.sccm-toolbar { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.sccm-summary { margin: 0; font-weight: 600; }
.sccm-actions { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; }
.sccm-actions form { margin: 0; }
.sccm-diff { display: inline-flex; gap: .4em; align-items: center; cursor: pointer; }
.sccm-share, .sccm-clear, .sccm-remove {
    font: inherit; cursor: pointer; background: none; border: 0; padding: .25em 0;
    color: var(--sccm-accent); text-decoration: underline; text-underline-offset: .2em;
}
.sccm-clear { color: var(--sccm-bad); }

.sccm-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--sccm-line); border-radius: var(--sccm-radius); }
.sccm-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: max-content; margin: 0; table-layout: fixed; }
.sccm-table th, .sccm-table td {
    padding: .7rem .9rem; vertical-align: top; text-align: left;
    border-bottom: 1px solid var(--sccm-line); border-left: 1px solid var(--sccm-line);
    width: var(--sccm-col); min-width: var(--sccm-col); max-width: 18rem; overflow-wrap: anywhere;
}
.sccm-table tr > :first-child { border-left: 0; }
.sccm-table tbody tr:last-child > * { border-bottom: 0; }
.sccm-table tbody th[scope="row"], .sccm-table .sccm-corner {
    position: sticky; left: 0; z-index: 1; width: 9rem; min-width: 9rem;
    background: var(--sccm-bg); color: var(--sccm-ink); font-weight: 600;
    box-shadow: 1px 0 0 var(--sccm-line);
}
.sccm-table tbody th[scope="row"] { background-image: linear-gradient(var(--sccm-soft), var(--sccm-soft)); }
.sccm-col-head { font-weight: 600; }
.sccm-head-title { display: block; margin-bottom: .25rem; }
.sccm-remove-form { margin: 0; }
.sccm-remove { font-size: .875em; color: var(--sccm-muted); }
.sccm-remove:hover { color: var(--sccm-bad); }
.sccm-table tr.is-same td { color: var(--sccm-muted); }
.sccm-image { display: block; width: 100%; max-width: 11rem; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--sccm-radius) - 2px); background: var(--sccm-soft); }
.sccm-image-empty { aspect-ratio: 1; max-width: 11rem; }
.sccm-title { font-weight: 600; }
.sccm-price ins, .sccm-bar ins { text-decoration: none; }
.sccm-price del { opacity: .6; margin-right: .25em; }
.sccm-table tbody th[scope="row"] { overflow-wrap: normal; word-break: normal; -webkit-hyphens: auto; hyphens: auto; }
.sccm-description { margin: 0; font-size: .925em; }
.sccm-stock-in { color: var(--sccm-ok); }
.sccm-stock-out { color: var(--sccm-bad); }
.sccm-stars { position: relative; display: inline-block; line-height: 1; letter-spacing: .05em; color: var(--sccm-line); white-space: nowrap; }
.sccm-stars::before { content: "\2605\2605\2605\2605\2605"; }
.sccm-stars-fill { position: absolute; inset: 0 auto 0 0; overflow: hidden; color: #d97706; }
.sccm-stars-fill::before { content: "\2605\2605\2605\2605\2605"; }
.sccm-use-form { margin-top: 1rem; }
.sccm-empty { padding: 1.5rem; border: 1px dashed var(--sccm-line); border-radius: var(--sccm-radius); text-align: center; }
.sccm-empty p:last-child { margin-bottom: 0; }

/* ---------- Content block ---------- */
.sccm-block-list { list-style: none; margin: 0 0 .75rem; padding: 0; display: grid; gap: .5rem; }
.sccm-block-list li { display: flex; gap: .6rem; align-items: center; }
.sccm-block-list img { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex: none; }

/* ---------- Compare bar ---------- */
.sccm-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990;
    background: var(--sccm-bg); color: var(--sccm-ink);
    border-top: 1px solid var(--sccm-line); box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
    padding: .6rem max(1rem, env(safe-area-inset-left)) calc(.6rem + env(safe-area-inset-bottom));
}
.sccm-bar[hidden] { display: none; }
.sccm-bar-inner { max-width: 72rem; margin: 0 auto; display: flex; align-items: center; gap: .75rem 1.25rem; flex-wrap: wrap; }
.sccm-bar-count { margin: 0; white-space: nowrap; }
.sccm-bar-items { list-style: none; margin: 0; padding: 0; display: flex; gap: .5rem; flex: 1 1 0; min-width: 0; overflow-x: auto; }
.sccm-bar-item {
    position: relative; display: flex; align-items: center; gap: .5rem; flex: 0 1 14rem; min-width: 8.5rem;
    padding: .3rem 1.9rem .3rem .3rem; border: 1px solid var(--sccm-line); border-radius: var(--sccm-radius);
}
.sccm-bar-item img, .sccm-bar-noimg { width: 40px; height: 40px; object-fit: cover; border-radius: 4px; flex: none; background: var(--sccm-soft); }
.sccm-bar-title { font-size: .875rem; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: inherit; }
.sccm-bar-slot { width: 9rem; height: 50px; border-style: dashed; padding: 0; }
.sccm-bar-remove {
    position: absolute; top: .15rem; right: .15rem; width: 1.6rem; height: 1.6rem; display: grid; place-items: center;
    border: 0; border-radius: 50%; background: transparent; color: var(--sccm-muted); cursor: pointer; font-size: 1.1rem; line-height: 1;
}
.sccm-bar-remove:hover { background: var(--sccm-soft); color: var(--sccm-bad); }
.sccm-bar-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.sccm-bar-go { white-space: nowrap; }
.sccm-bar-go[aria-disabled="true"] { opacity: .55; }
.sccm-bar-clear { font: inherit; background: none; border: 0; padding: .25em 0; cursor: pointer; color: var(--sccm-muted); text-decoration: underline; }
.sccm-bar-toggle {
    width: 2rem; height: 2rem; display: grid; place-items: center; cursor: pointer;
    border: 1px solid var(--sccm-line); border-radius: 50%; background: transparent; color: inherit;
}
.sccm-bar-toggle span { width: .5rem; height: .5rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.sccm-bar.is-collapsed .sccm-bar-toggle span { transform: rotate(-135deg) translate(-1px, -1px); }
.sccm-bar.is-collapsed .sccm-bar-items, .sccm-bar.is-collapsed .sccm-bar-clear { display: none; }
html.sccm-has-bar body { padding-bottom: 5.5rem; }

@media (max-width: 640px) {
    .sccm { --sccm-col: 10.5rem; }
    .sccm-table tbody th[scope="row"], .sccm-table .sccm-corner { width: 6.5rem; min-width: 6.5rem; font-size: .8125rem; padding-left: .6rem; padding-right: .5rem; }
    .sccm-bar-count { display: none; }
    .sccm-bar-items { order: 2; flex-basis: 100%; }
    .sccm-bar-actions { width: 100%; margin-left: 0; justify-content: space-between; }
    .sccm-bar-item { flex-basis: 11rem; }
    html.sccm-has-bar body { padding-bottom: 8.5rem; }
}

@media print {
    .sccm-bar, .sccm-toolbar, .sccm-remove-form, .sccm-row-add_to_cart { display: none !important; }
    .sccm-scroll { overflow: visible; border: 0; }
}

@media (prefers-reduced-motion: no-preference) {
    .sccm-button, .sccm-bar-remove { transition: background-color .15s, color .15s, border-color .15s; }
}
