/* Product comparison: custom UI backed by YITH storage. */
.kp-compare-button {
  width: fit-content;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 15px;
  border: 1px solid #c9cac5;
  border-radius: 10px;
  background: #fff;
  color: var(--kp-ink);
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}
.kp-compare-button:hover { border-color: var(--kp-red); color: var(--kp-red); transform: translateY(-1px); }
.kp-compare-button.is-added { border-color: rgba(215,25,32,.42); background: #fff3f3; color: var(--kp-red); }
.kp-compare-button.is-disabled { border-color: #dedfda; background: #f4f4f1; color: #777; cursor: not-allowed; opacity: .82; }
.kp-compare-button.is-disabled:hover { border-color: #dedfda; color: #777; transform: none; }
.kp-compare-button[aria-busy="true"] { opacity: .62; pointer-events: none; }
.kp-compare-button-icon { flex: 0 0 22px; width: 22px; height: 22px; display: inline-grid; place-items: center; }
.kp-compare-button-icon svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.kp-compare-tray[hidden] { display: none; }
.kp-compare-tray {
  position: fixed;
  z-index: 150;
  right: 18px;
  bottom: 18px;
  left: 18px;
  width: min(calc(100% - 36px), 920px);
  margin-inline: auto;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 16px;
  background: #14171b;
  box-shadow: 0 22px 60px rgba(0,0,0,.32);
  color: #fff;
}
body.kp-has-compare-tray { padding-bottom: 156px; }
.kp-compare-tray-bar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 9px 12px; }
.kp-compare-tray-toggle { display: inline-flex; align-items: center; gap: 9px; padding: 8px 9px; border: 0; background: transparent; color: #fff; font-weight: 850; cursor: pointer; }
.kp-compare-tray-icon { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: var(--kp-red); font-size: 18px; }
.kp-compare-tray-count { min-width: 24px; height: 24px; display: inline-grid; place-items: center; padding-inline: 6px; border-radius: 20px; background: #fff; color: #151515; font-size: 12px; }
.kp-compare-tray-actions { display: flex; align-items: center; gap: 8px; }
.kp-compare-tray-actions a, .kp-compare-tray-actions button { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 9px 14px; border-radius: 9px; font-size: 13px; font-weight: 850; text-decoration: none; cursor: pointer; }
.kp-compare-tray-open { border: 1px solid var(--kp-red); background: var(--kp-red); color: #fff; }
.kp-compare-tray-open:visited, .kp-compare-tray-open:hover { color: #fff; }
.kp-compare-tray-actions button { border: 1px solid rgba(255,255,255,.28); background: transparent; color: #dfe3e7; }
.kp-compare-tray-panel { padding: 0 12px 12px; }
.kp-compare-tray-items { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.kp-compare-tray-item { min-width: 0; display: grid; grid-template-columns: minmax(0,1fr) 36px; align-items: center; gap: 4px; padding: 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px; background: rgba(255,255,255,.06); }
.kp-compare-tray-product { min-width: 0; display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.kp-compare-tray-product:hover { color: #fff; }
.kp-compare-tray-product img { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 7px; background: #fff; object-fit: contain; }
.kp-compare-tray-product > span { min-width: 0; display: grid; gap: 1px; }
.kp-compare-tray-product strong, .kp-compare-tray-product small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kp-compare-tray-product strong { font-size: 11px; }
.kp-compare-tray-product small { color: #b8c0c8; font-size: 10px; }
.kp-compare-tray-remove { width: 36px; height: 36px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 23px; cursor: pointer; }
.kp-compare-tray-remove:hover { background: rgba(255,255,255,.1); }

.kp-compare-empty { display: grid; justify-items: start; gap: 12px; margin: 24px 0 70px; padding: clamp(24px,5vw,48px); border: 1px solid var(--kp-line); border-radius: 18px; background: var(--kp-soft); }
.kp-compare-empty h2, .kp-compare-empty p { margin: 0; }
.kp-compare-page { margin: 18px 0 72px; }
.kp-compare-intro { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 24px; }
.kp-compare-intro h2 { margin: 0; font-size: clamp(26px,3.2vw,40px); line-height: 1.08; letter-spacing: -.035em; }
.kp-compare-intro > div > p:last-child { max-width: 680px; margin: 10px 0 0; color: var(--kp-muted); }
.kp-compare-eyebrow { margin: 0 0 7px; color: var(--kp-red); font-size: 12px; font-weight: 900; letter-spacing: .13em; text-transform: uppercase; }
.kp-compare-clear-page { min-height: 44px; flex: 0 0 auto; padding: 10px 14px; border: 1px solid #c9cac5; border-radius: 9px; background: #fff; color: var(--kp-ink); font-weight: 800; cursor: pointer; }
.kp-compare-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-inline: contain; border: 1px solid var(--kp-line); border-radius: 16px; background: #fff; box-shadow: var(--kp-shadow); scrollbar-color: #adb2b6 #eceeeb; scrollbar-width: thin; }
.kp-compare-scroll:focus-visible { outline: 3px solid rgba(215,25,32,.3); outline-offset: 3px; }
.kp-compare-grid { --kp-compare-label-width: 180px; display: grid; grid-template-columns: var(--kp-compare-label-width) repeat(var(--kp-compare-products), minmax(240px,1fr)); width: 100%; min-width: 0; }
.kp-compare-label, .kp-compare-value, .kp-compare-product { min-width: 0; padding: 16px; border-bottom: 1px solid var(--kp-line); border-right: 1px solid var(--kp-line); }
.kp-compare-label { position: sticky; left: 0; z-index: 4; background: #f3f4f1; color: #353535; font-size: 13px; font-weight: 900; }
.kp-compare-label-top { z-index: 6; padding-top: 20px; }
.kp-compare-value { background: #fff; color: #424242; font-size: 14px; line-height: 1.5; }
.kp-compare-value .stock { margin: 0; }
.kp-compare-product { position: relative; display: grid; align-content: start; gap: 10px; padding: 18px; background: #fff; }
.kp-compare-product-remove { position: absolute; top: 10px; right: 10px; z-index: 2; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 1px solid var(--kp-line); border-radius: 50%; background: rgba(255,255,255,.94); color: #555; font-size: 24px; cursor: pointer; }
.kp-compare-product-image { aspect-ratio: 4 / 3; display: grid; place-items: center; overflow: hidden; border-radius: 11px; background: var(--kp-soft); }
.kp-compare-product-image img { width: 100%; height: 100%; padding: 8px; object-fit: contain; }
.kp-compare-product h3 { margin: 0; padding-right: 22px; font-size: 16px; line-height: 1.3; }
.kp-compare-product h3 a { color: var(--kp-ink); text-decoration: none; }
.kp-compare-variation { margin: -3px 0 0; color: var(--kp-muted); font-size: 12px; font-weight: 750; line-height: 1.4; }
.kp-compare-product-price { color: var(--kp-ink); font-weight: 900; }
.kp-compare-buy { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; padding: 10px 13px; border-radius: 9px; background: var(--kp-red); color: #fff; font-size: 13px; font-weight: 850; text-align: center; text-decoration: none; }
.kp-compare-buy:visited, .kp-compare-buy:hover { color: #fff; }

@media (max-width: 600px) {
  .kp-compare-button { width: 100%; justify-content: center; }
  body.kp-has-compare-tray { padding-bottom: calc(82px + env(safe-area-inset-bottom)); }
  .kp-compare-tray { right: 8px; bottom: calc(8px + env(safe-area-inset-bottom)); left: 8px; width: calc(100% - 16px); border-radius: 14px; }
  .kp-compare-tray-bar { gap: 6px; padding: 7px; }
  .kp-compare-tray-toggle { min-height: 46px; padding-inline: 7px; }
  .kp-compare-tray-actions { gap: 5px; }
  .kp-compare-tray-actions a, .kp-compare-tray-actions button { min-height: 42px; padding-inline: 9px; font-size: 11px; }
  .kp-compare-tray-panel { display: none; max-height: 48vh; overflow-y: auto; padding: 0 7px 7px; }
  .kp-compare-tray.is-open .kp-compare-tray-panel { display: block; }
  .kp-compare-tray-items { grid-template-columns: 1fr; }
  .kp-compare-tray-product img { flex-basis: 48px; width: 48px; height: 48px; }
  .kp-compare-tray-product strong { font-size: 12px; }
  .kp-compare-intro { align-items: stretch; flex-direction: column; gap: 15px; }
  .kp-compare-clear-page { width: 100%; }
  .kp-compare-scroll { margin-inline: -2px; border-radius: 12px; }
  .kp-compare-grid { --kp-compare-label-width: 106px; grid-template-columns: var(--kp-compare-label-width) repeat(var(--kp-compare-products), 218px); width: max-content; min-width: 100%; }
  .kp-compare-label, .kp-compare-value, .kp-compare-product { padding: 12px; }
  .kp-compare-label { font-size: 11px; }
  .kp-compare-value { font-size: 12px; }
  .kp-compare-product { padding: 12px; }
  .kp-compare-product h3 { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .kp-compare-button { transition: none; }
  .kp-compare-scroll { scroll-behavior: auto; }
}
