/* ============================================================
   Product Comparison — editorial layout (Migration 017/019)
   Scoped to .cmp-page only, so it never touches the rest of the
   site's design system. Loaded only on frontend/product_category.php
   and frontend/product_details.php via $extraHead.
   Palette / type intentionally distinct from the main site theme —
   warm cream background + burnt-orange accent, Manrope headings,
   Source Sans 3 body — to read like a dedicated "best of" review
   page rather than another directory listing.
   ============================================================ */

.cmp-page {
    --cmp-bg:       oklch(98% 0.01 70);
    --cmp-bg-alt:   oklch(95.5% 0.012 70);
    --cmp-ink:      oklch(22% 0.015 70);
    --cmp-ink-soft: oklch(42% 0.015 70);
    --cmp-ink-mute: oklch(50% 0.015 70);
    --cmp-line:     oklch(90% 0.01 70);
    --cmp-line-lt:  oklch(93% 0.01 70);
    --cmp-accent:   oklch(65% 0.19 45);
    --cmp-accent-dk: oklch(58% 0.19 45);
    --cmp-good:     oklch(60% 0.14 155);
    --cmp-bad:      oklch(50% 0.14 25);
    --cmp-card:     #fff;

    font-family: 'Source Sans 3', sans-serif;
    color: var(--cmp-ink);
    background: var(--cmp-bg);
}

.cmp-page h1, .cmp-page h2, .cmp-page h3, .cmp-page .cmp-heading {
    font-family: 'Manrope', sans-serif;
    letter-spacing: -0.01em;
}

.cmp-page a { color: var(--cmp-accent-dk); }
.cmp-page a:hover { color: var(--cmp-accent); }

.cmp-disclosure {
    background: oklch(20% 0.02 70);
    color: oklch(96% 0.01 70);
    padding: 8px 20px;
    text-align: center;
    font-size: 13px;
}

.cmp-container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.cmp-subnav {
    display: flex; gap: 24px; flex-wrap: wrap;
    padding: 14px 24px; border-bottom: 1px solid var(--cmp-line);
    font-size: 14px; font-weight: 600;
}
.cmp-subnav a { text-decoration: none; }

.cmp-hero { padding: 48px 24px 32px; max-width: 900px; margin: 0 auto; }
.cmp-eyebrow {
    font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
    color: var(--cmp-accent-dk); text-transform: uppercase;
}
.cmp-hero h1 { font-size: clamp(28px, 4.5vw, 42px); line-height: 1.12; font-weight: 800; margin: 14px 0 18px; }
.cmp-hero p.cmp-sub { font-size: 17px; line-height: 1.6; color: var(--cmp-ink-soft); margin: 0; }
.cmp-hero-stats {
    display: flex; gap: 22px; flex-wrap: wrap;
    margin-top: 24px; font-size: 14px; color: var(--cmp-ink-mute);
}
.cmp-hero-stats span i { color: var(--cmp-accent); margin-right: 4px; }

.cmp-section { padding: 8px 24px 56px; }
.cmp-section-title { font-size: 26px; font-weight: 800; margin: 0 0 8px; }
.cmp-section-lead { font-size: 15px; color: var(--cmp-ink-soft); margin: 0 0 28px; max-width: 700px; }

