/* Compare page: phone-app skin (iOS / One UI feel).
   Grouped background, large left-aligned title, inset rounded cards, filled fields,
   hairline separators, spring press feedback. Loaded after the page styles, so it overrides them. */

:root {
  --app-spring: cubic-bezier(.32, .72, 0, 1);
  --app-bounce: cubic-bezier(.34, 1.4, .64, 1);
  --app-r: 26px;          /* card radius */
  --app-r-in: 16px;       /* controls inside cards */
  --app-fill: #EEEEF2;    /* filled field / pressed row */
  --app-sep: rgba(60, 60, 67, .14);
}
[data-theme="dark"] {
  --app-fill: rgba(255, 255, 255, .08);
  --app-sep: rgba(255, 255, 255, .10);
}

/* ---------- press feedback everywhere ---------- */
body .bbp-cat-btn, body .quick-chip, body .popular-chip, body .compare-btn, body .buy-btn,
body .bbp-share-btn, body .bbp-recent-chip, body .bbp-dock-nav button, body .bbp-cat-opt {
  -webkit-tap-highlight-color: transparent;
  transition: transform .28s var(--app-bounce), background-color .2s ease, box-shadow .25s ease, border-color .2s ease, opacity .2s ease;
}
body .bbp-cat-btn:active, body .quick-chip:active, body .popular-chip:active,
body .compare-btn:not(:disabled):active, body .buy-btn:active, body .bbp-share-btn:active,
body .bbp-recent-chip:active { transform: scale(.96); }
body .compare-btn:hover:not(:disabled) { transform: none; }

/* ---------- cards: soft, borderless, big radius (all sizes) ---------- */
body .search-card, body .vs-banner-inner, body .compare-table-card, body .bbp-cat-btn, body .bbp-share, body .features-card {
  border-radius: var(--app-r);
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(26, 26, 46, .04), 0 8px 28px rgba(26, 26, 46, .06);
}
[data-theme="dark"] body .search-card, [data-theme="dark"] body .vs-banner-inner,
[data-theme="dark"] body .compare-table-card, [data-theme="dark"] body .bbp-cat-btn {
  border-color: var(--border); box-shadow: none;
}

/* filled fields instead of outlined boxes */
body .slot-input {
  min-height: 52px; border: 1.5px solid transparent; border-radius: var(--app-r-in);
  background: var(--app-fill); font-size: 16px; font-weight: 500;
}
body .slot-input:focus { background: var(--card-bg); border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-glow); }
body .slot-label { font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--text-3); padding-left: 4px; }

/* primary action: tall, full width, one clear button */
body .compare-btn {
  min-height: 56px; width: 100%; max-width: 420px; padding: 14px 24px;
  border-radius: 18px; font-size: 16px; font-weight: 800; letter-spacing: -.1px;
  box-shadow: 0 8px 22px var(--orange-glow);
}
body .compare-btn:disabled { box-shadow: none; opacity: .38; }

/* category cell reads like a settings row */
body .bbp-cat-btn { min-height: 72px; padding: 14px 16px; border-width: 1px; }
body .bbp-cat-ico { width: 46px; height: 46px; border-radius: 14px; }
body .bbp-cat-btn[aria-expanded="true"] { border-color: transparent; box-shadow: 0 0 0 4px var(--orange-glow); }

/* category list: grouped rows with hairlines */
body .bbp-cat-search { border: 1.5px solid transparent; background: var(--app-fill); border-radius: 14px; }
body .bbp-cat-search:focus { background: var(--card-bg); border-color: var(--orange); outline: none; }
body .bbp-cat-opt { min-height: 52px; border-radius: 14px; font-size: 16px; font-weight: 500; }
body .bbp-cat-opt + .bbp-cat-opt { box-shadow: 0 -1px 0 var(--app-sep); }
body .bbp-cat-opt:hover, body .bbp-cat-opt.is-active { background: var(--app-fill); box-shadow: none; }
body .bbp-cat-opt:hover + .bbp-cat-opt, body .bbp-cat-opt.is-active + .bbp-cat-opt { box-shadow: none; }
body .bbp-cat-opt svg.ico { width: 22px; height: 22px; color: var(--orange); }

/* dock tabs become a segmented control */
body .bbp-dock { border-radius: 22px; border-color: transparent; box-shadow: 0 10px 34px rgba(26, 26, 46, .16); }
body .bbp-dock-nav { gap: 2px; margin: 0 10px 10px; padding: 3px; border-radius: 12px; background: var(--app-fill); }
body .bbp-dock-nav button { flex: 1 0 auto; min-height: 34px; padding: 6px 12px; border: none; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-2); }
body .bbp-dock-nav button.on, [data-theme="dark"] body .bbp-dock-nav button.on {
  background: var(--card-bg); color: var(--text-1); box-shadow: 0 1px 4px rgba(0, 0, 0, .14);
}
[data-theme="dark"] body .bbp-dock-nav button.on { background: rgba(255, 255, 255, .16); }

