/* Compare feature — comparison table page, floating bar, and "Add to Compare"
   buttons. Uses the design tokens declared on :root in the thera layout
   (--ink, --ink-soft, --accent, --accent-warm, --line, --bg-soft). */

/* ---------------------------------------------------------------- */
/* Comparison page                                                   */
/* ---------------------------------------------------------------- */
.cmp-main { max-width: 1180px; margin: 0 auto; padding: 48px 24px 120px; }

.cmp-hero { max-width: 760px; margin: 0 auto 40px; text-align: center; }
.cmp-hero-eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--accent-ink, #8a6a00); margin-bottom: 14px;
}
.cmp-hero-title { font-size: clamp(26px, 4vw, 40px); line-height: 1.12; color: var(--ink); font-weight: 800; margin: 0 0 14px; }
.cmp-hero-sub { font-size: 16px; line-height: 1.6; color: var(--ink-soft); margin: 0; }

/* Pickers */
.cmp-picker { margin-top: 30px; }
.cmp-picker-selects { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cmp-picker-select-wrap { text-align: left; }
.cmp-picker-select-label {
  display: block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 6px;
}
.cmp-picker-select {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6b84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px;
}
.cmp-picker-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.cmp-picker-hint { text-align: center; color: var(--ink-soft); font-size: 15px; margin: 48px 0; }

/* Table */
.cmp-table-wrap { margin-top: 34px; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 820px; }
.cmp-table th, .cmp-table td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.cmp-row-variant .cmp-th-label,
.cmp-row-photo .cmp-th-label { background: var(--bg-soft); }
.cmp-th-label { width: 190px; min-width: 150px; position: sticky; left: 0; background: #fff; z-index: 1; }
.cmp-th-variant { font-size: 15px; font-weight: 800; color: var(--ink); white-space: nowrap; min-width: 180px; }
.cmp-td { min-width: 180px; }

.cmp-td-photo { padding: 10px 16px; }
.cmp-td-photo img { width: 100%; max-width: 150px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.cmp-td-photo .skel-block { width: 100%; max-width: 150px; aspect-ratio: 4 / 3; border-radius: 10px; display: grid; place-items: center; background: var(--bg-soft); }
.cmp-td-photo .skel-label { font-size: 11px; color: var(--ink-soft); text-align: center; padding: 6px; }

.cmp-row-section .cmp-th-section {
  background: var(--ink); color: #fff; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; padding: 10px 16px;
}
/* The full-width section bar scrolls with the table, but its label stays pinned
   to the left so it's readable while comparing columns on horizontal scroll. */
.cmp-section-label { position: sticky; left: 16px; display: inline-block; }
.cmp-th-rowlabel { width: 190px; min-width: 150px; position: sticky; left: 0; background: #fff; font-weight: 600; color: var(--ink-soft); font-size: 13px; }
.cmp-td { font-size: 14px; color: var(--ink); }
.cmp-row-data:nth-child(even) { background: rgba(14, 39, 66, .015); }

.cmp-td-bool { text-align: center; }
.cmp-bool-icon { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 13px; font-weight: 700; }
.cmp-td-bool.is-yes .cmp-bool-icon { background: transparent; color: #2ea05a; }
.cmp-td-bool.is-no .cmp-bool-icon { background: transparent; color: var(--ink-soft); }
.cmp-dash { color: var(--ink-soft); }

.cmp-footnote { margin-top: 20px; font-size: 12px; color: var(--ink-soft); text-align: center; }

@media (max-width: 720px) {
  .cmp-picker-selects { grid-template-columns: 1fr; }
}

/* ---------------------------------------------------------------- */
/* "Add to Compare" buttons                                          */
/* ---------------------------------------------------------------- */
/* Products grid card — compare toggle overlays the media, top-right */
.ap-card-media-link { position: absolute; inset: 0; display: block; z-index: 1; }
.ap-card-compare-wrap { position: absolute; top: 10px; right: 10px; z-index: 2; }
.ap-card-compare {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .92); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--ink); font-size: 12px; letter-spacing: .01em; cursor: pointer;
  box-shadow: 0 2px 10px rgba(14, 39, 66, .12);
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.ap-card-compare:hover { background: #fff; border-color: var(--ink); }
.ap-card-compare.active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* Product-detail CTA — compare matches the ghost/find-store button (border + hover
   come from .ag-cta-ghost); compare + find-store split the row's full width so the
   pair is as wide as the WhatsApp button below. */
.ag-cta-compare { cursor: pointer; }
.ag-cta-row .ag-cta-compare,
.ag-cta-row .ag-cta-ghost { flex: 1 1 0; justify-content: center; }
.ag-cta-compare.active,
.ag-cta-compare.active:hover { background: var(--ag-navy); border-color: var(--ag-navy); color: #fff; }

/* ---------------------------------------------------------------- */
/* Floating compare bar                                              */
/* ---------------------------------------------------------------- */
.cmp-bar {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  z-index: 900; max-width: calc(100vw - 32px);
}
.cmp-bar[hidden] { display: none; }
.cmp-bar-inner {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink); color: #fff; padding: 12px 14px 12px 20px;
  border-radius: 999px; box-shadow: 0 12px 40px rgba(14, 39, 66, .28);
}
.cmp-bar-count { font-size: 18px; font-weight: 800; }
.cmp-bar-count-max { font-size: 13px; font-weight: 600; opacity: .6; }
.cmp-bar-text { font-size: 14px; opacity: .85; white-space: nowrap; }
.cmp-bar-sep { width: 1px; height: 20px; background: rgba(255, 255, 255, .22); }
.cmp-bar-clear {
  background: none; border: none; color: rgba(255, 255, 255, .8); font-size: 13px;
  font-weight: 600; cursor: pointer; padding: 4px 6px;
}
.cmp-bar-clear:hover { color: #fff; }
.cmp-bar-go {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent);
  color: var(--ink); font-size: 14px; font-weight: 800; text-decoration: none;
  padding: 10px 18px; border-radius: 999px; transition: background .18s ease, opacity .18s ease;
}
.cmp-bar-go:hover { background: var(--accent-warm); }
.cmp-bar-go.disabled { opacity: .45; pointer-events: none; }

@media (max-width: 520px) {
  .cmp-bar-text { display: none; }
  .cmp-bar-inner { gap: 10px; padding-left: 16px; }
}

/* Shake when the compare list is full (max 3) */
@keyframes cmp-shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}
.cmp-shake { animation: cmp-shake .42s ease; }