/* ---- Comparison cards ---- */
.cmp-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}.cmp-card {
    background: var(--cmp-card); border: 1px solid var(--cmp-line);
    border-radius: 6px; padding: 22px; display: flex; flex-direction: column;
    gap: 12px; position: relative;
}
.cmp-pick-badge {
    position: absolute; top: -12px; left: 20px;
    background: var(--cmp-good); color: #fff; font-size: 12px; font-weight: 700;
    padding: 4px 10px; border-radius: 3px;
}
.cmp-card-photo {
    width: 100%; aspect-ratio: 4/3; border-radius: 4px; overflow: hidden;
    background: var(--cmp-bg-alt); display: flex; align-items: center; justify-content: center;
}
.cmp-card-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp-card-name { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 16.5px; line-height: 1.3; }
.cmp-card-bestfor { font-size: 13px; color: var(--cmp-ink-mute); }
.cmp-card-row {
    display: flex; justify-content: space-between; font-size: 14px;
    padding: 9px 0; border-top: 1px solid var(--cmp-line-lt);
}
.cmp-card-row:last-of-type { border-bottom: 1px solid var(--cmp-line-lt); padding-bottom: 9px; }
.cmp-card-row .cmp-label { color: var(--cmp-ink-mute); }
.cmp-card-row .cmp-val { font-weight: 600; }
.cmp-card-row.cmp-price .cmp-val { font-weight: 700; font-size: 16px; }
.cmp-btn {
    background: var(--cmp-accent); color: #fff !important; text-align: center;
    padding: 12px; border-radius: 4px; font-weight: 700; font-size: 14.5px;
    text-decoration: none !important; display: block; margin-top: auto;
    transition: background .15s ease;
}
.cmp-btn:hover { background: var(--cmp-accent-dk) !important; }
.cmp-btn-sm { padding: 9px 18px; display: inline-block; margin-top: 0; }

/* ---- Detailed review rows ---- */
.cmp-review-row {
    display: flex; gap: 30px; padding: 36px 0; border-top: 1px solid var(--cmp-line);
    align-items: flex-start; flex-wrap: wrap;
}
.cmp-review-row:first-child { border-top: none; }
.cmp-review-photo {
    flex: 0 0 220px; width: 220px; aspect-ratio: 4/3; border-radius: 4px; overflow: hidden;
    background: var(--cmp-bg-alt); display: flex; align-items: center; justify-content: center;
}
.cmp-review-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp-review-body { flex: 1; min-width: 240px; }
.cmp-review-body h3 { font-size: 21px; margin: 0 0 4px; }
.cmp-review-body .cmp-review-rating { margin-bottom: 10px; }
.cmp-review-body p.cmp-desc { font-size: 15px; line-height: 1.65; color: var(--cmp-ink-soft); margin: 0 0 18px; }
.cmp-proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 18px; }
.cmp-proscons-head { font-size: 12.5px; font-weight: 700; letter-spacing: .03em; margin-bottom: 8px; text-transform: uppercase; }
.cmp-proscons-head.good { color: var(--cmp-good); }
.cmp-proscons-head.bad { color: var(--cmp-bad); }
.cmp-proscons-item { font-size: 14px; padding: 4px 0; display: flex; gap: 8px; }
.cmp-proscons-item.good i { color: var(--cmp-good); }
.cmp-proscons-item.bad i { color: var(--cmp-bad); }

/* ---- Buyer's guide ---- */
.cmp-guide { background: var(--cmp-bg-alt); }
.cmp-guide-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 26px;
}
.cmp-guide-num {
    width: 38px; height: 38px; border-radius: 50%; background: var(--cmp-accent);
    color: #fff; display: flex; align-items: center; justify-content: center;
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 15px; margin-bottom: 12px;
}
.cmp-guide-item-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 15.5px; margin-bottom: 6px; }
.cmp-guide-item-text { font-size: 14px; line-height: 1.6; color: var(--cmp-ink-soft); }

/* ---- FAQ ---- */
.cmp-faq details { border-bottom: 1px solid var(--cmp-line); padding: 14px 0; }
.cmp-faq summary {
    font-size: 15.5px; font-weight: 600; list-style: none; cursor: pointer;
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
}
.cmp-faq summary::-webkit-details-marker { display: none; }
.cmp-faq summary::after { content: '+'; font-weight: 400; font-size: 20px; color: var(--cmp-ink-mute); flex-shrink: 0; }
.cmp-faq details[open] summary::after { content: '\2212'; }
.cmp-faq p { font-size: 14.5px; line-height: 1.6; color: var(--cmp-ink-soft); margin: 10px 0 0; }

