/* ── Compare Bottom Sheet — compare.css ──────────────────────────── */

/* Sheet container */
.cmp-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 990;
  background: #ffffff;
  border-top-left-radius: 40px;
  border-top-right-radius: 40px;
  box-shadow: 0px -10px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  max-height: 90vh;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

/* States */
.cmp-sheet--hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.cmp-sheet--collapsed {
  transform: translateY(calc(100% - 72px));
}

.cmp-sheet--preview {
  transform: translateY(calc(100% - 320px));
}

.cmp-sheet--expanded {
  transform: translateY(0);
  height: 90vh;
}

/* Drag handle */
.cmp-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
  cursor: grab;
}

.cmp-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #d1d1d6;
}

/* Header */
.cmp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 14px;
  gap: 12px;
  flex-shrink: 0;
}

.cmp-header__left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cmp-header__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Accent dot */
.cmp-accent-dot {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #D3B39E;
  flex-shrink: 0;
}

/* Title */
.cmp-title {
  font-size: 32px;
  font-weight: 700;
  color: #192B33;
  line-height: 1;
}

/* Badge */
.cmp-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: #325A69;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* Icon buttons in header */
.cmp-btn-toggle,
.cmp-btn-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid currentColor;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.cmp-btn-toggle {
  color: #5CA3B4;
}

.cmp-btn-toggle:hover {
  background: #5CA3B4;
  color: #ffffff;
}

.cmp-btn-toggle svg {
  transition: transform 0.3s ease;
}

/* Divider */
.cmp-divider {
  height: 1px;
  background: #BEDDE3;
  flex-shrink: 0;
  margin: 0 24px;
}


/* Table wrap — scrollable area below cards in expanded state */
.cmp-table-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: hidden;
}

.cmp-sheet--expanded .cmp-table-wrap {
  overflow-y: auto;
}

/* Table container */
.cmp-table {
  padding: 0 104px 24px;
}

/* Row */
.cmp-row {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid #BEDDE3;
  padding: 12px 0;
}

.cmp-row:last-child {
  border-bottom: none;
}

/* Label cell */
.cmp-row__label {
  width: 192px;
  min-width: 192px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  font-size: 15px;
  color: #192B33;
}

/* Value cell */
.cmp-row__cell {
  width: 240px;
  min-width: 240px;
  flex-shrink: 0;
  font-size: 15px;
  color: #8E8E93;
}

.cmp-row__cell--price {
  color: #775342;
  font-weight: 700;
  font-size: 18px;
}

/* Header row inside table */
.cmp-row--header {
  padding-top: 16px;
}

.cmp-col-title {
  font-size: 14px;
  font-weight: 700;
  color: #192B33;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-col-img-wrap {
  position: relative;
  display: inline-block;
}

.cmp-col-img {
  width: 240px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
  display: block;
}

.cmp-col-view {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #325A69;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}

.cmp-col-view:hover {
  background: #325A69;
  color: #fff;
}

.cmp-col-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #F04438;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.cmp-col-delete:hover {
  background: #F04438;
  color: #fff;
}

/* ── Compare button on search/property cards ─────────────────────── */
.search-card__cmp-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 11;
  background: white;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-primary, #325A69);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.2s, color 0.2s;
  padding: 0;
}

.search-card__cmp-btn:hover {
  background: var(--color-primary, #325A69);
  color: white;
}

.search-card__cmp-btn.is-comparing {
  background: var(--color-primary, #325A69);
  color: white;
}

/* ── Collapsed state — minimal bar: dot + title + up arrow only ── */
.cmp-sheet--collapsed .cmp-divider,
.cmp-sheet--collapsed .cmp-handle-wrap {
  display: none;
}

.cmp-sheet--collapsed .cmp-header {
  padding-top: 22px;
  padding-bottom: 22px;
  cursor: pointer;
}

/* ── Add-more button in header label cell ───────────────────────── */
.cmp-add-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px dashed #BEDDE3;
  background: transparent;
  color: #5CA3B4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  padding: 0;
  margin: 0 auto;
}

.cmp-add-btn:hover {
  border-color: #325A69;
  background: #325A69;
  color: #fff;
}

/* ── Active (is-comparing) states on card footer buttons ────────── */
.search-card__compare-btn.is-comparing {
  background: var(--color-primary, #325A69);
  color: #ffffff;
  outline-color: var(--color-primary, #325A69);
}

.featured-card__compare-btn.is-comparing {
  background: #775342;
  border-color: #775342;
  color: #ffffff;
}

/* ── Mobile responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Sheet */
  .cmp-sheet {
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
  }

  .cmp-sheet--expanded {
    height: 95vh;
    border-radius: 0;
  }

  /* Collapsed bar */
  .cmp-sheet--collapsed {
    transform: translateY(calc(100% - 64px));
  }

  /* Header */
  .cmp-header {
    padding: 0 16px 12px;
  }

  .cmp-title {
    font-size: 22px;
  }

  .cmp-divider {
    margin: 0 16px;
  }

  /* Table: horizontal scroll */
  .cmp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .cmp-sheet--expanded .cmp-table-wrap {
    overflow-y: auto;
    overflow-x: auto;
  }

  .cmp-table {
    padding: 0 16px 24px;
    min-width: max-content;
  }

  /* Row sizing */
  .cmp-row {
    gap: 12px;
  }

  .cmp-row__label {
    width: 90px;
    min-width: 90px;
    font-size: 12px;
    gap: 6px;
  }

  .cmp-row__cell {
    width: 140px;
    min-width: 140px;
    font-size: 12px;
  }

  .cmp-row__cell--price {
    font-size: 14px;
  }

  /* Card images */
  .cmp-col-img {
    width: 140px;
    height: 85px;
  }

  .cmp-col-img-wrap {
    width: 140px;
  }

  /* Add button */
  .cmp-add-btn {
    width: 40px;
    height: 40px;
  }
}