/* table: quieter header, hairline rows */
body .compare-table-card thead th { background: transparent; border-bottom: 1px solid var(--app-sep); font-size: 11px; }
body .compare-table-card tbody td { border-color: var(--app-sep); }
body .compare-table-title { border-bottom-color: var(--app-sep); font-size: 17px; font-weight: 800; letter-spacing: -.2px; }

/* buy buttons */
body .buy-btn { min-height: 52px; border-radius: 16px; font-size: 15px; font-weight: 800; }
body .vs-product-img, body .vs-product-img-placeholder { border-radius: 20px; border-color: transparent; }

/* ---------- product search results: grouped list ---------- */
body .slot-dropdown {
  border: none; border-radius: 20px; padding: 6px; max-height: 380px;
  box-shadow: 0 2px 6px rgba(26, 26, 46, .06), 0 18px 48px rgba(26, 26, 46, .18);
}
[data-theme="dark"] body .slot-dropdown { border: 1px solid var(--border); box-shadow: 0 18px 48px rgba(0, 0, 0, .5); }
body .slot-dropdown.open { animation: appDrop .32s var(--app-spring) both; }
@keyframes appDrop { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
body .dd-header { padding: 10px 12px 8px; border-bottom: none; font-size: 13px; font-weight: 600; letter-spacing: .1px; text-transform: none; }
body .dd-count { font-size: 12px; padding: 2px 9px; background: var(--app-fill); }
body .dd-item { min-height: 68px; padding: 8px 10px; gap: 12px; border: none; border-radius: 14px; transition: background-color .15s ease, transform .25s var(--app-bounce); }
body .dd-item + .dd-item { box-shadow: 0 -1px 0 var(--app-sep); }
body .dd-item:hover, body .dd-item.focused { background: var(--app-fill); box-shadow: none; }
body .dd-item:hover + .dd-item, body .dd-item.focused + .dd-item { box-shadow: none; }
body .dd-item:active { transform: scale(.98); }
body .dd-item.focused::after { display: none; }
body .dd-img-wrap, body .dd-img-placeholder, body .dd-skel-img { border: none; border-radius: 12px; background: #fff; }
body .dd-name { font-size: 14px; font-weight: 600; line-height: 1.35; }
body .dd-name mark { background: none; color: var(--orange-dark); font-weight: 800; padding: 0; }
body .dd-brand { border: none; background: var(--app-fill); font-size: 11px; }
body .dd-match-badge { border: none; font-size: 10px; }
body .dd-price { background: none; -webkit-text-fill-color: currentColor; color: var(--text-1); font-size: 14px; }
body .dd-skeleton { border-bottom: none; border-radius: 14px; }

/* chosen product chip under each field */
body .slot-selected { border: none; border-radius: var(--app-r-in); background: var(--app-fill); box-shadow: none; }
body .slot-selected::before { display: none; }
body .selected-img-wrap { border: none; border-radius: 12px; background: #fff; }

/* ---------- save card: one calm row ---------- */
body .save-matrix-card {
  border: none; border-radius: var(--app-r); padding: 16px;
  box-shadow: 0 1px 2px rgba(26, 26, 46, .04), 0 8px 28px rgba(26, 26, 46, .06);
}
[data-theme="dark"] body .save-matrix-card { border: 1px solid var(--border); box-shadow: none; }
body .save-matrix-left { flex: 1; min-width: 0; }
body .save-matrix-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; background: rgba(255, 107, 53, .12); color: var(--orange); }
body .save-matrix-icon .bbp-icon { width: 22px; height: 22px; }
body .save-matrix-title { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
body .save-matrix-sub { font-size: 13px; line-height: 1.4; }
body .save-matrix-btn { min-height: 44px; padding: 10px 20px; border-radius: 14px; background: var(--app-fill); color: var(--orange-dark); font-size: 15px; font-weight: 700; transition: transform .28s var(--app-bounce), background-color .2s ease; }
[data-theme="dark"] body .save-matrix-btn { color: var(--orange); }
body .save-matrix-btn:hover { opacity: 1; transform: none; background: rgba(255, 107, 53, .16); }
body .save-matrix-btn:active { transform: scale(.96); }
body .save-matrix-btn.saved { background: var(--green-light); color: var(--green); }

/* ================= phones ================= */
@media (max-width: 760px) {
  body.bbp-has-tabbar { background: #F2F2F7; }
  [data-theme="dark"] body.bbp-has-tabbar { background: #0B0B14; }

  body .breadcrumb { display: none; }
  body .page-body { padding-top: 92px; }

  /* large title header, left aligned */
  body .compare-hero { text-align: left; padding: 10px 20px 6px; max-width: none; }
  body .compare-hero-eyebrow { margin-bottom: 10px; padding: 0; border: none; background: none; font-size: 12px; letter-spacing: .6px; }
  body .compare-hero h1 { font-size: 33px; line-height: 1.08; letter-spacing: -1.1px; margin-bottom: 10px; }
  body .compare-hero p { margin: 0; max-width: none; font-size: 15px; line-height: 1.5; color: var(--text-2);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  body .compare-hero p.is-open { display: block; }
  .app-more { display: inline-block; margin-top: 6px; padding: 6px 0; min-height: 32px; border: none; background: none; color: var(--orange-dark); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; }

  /* disclosure as a footnote */
  body .disclosure { padding: 0 20px; margin: 6px 0 14px; }
  body .disclosure-box { text-align: left; padding: 0; border: none; background: none; font-size: 12px; line-height: 1.5; color: var(--text-3); }

  /* section headers */
  body .cat-picker-wrap, body .search-panel { padding: 0 16px; }
  body .quick-comp-row { display: block; margin-bottom: 18px; }
  body .quick-comp-label, body .popular-label { display: block; margin: 0 4px 8px; font-size: 13px; font-weight: 600; letter-spacing: .2px; text-transform: none; color: var(--text-3); }
  body .quick-chips { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x proximity; }
  body .quick-chips::-webkit-scrollbar { display: none; }
  body .quick-chip { flex: 0 0 auto; scroll-snap-align: start; min-height: 40px; padding: 8px 14px; border: none; border-radius: 999px; background: var(--card-bg); font-size: 14px; font-weight: 600; box-shadow: 0 1px 3px rgba(26, 26, 46, .07); }
  [data-theme="dark"] body .quick-chip { background: rgba(255, 255, 255, .08); box-shadow: none; }

  body .cat-step-header { margin: 0 4px 8px; padding: 0; border: none; gap: 0; }
  body .cat-step-num { display: none; }
  body .cat-step-label { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
  body .cat-step-desc { font-size: 14px; color: var(--text-2); margin-top: 2px; }

  body .cat-prompt { margin: 14px 4px 10px; text-align: left; font-size: 14px; }
  body .search-card { padding: 16px; }
  body .search-row { display: flex; flex-direction: column; gap: 6px; }
  body .vs-divider { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
  body .vs-divider::before, body .vs-divider::after { content: ""; flex: 1; height: 1px; background: var(--app-sep); }
  body .vs-badge { width: 34px; height: 34px; font-size: 11px; box-shadow: none; }
  body .compare-btn { max-width: none; }

  body .bbp-recent { margin: 14px 4px 0; }
  body .bbp-recent-chip { border: none; background: var(--card-bg); box-shadow: 0 1px 3px rgba(26, 26, 46, .07); min-height: 40px; }

  /* bottom sheet: taller grabber, rounder top */
  body .bbp-cat-panel { border-radius: 28px 28px 0 0; transition: transform .42s var(--app-spring), visibility .42s; box-shadow: 0 -10px 40px rgba(0, 0, 0, .2); }
  body .bbp-cat-grab { width: 38px; height: 5px; margin-top: 8px; opacity: .7; }
  body .bbp-cat-head { border-bottom: none; padding: 12px 16px 6px; }
  body .bbp-cat-list { padding: 0 12px 14px; }
  body .bbp-cat-group { padding: 18px 8px 6px; font-size: 13px; font-weight: 600; letter-spacing: .1px; text-transform: none; }

  /* results */
  body .save-matrix-wrap { padding: 0 16px; }
  body .save-matrix-btn { width: 100%; }
  body .vs-banner, body .compare-table-wrap { padding: 0 16px; }
  body .vs-banner-inner { padding: 18px 14px; }

  /* theme switch: small round button, out of the way */
  body.bbp-has-tabbar .theme-toggle { bottom: 100px; right: 14px; width: 46px; height: 46px; padding: 0; justify-content: center; border-radius: 50%; border: none; box-shadow: 0 4px 16px rgba(26, 26, 46, .16); }
  body.bbp-has-tabbar .theme-toggle #toggleLabel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  body.bbp-has-tabbar .theme-toggle .toggle-icon .bbp-icon { width: 20px; height: 20px; }
}

/* content rises in gently */
@media (prefers-reduced-motion: no-preference) {
  .app-rise { animation: appRise .5s var(--app-spring) both; }
  @keyframes appRise { from { opacity: 0; transform: translateY(14px) scale(.985); } to { opacity: 1; transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  body .bbp-cat-btn, body .quick-chip, body .compare-btn, body .buy-btn, body .bbp-share-btn, body .bbp-cat-panel { transition: none; }
}