/* ---- Also-like carousel ---- */
.cmp-related-scroll { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 8px; }
.cmp-related-card {
    flex: 0 0 170px; background: var(--cmp-card); border: 1px solid var(--cmp-line);
    border-radius: 4px; padding: 14px; text-decoration: none !important; color: inherit !important;
}
.cmp-related-photo {
    width: 100%; aspect-ratio: 1/1; border-radius: 3px; margin-bottom: 10px; overflow: hidden;
    background: var(--cmp-bg-alt); display: flex; align-items: center; justify-content: center;
}
.cmp-related-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp-related-name { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; line-height: 1.3; }
.cmp-related-price { font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.cmp-related-link { font-size: 12.5px; font-weight: 700; }

/* ---- Single product page hero ---- */
.cmp-pd-hero { display: flex; gap: 28px; flex-wrap: wrap; align-items: flex-start; padding: 40px 0; }
.cmp-pd-photo {
    flex: 0 0 260px; width: 260px; aspect-ratio: 1/1; border-radius: 6px; overflow: hidden;
    background: var(--cmp-bg-alt); display: flex; align-items: center; justify-content: center;
}
.cmp-pd-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp-pd-price { font-size: 26px; font-weight: 800; color: var(--cmp-accent-dk); margin: 10px 0 18px; }
.cmp-disclosure-note { font-size: 12.5px; color: var(--cmp-ink-mute); margin-top: 14px; }

@media (max-width: 640px) {
    .cmp-hero, .cmp-section { padding-left: 18px; padding-right: 18px; }
    .cmp-container { padding: 0 18px; }
    .cmp-review-row { gap: 18px; }
    .cmp-review-photo, .cmp-pd-photo { flex-basis: 100%; width: 100%; }
    .cmp-proscons { grid-template-columns: 1fr; }
}

/* ---- Category browse: tag pills, filter sidebar, compact grid ---- */
.cmp-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.cmp-pill {
    padding: 8px 16px; border-radius: 999px; border: 1px solid var(--cmp-line);
    font-size: 13.5px; font-weight: 600; background: #fff; color: var(--cmp-ink-soft) !important;
    text-decoration: none !important; transition: border-color .15s ease, color .15s ease;
}
.cmp-pill:hover { border-color: var(--cmp-accent); color: var(--cmp-accent-dk) !important; }
.cmp-pill.active { background: var(--cmp-accent); border-color: var(--cmp-accent); color: #fff !important; }

.cmp-browse { display: grid; grid-template-columns: 220px 1fr; gap: 36px; align-items: start; }
.cmp-filters { display: flex; flex-direction: column; gap: 26px; }
.cmp-filter-group-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 13.5px; margin-bottom: 10px; }
.cmp-filter-check {
    display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 5px 0;
    color: var(--cmp-ink-soft); cursor: pointer;
}
.cmp-filter-check input { accent-color: var(--cmp-accent); }
.cmp-filters-clear { font-size: 13px; font-weight: 600; }

.cmp-browse-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; flex-wrap: wrap; }
.cmp-browse-count { font-size: 14px; color: var(--cmp-ink-mute); }
.cmp-sort-select {
    font-size: 14px; padding: 8px 12px; border-radius: 4px; border: 1px solid var(--cmp-line);
    background: #fff; color: var(--cmp-ink);
}

.cmp-grid-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.cmp-ccard {
    background: var(--cmp-card); border: 1px solid var(--cmp-line); border-radius: 4px;
    padding: 16px; display: flex; flex-direction: column; gap: 8px; position: relative;
}
.cmp-ccard-badge {
    position: absolute; top: 12px; left: 12px; z-index: 1;
    background: var(--cmp-good); color: #fff; font-size: 10.5px; font-weight: 700;
    padding: 3px 8px; border-radius: 3px;
}
.cmp-ccard-photo {
    width: 100%; aspect-ratio: 4/3; border-radius: 3px; overflow: hidden;
    background: var(--cmp-bg-alt); display: flex; align-items: center; justify-content: center;
}
.cmp-ccard-photo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.cmp-ccard-name { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14.5px; line-height: 1.3; }
.cmp-ccard-meta { font-size: 12.5px; color: var(--cmp-ink-mute); }
.cmp-ccard-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.cmp-ccard-price { font-weight: 700; font-size: 15.5px; }

@media (max-width: 760px) {
    .cmp-browse { grid-template-columns: 1fr; }
    .cmp-filters { flex-direction: row; flex-wrap: wrap; gap: 20px 32px; }
}
