/*
 * engine-compare.css — heart button on villa cards + floating pill +
 * bottom-sheet comparison drawer.
 */

/* ---------- Heart button on cards ---------- */

.mps-compare-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(53, 71, 102, 0.08);
  color: #7a8496;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  transition: transform 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease;
  box-shadow: 0 2px 6px rgba(53, 71, 102, 0.10);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mps-compare-btn:hover {
  background: #fff;
  color: #354766;
  transform: scale(1.08);
  box-shadow: 0 4px 10px rgba(53, 71, 102, 0.16);
}
.mps-compare-btn.is-active {
  background: #d43d5b;
  color: #fff;
  border-color: #d43d5b;
}
.mps-compare-btn.is-active svg path {
  fill: currentColor;
}
.mps-compare-btn svg { width: 18px; height: 18px; }

/* Card media must be a positioning parent */
.villa-media { position: relative; }

/* ---------- Floating pill (bottom center) ---------- */

.mps-compare-host { position: fixed; inset: 0 0 auto 0; pointer-events: none; z-index: 90; }
.mps-compare-host * { pointer-events: auto; }

.mps-compare-pill {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #354766;
  color: #f4e7c8;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.25rem 0.7rem 0.5rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 10px 32px rgba(53, 71, 102, 0.32),
              0 2px 8px rgba(53, 71, 102, 0.18);
  transition: transform 140ms ease, box-shadow 140ms ease;
  z-index: 91;
}
.mps-compare-pill[hidden] { display: none; }
.mps-compare-pill:hover {
  transform: translateX(-50%) translateY(-2px);
  box-shadow: 0 14px 40px rgba(53, 71, 102, 0.38),
              0 3px 10px rgba(53, 71, 102, 0.22);
}
.mps-compare-pill__count {
  background: #f4e7c8;
  color: #354766;
  border-radius: 50%;
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

/* Mobile pill lifts higher to avoid the WhatsApp bubble bottom-right */
@media (max-width: 720px) {
  .mps-compare-pill { bottom: 84px; }
}

/* ---------- Bottom sheet ---------- */

.mps-compare-sheet {
  position: fixed;
  inset: 0;
  background: rgba(19, 27, 45, 0.42);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 220ms ease;
  padding: 0;
}
.mps-compare-sheet[hidden] { display: none; }
.mps-compare-sheet.is-open { opacity: 1; }

.mps-compare-sheet__inner {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: min(1160px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(24px);
  transition: transform 220ms cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.24);
}
.mps-compare-sheet.is-open .mps-compare-sheet__inner { transform: translateY(0); }

.mps-compare-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.1rem 1.5rem 0.8rem;
  border-bottom: 1px solid #f0e8d6;
}
.mps-compare-sheet__title {
  font-size: 1.05rem;
  color: #354766;
  margin: 0;
  font-weight: 600;
}
.mps-compare-sheet__actions {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.mps-compare-clear {
  background: none;
  border: none;
  color: #596478;
  font: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0.35rem 0.5rem;
}
.mps-compare-clear:hover { color: #354766; }
.mps-compare-close {
  background: none;
  border: none;
  color: #354766;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem 0.55rem;
  border-radius: 8px;
}
.mps-compare-close:hover { background: #f7f4ee; }

.mps-compare-sheet__body {
  overflow: auto;
  padding: 0.5rem 1.5rem 1rem;
  flex: 1 1 auto;
}
.mps-compare-sheet__foot {
  padding: 0.75rem 1.5rem 1.5rem;
  border-top: 1px solid #f0e8d6;
}

/* ---------- Comparison table ---------- */

.mps-compare-table {
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}
.mps-compare-table th[scope="row"] {
  text-align: left;
  color: #7a8496;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 0.75rem 0.75rem 0.75rem 0;
  width: 130px;
  vertical-align: top;
  white-space: nowrap;
}
.mps-compare-table td {
  padding: 0.75rem;
  border-top: 1px solid #f0e8d6;
  color: #354766;
  font-size: 0.9rem;
  vertical-align: top;
  word-wrap: break-word;
}
.mps-compare-table tr[data-row="thumb"] td { padding-top: 1rem; }
.mps-compare-table tr[data-row="thumb"] img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.mps-compare-table tr[data-row="name"] td { font-weight: 600; }
.mps-compare-name {
  color: #354766;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px dashed #c7b08f;
}
.mps-compare-name:hover { color: #c7b08f; }

.mps-compare-remove-wrap { padding-top: 0 !important; }
.mps-compare-remove {
  background: none;
  border: none;
  color: #c25b5b;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}
.mps-compare-remove:hover { color: #a03e3e; }

.mps-compare-amen {
  display: inline-block;
  background: #f7f4ee;
  border: 1px solid #e6ddc9;
  border-radius: 999px;
  padding: 0.12rem 0.55rem;
  font-size: 0.72rem;
  color: #354766;
  margin: 2px 3px 2px 0;
}
.mps-compare-table .muted { color: #a8b0c0; }

/* Column width: driven by the --cols var set by JS. */
.mps-compare-table td { width: calc((100% - 130px) / var(--cols, 1)); }

@media (max-width: 720px) {
  .mps-compare-table th[scope="row"] { display: none; }
  .mps-compare-table td { width: 50%; }
  .mps-compare-table tr[data-row="thumb"] img { height: 120px; }
}

/* Prevent body scroll while sheet is open */
body.mps-compare-lock { overflow: hidden; }

/* ---------- Toast ---------- */

.mps-compare-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  background: #354766;
  color: #f4e7c8;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 95;
  pointer-events: none;
}
.mps-compare-toast[hidden] { display: none; }
.mps-compare-toast.is-visible { opacity: 1; }
@media (max-width: 720px) {
  .mps-compare-toast { bottom: 148px; }
}
