/* Compare: round compare buttons on product cards, a tray at the bottom of the screen (max 3 products)
   and a pop-up that lays the products side by side. On phones all columns share the screen width, so there is no sideways scrolling. */

/* ---------- compare button on product cards ---------- */
.pc-acts { display: flex; align-items: center; gap: 10px; flex: none; }
.pc-cmp {
  flex: none; width: 48px; height: 48px; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  background: #fff; color: #1d1a1b; border: 1px solid #d9d4d5; transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.pc-cmp svg { width: 24px; height: 24px; }
.pc-cmp:hover { border-color: #1d1a1b; }
.pc-cmp.on, .pc-cmp[aria-pressed="true"] { background: var(--accent, #a11d31); border-color: var(--accent, #a11d31); color: #fff; }

/* ---------- tray ---------- */
.cmp-tray[hidden], .cmp-modal[hidden] { display: none; }
.cmp-tray {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; background: #fff; color: #1d1a1b;
  border-top: 1px solid #e2e0e0; box-shadow: 0 -10px 28px -14px rgba(0,0,0,.28); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cmp-tray-in { display: flex; align-items: center; gap: 22px; max-width: 1480px; margin: 0 auto; padding: 12px 32px; min-height: 92px; box-sizing: border-box; }
.cmp-msg { display: flex; align-items: center; gap: 14px; font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 22px; line-height: 26px; text-transform: uppercase; white-space: nowrap; }
.cmp-msg svg { width: 34px; height: 34px; flex: none; color: var(--accent, #a11d31); }
.cmp-msg small { font-size: 15px; color: #5a5557; }
.cmp-slots { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.cmp-slot { position: relative; width: 88px; height: 68px; background: #f5f0f1; display: flex; align-items: center; justify-content: center; }
.cmp-slot img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.cmp-slot button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: #fff; color: #1d1a1b; box-shadow: 0 0 0 1px #d9d4d5; display: flex; align-items: center; justify-content: center;
}
.cmp-slot button svg { width: 10px; height: 10px; }
.cmp-spacer { flex: 1; }
.cmp-link { border: 0; background: none; padding: 0; cursor: pointer; font-family: var(--font-ui, sans-serif); font-size: 17px; color: #1d1a1b; text-decoration: underline; text-underline-offset: 3px; }
.cmp-go {
  height: 55px; padding: 0 30px; border: 0; border-radius: 2px; cursor: pointer; background: var(--accent, #a11d31); color: #fff;
  font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 17px; letter-spacing: .02em; text-transform: uppercase;
}
.cmp-go:hover { background: var(--accent-hover, #86172a); }
.cmp-go[hidden] { display: none; }
.cmp-trash { display: none; width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; color: #1d1a1b; align-items: center; justify-content: center; }
.cmp-trash svg { width: 22px; height: 22px; }
body.has-cmp { padding-bottom: 96px; }
body.has-cmp .toast { bottom: 112px; }

/* ---------- pop-up ---------- */
html.cmp-lock, html.cmp-lock body { overflow: hidden; }
.cmp-modal { position: fixed; inset: 0; z-index: 92; display: flex; justify-content: flex-end; background: rgba(29,26,27,.45); }
.cmp-panel { position: relative; width: min(1180px, 100%); height: 100%; overflow-y: auto; overflow-x: hidden; background: #fff; color: #1d1a1b; box-sizing: border-box; padding: 28px 40px 48px; }
.cmp-close {
  position: absolute; top: 18px; right: 18px; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: #1d1a1b;
  display: flex; align-items: center; justify-content: center;
}
.cmp-close svg { width: 24px; height: 24px; }
.cmp-title { margin: 0 0 6px; font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 28px; line-height: 34px; text-transform: uppercase; padding-right: 52px; }
.cmp-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 28px; margin: 10px 0 18px; font-family: var(--font-ui, sans-serif); font-size: 15px; }
.cmp-tools label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.cmp-tools input { -webkit-appearance: none; appearance: none; width: 20px; height: 20px; margin: 0; flex: none; cursor: pointer; background: #fff; border: 1.5px solid #1d1a1b; border-radius: 2px; }
.cmp-tools input:checked { background: var(--accent, #a11d31); border-color: var(--accent, #a11d31); box-shadow: inset 0 0 0 3px #fff; }
html.cmp-lock .toast { display: none; }

.cmp-grid { --n: 3; }
.cmp-row { display: grid; grid-template-columns: 190px repeat(var(--n), minmax(0, 1fr)); column-gap: 28px; padding: 18px 0; border-top: 1px solid #e5e3e3; font-family: var(--font-ui, sans-serif); font-weight: 300; font-size: 17px; line-height: 24px; }
.cmp-row[hidden] { display: none; }
.cmp-label { font-family: var(--font-ui, sans-serif); font-weight: 500; font-size: 17px; }
.cmp-cell { min-width: 0; overflow-wrap: anywhere; }
.cmp-head { border-top: 0; padding-top: 4px; align-items: stretch; }
.cmp-head .cmp-cell { display: flex; flex-direction: column; }
.cmp-img { display: block; aspect-ratio: 1 / 1; background: #fff; }
.cmp-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cmp-name { display: block; margin-top: 14px; font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 14px; line-height: 17px; letter-spacing: .01em; text-transform: uppercase; color: inherit; text-decoration: none; }
.cmp-tag { margin: 10px 0 0; font-weight: 300; font-size: 17px; line-height: 24px; }
.cmp-acts { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; padding-top: 16px; }
.cmp-add {
  height: 44px; padding: 0 18px; border: 0; border-radius: 2px; cursor: pointer; background: var(--accent, #a11d31); color: #fff;
  font-family: var(--font-display, sans-serif); font-weight: 500; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; text-decoration: none; display: inline-flex; align-items: center;
}
.cmp-add:hover { background: var(--accent-hover, #86172a); }
.cmp-del { width: 40px; height: 40px; padding: 0; border: 0; background: none; cursor: pointer; color: #1d1a1b; display: flex; align-items: center; justify-content: center; flex: none; }
.cmp-del svg { width: 22px; height: 22px; }
.cmp-stars { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cmp-stars .rv-stars { flex: none; }

/* ---------- phones: label sits on its own line above the columns, every column shares the width ---------- */
@media (max-width: 720px) {
  .cmp-tray-in { gap: 10px; padding: 8px 12px; min-height: 76px; }
  .cmp-msg { flex: 1; min-width: 0; gap: 0; font-size: 12px; line-height: 15px; white-space: normal; }
  .cmp-msg svg, .cmp-msg small { display: none; }
  .cmp-tray[data-n="2"] .cmp-msg, .cmp-tray[data-n="3"] .cmp-msg { display: none; }
  .cmp-tray[data-n="2"] .cmp-slots, .cmp-tray[data-n="3"] .cmp-slots { margin-right: auto; }
  .cmp-slots { gap: 6px; }
  .cmp-slot { width: 52px; height: 56px; }
  .cmp-slot button { width: 18px; height: 18px; top: 1px; right: 1px; }
  .cmp-spacer, .cmp-tray .cmp-link { display: none; }
  .cmp-go { height: 44px; padding: 0 14px; font-size: 14px; }
  .cmp-trash { display: flex; }
  body.has-cmp { padding-bottom: 84px; }
  body.has-cmp .toast { bottom: 96px; }
  .pc-buy { flex-wrap: wrap; row-gap: 10px; }
  .pc-acts { width: 100%; justify-content: flex-end; gap: 8px; }
  .pc-cmp { width: 40px; height: 40px; }
  .pc-cmp svg { width: 20px; height: 20px; }

  .cmp-panel { padding: 16px 12px 36px; }
  .cmp-title { font-size: 20px; line-height: 26px; }
  .cmp-close { top: 8px; right: 6px; }
  .cmp-tools { margin: 6px 0 12px; font-size: 13px; gap: 6px 18px; }
  .cmp-row { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: 8px; row-gap: 4px; padding: 12px 0; font-size: 12.5px; line-height: 17px; }
  .cmp-label { grid-column: 1 / -1; font-size: 11px; line-height: 14px; letter-spacing: .06em; text-transform: uppercase; color: #5a5557; font-weight: 500; }
  .cmp-head .cmp-label { display: none; }
  .cmp-cell { hyphens: auto; }
  .cmp-name { margin-top: 8px; font-size: 11px; line-height: 14px; }
  .cmp-tag { display: none; }
  .cmp-acts { flex-direction: column-reverse; align-items: stretch; gap: 6px; margin-top: auto; padding-top: 10px; }
  .cmp-add { height: 34px; padding: 0 6px; font-size: 12px; justify-content: center; }
  .cmp-del { width: 34px; height: 30px; align-self: flex-end; }
  .cmp-del svg { width: 18px; height: 18px; }
  .cmp-stars { flex-direction: column; align-items: flex-start; gap: 2px; }
  .cmp-stars .rv-stars { transform: scale(.78); transform-origin: left center; margin-right: -14px; }
}
@media (prefers-reduced-motion: no-preference) {
  .cmp-tray:not([hidden]) { animation: cmp-up .22s ease; }
  .cmp-panel { animation: cmp-in .25s ease; }
}
@keyframes cmp-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes cmp-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- hide / show the tray ---------- */
.cmp-fold { flex: none; width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: #1d1a1b; display: flex; align-items: center; justify-content: center; }
.cmp-fold svg { width: 26px; height: 26px; }
.cmp-fold:hover { color: var(--accent, #a11d31); }
.cmp-tab[hidden] { display: none; }
.cmp-tab {
  position: fixed; left: 0; bottom: 0; z-index: 80; height: 56px; padding: 0 14px 0 16px; display: flex; align-items: center; gap: 6px; cursor: pointer;
  background: #fff; color: #1d1a1b; border: 1px solid #e2e0e0; border-left: 0; border-bottom: 0; box-shadow: 0 -6px 18px -10px rgba(0,0,0,.3);
  margin-bottom: env(safe-area-inset-bottom, 0px);
}
.cmp-tab svg { width: 28px; height: 28px; color: var(--accent, #a11d31); }
.cmp-tab .cmp-tab-ch svg { width: 20px; height: 20px; color: #1d1a1b; }
.cmp-tab .cmp-tab-ch { display: flex; margin-left: 6px; }
.cmp-count { min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--accent, #a11d31); color: #fff; font-family: var(--font-ui, sans-serif); font-size: 12px; line-height: 20px; text-align: center; margin-left: -6px; align-self: flex-start; margin-top: 10px; }
body.has-cmp .cmp-tab { display: none; }
@media (max-width: 720px) { .cmp-fold { width: 36px; height: 40px; margin-left: -6px; } .cmp-fold svg { width: 22px; height: 22px; } }
