/* CompareThem Price Engine - front-end styles */

/* ---- Single product layout ---- */
.ctpe-single { width: 100%; }
.ctpe-single__inner { max-width: 880px; margin: 0 auto; padding: 24px 16px 56px; }
.ctpe-crumb { font-size: .8rem; color: #94a3b8; margin-bottom: 16px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ctpe-crumb a { color: #64748b; text-decoration: none; }
.ctpe-crumb a:hover { text-decoration: underline; }
.ctpe-crumb__current { color: #475569; }

.ctpe-hero { display: grid; grid-template-columns: 220px 1fr; gap: 26px; background: #fff; border: 1px solid #e6e8ec; border-radius: 14px; padding: 22px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06); align-items: start; }
.ctpe-hero__media { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, #e9eef7 0%, #dbe3f0 55%, #cdd8ea 100%); display: grid; place-items: center; }
.ctpe-hero__img { width: 100%; height: 100%; object-fit: contain; }
.ctpe-hero__placeholder { display: flex; flex-direction: column; align-items: center; gap: 8px; color: #8aa0c4; font-size: .78rem; }
.ctpe-hero__title { margin: 0 0 12px; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em; text-wrap: balance; }
.ctpe-hero__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ctpe-chip { font-size: .78rem; border-radius: 999px; padding: 4px 12px; font-weight: 600; }
.ctpe-chip--brand { color: #475569; background: #f1f5f9; border: 1px solid #e2e8f0; }
.ctpe-chip--price { color: #047857; background: #ecfdf5; border: 1px solid #bbf7d0; }
.ctpe-hero__lead { margin: 12px 0 0; color: #5a6472; font-size: .95rem; line-height: 1.5; }
.ctpe-single__body { margin-top: 28px; }

@media (max-width: 620px) {
  .ctpe-hero { grid-template-columns: 1fr; }
  .ctpe-hero__media { max-width: 200px; }
}


.ctpe-compare { margin: 2rem 0; font-family: inherit; }
.ctpe-compare__title { font-size: 1.4rem; margin: 0 0 .75rem; }

.ctpe-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.ctpe-table th, .ctpe-table td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid #f0f1f3; }
.ctpe-table th { background: #f8fafc; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.ctpe-table tr:last-child td { border-bottom: 0; }
.ctpe-row--best { background: #f0fdf4; }
.ctpe-store { font-weight: 600; }
.ctpe-price { font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.ctpe-oos { color: #b91c1c; }
.ctpe-badge { display: inline-block; margin-left: .4rem; padding: .1rem .5rem; font-size: .7rem; font-weight: 600; color: #047857; background: #d1fae5; border-radius: 999px; vertical-align: middle; }

.ctpe-buy { display: inline-block; padding: .5rem 1.1rem; background: #2563eb; color: #fff !important; text-decoration: none; border-radius: 8px; font-weight: 600; font-size: .9rem; }
.ctpe-buy:hover { background: #1d4ed8; }

.ctpe-updated { margin: .6rem 0 0; font-size: .82rem; color: #64748b; }
.ctpe-disclosure { margin-top: 1rem; font-size: .75rem; color: #94a3b8; }
.ctpe-empty { color: #64748b; }

/* Quote box */
.ctpe-quote { margin: 1.25rem 0 0; padding: 1.1rem 1.25rem; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; }
.ctpe-quote__head strong { display: block; font-size: 1.05rem; color: #9a3412; }
.ctpe-quote__head span { display: block; color: #7c2d12; font-size: .9rem; margin-top: .15rem; }
.ctpe-quote__toggle { margin-top: .8rem; padding: .55rem 1.3rem; background: #ea580c; color: #fff; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; font-size: .95rem; }
.ctpe-quote__toggle:hover { background: #c2410c; }
.ctpe-quote__form { margin-top: 1rem; }
.ctpe-quote__grid { display: grid; grid-template-columns: 1fr 1fr 100px; gap: .6rem; }
.ctpe-quote__form input, .ctpe-quote__form textarea { width: 100%; padding: .55rem .7rem; border: 1px solid #d6d3d1; border-radius: 8px; font-size: .9rem; box-sizing: border-box; }
.ctpe-quote__form textarea { margin-top: .6rem; }
.ctpe-quote__submit { margin-top: .7rem; padding: .55rem 1.3rem; background: #16a34a; color: #fff; border: 0; border-radius: 8px; font-weight: 700; cursor: pointer; }
.ctpe-quote__submit:hover { background: #15803d; }
.ctpe-quote__submit[disabled] { opacity: .6; cursor: default; }
.ctpe-quote__msg { margin: .6rem 0 0; font-size: .9rem; font-weight: 600; }
.ctpe-quote__msg.is-ok { color: #15803d; }
.ctpe-quote__msg.is-err { color: #b91c1c; }

@media (max-width: 560px) {
  .ctpe-quote__grid { grid-template-columns: 1fr; }
  .ctpe-table th:nth-child(3), .ctpe-table td:nth-child(3) { display: none; }
}

/* ---- Richer product layout (v0.3) ---- */
.ctpe-h1 { font-size: 1.6rem; line-height: 1.2; letter-spacing: -.02em; margin: 4px 0 10px; text-wrap: balance; }
.ctpe-h1chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.ctpe-chip--price { color: #047857; background: #ecfdf5; border: 1px solid #bbf7d0; }

.ctpe-top { display: grid; grid-template-columns: 1.1fr 1fr; gap: 22px; align-items: start; }
.ctpe-top__media { background: #fff; border: 1px solid #e6e8ec; border-radius: 14px; padding: 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06); }
.ctpe-top__img { display: block; width: 100%; height: auto; border-radius: 10px; }
.ctpe-top__placeholder { aspect-ratio: 4/3; border-radius: 10px; background: radial-gradient(120% 120% at 30% 20%, #e9eef7 0%, #dbe3f0 55%, #cdd8ea 100%); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: #8aa0c4; font-size: .8rem; }
.ctpe-top__lead { margin: 14px 0 0; color: #5a6472; font-size: .92rem; line-height: 1.5; }

.ctpe-top__side { display: flex; flex-direction: column; gap: 16px; }
.ctpe-spec, .ctpe-alts { background: #fff; border: 1px solid #e6e8ec; border-radius: 14px; padding: 16px 18px; box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06); }
.ctpe-spec__title, .ctpe-alts__title { font-size: 1rem; margin: 0 0 10px; }
.ctpe-spec__table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.ctpe-spec__table th, .ctpe-spec__table td { text-align: left; padding: 8px 0; border-bottom: 1px solid #f0f1f3; vertical-align: top; }
.ctpe-spec__table th { color: #64748b; font-weight: 600; width: 45%; }
.ctpe-spec__table tr:last-child th, .ctpe-spec__table tr:last-child td { border-bottom: 0; }
.ctpe-alts__list { margin: 0; padding-left: 18px; }
.ctpe-alts__list li { margin: 4px 0; font-size: .9rem; }
.ctpe-alts__list a { color: #2563eb; text-decoration: none; }
.ctpe-alts__list a:hover { text-decoration: underline; }

.ctpe-compare, .ctpe-videos, .ctpe-review { margin-top: 30px; }
.ctpe-compare__sub, .ctpe-videos__sub { color: #94a3b8; font-size: .82rem; margin: 0 0 14px; }
.ctpe-table-wrap { overflow-x: auto; }

.ctpe-videos__title { font-size: 1.25rem; margin: 0 0 2px; display: flex; align-items: center; gap: 8px; }
.ctpe-videos__title::before { content: ""; width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.ctpe-videos--pro .ctpe-videos__title::before { background: #16a34a; }
.ctpe-videos--con .ctpe-videos__title::before { background: #dc2626; }
.ctpe-video-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ctpe-video { position: relative; aspect-ratio: 16/9; border-radius: 10px; overflow: hidden; cursor: pointer; background: #000; border: 1px solid #e6e8ec; }
.ctpe-video__thumb { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.ctpe-video:hover .ctpe-video__thumb { transform: scale(1.05); }
.ctpe-video__play { position: absolute; inset: 0; margin: auto; width: 46px; height: 46px; border-radius: 50%; background: rgba(0,0,0,.6); }
.ctpe-video__play::after { content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%,-50%); border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff; }
.ctpe-video iframe { width: 100%; height: 100%; border: 0; display: block; }

.ctpe-review__title { font-size: 1.25rem; margin: 0 0 10px; }
.ctpe-review__body { color: #374151; line-height: 1.65; }

@media (max-width: 720px) {
  .ctpe-top { grid-template-columns: 1fr; }
  .ctpe-video-grid { grid-template-columns: repeat(2, 1fr); }
}


/* ---- Catalog grid + cards (v0.4) ---- */
.ctpe-single__inner--wide { max-width: 1120px; }
.ctpe-archive__lead { color: #5a6472; max-width: 65ch; margin: 0 0 24px; }
.ctpe-catalog { margin: 32px 0; }
.ctpe-catalog__title { font-size: 1.35rem; margin: 0 0 14px; }
.ctpe-catalog__more { margin-top: 14px; }
.ctpe-catalog__more a { color: #2563eb; font-weight: 600; text-decoration: none; }
.ctpe-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.ctpe-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #e6e8ec; border-radius: 14px; overflow: hidden; text-decoration: none !important; color: inherit; box-shadow: 0 1px 2px rgba(16,24,40,.04); transition: box-shadow .2s ease, transform .2s ease; }
.ctpe-card:hover { box-shadow: 0 10px 28px rgba(16,24,40,.10); transform: translateY(-2px); }
.ctpe-card__media { aspect-ratio: 4/3; background: radial-gradient(120% 120% at 30% 20%, #eef2f8 0%, #e0e7f2 60%, #d4ddeb 100%); display: grid; place-items: center; }
.ctpe-card__img { width: 100%; height: 100%; object-fit: contain; padding: 12px; box-sizing: border-box; }
.ctpe-card__noimg { color: #8aa0c4; font-size: .8rem; }
.ctpe-card__body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; flex: 1; }
.ctpe-card__brand { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: #94a3b8; font-weight: 600; }
.ctpe-card__title { font-weight: 600; color: #1e232b; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ctpe-card__price { color: #5a6472; font-size: .9rem; margin-top: 4px; }
.ctpe-card__price strong { color: #047857; font-size: 1.05rem; }
.ctpe-card__stores { font-size: .78rem; color: #94a3b8; }
.ctpe-card__cta { margin-top: auto; padding-top: 10px; color: #2563eb; font-weight: 600; font-size: .88rem; }
.ctpe-pagination { margin-top: 28px; }
@media (prefers-reduced-motion: reduce) { .ctpe-card { transition: none; } .ctpe-card:hover { transform: none; } }

/* ---- Theme-aware fixes (v0.4.1) ----
   Follow the theme's own light/dark toggle (html.mode-dark), not the OS setting,
   and neutralise the theme's global table-cell styling inside our components. */
.ctpe-spec__table th, .ctpe-spec__table td,
.ctpe-table th, .ctpe-table td { border-left: 0; border-right: 0; border-top: 0; }
.ctpe-spec__table th, .ctpe-spec__table td { background: transparent; }
.ctpe-spec__table td { color: #1e232b; }
.ctpe-top__media, .ctpe-spec, .ctpe-alts, .ctpe-card { color: #1e232b; }
.ctpe-table td { background: transparent; }
.ctpe-row--best td { background: #f0fdf4; }

html.mode-dark .ctpe-top__media, html.mode-dark .ctpe-spec, html.mode-dark .ctpe-alts,
html.mode-dark .ctpe-card, html.mode-dark .ctpe-table { background: #161b22; border-color: #262c36; color: #e6edf3; }
html.mode-dark .ctpe-spec__table td, html.mode-dark .ctpe-card__title, html.mode-dark .ctpe-h1 { color: #e6edf3; }
html.mode-dark .ctpe-spec__table th, html.mode-dark .ctpe-top__lead, html.mode-dark .ctpe-card__price,
html.mode-dark .ctpe-archive__lead, html.mode-dark .ctpe-review__body { color: #9aa4b2; }
html.mode-dark .ctpe-spec__table th, html.mode-dark .ctpe-spec__table td,
html.mode-dark .ctpe-table th, html.mode-dark .ctpe-table td { border-color: #262c36; }
html.mode-dark .ctpe-table th { background: #1e242c; color: #9aa4b2; }
html.mode-dark .ctpe-row--best td { background: #0f2a1c; }
html.mode-dark .ctpe-chip--brand { color: #cbd5e1; background: #1e242c; border-color: #2b333e; }
html.mode-dark .ctpe-video { border-color: #262c36; }
html.mode-dark .ctpe-quote { background: #2a1a0f; border-color: #7c3d17; }
html.mode-dark .ctpe-quote__head strong { color: #fdba74; }
html.mode-dark .ctpe-quote__head span { color: #fcd9b6; }
