/* ==========================================================================
   PICK THE PACKAGE - ADVANCED COMPARISON ENGINE STYLES
   ========================================================================== */

.cmp-page-container {
  padding-bottom: 80px;
}

.cmp-workspace .cmp-multi-matrix .cmp-table .cmp-th-item { width: calc(78% / var(--compare-count)); }
.cmp-workspace .cmp-multi-matrix .cmp-sticky-names { grid-template-columns: repeat(var(--compare-count), minmax(0, 1fr)); }
.cmp-workspace .cmp-multi-matrix .cmp-card-media { height: auto; aspect-ratio: 3 / 2; }
.cmp-workspace .cmp-multi-matrix .cmp-card-img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 575px) {
  .cmp-workspace .cmp-multi-matrix .cmp-table .cmp-th-item { width: calc(76% / var(--compare-count)); padding: 8px 4px; }
  .cmp-workspace .cmp-multi-matrix .cmp-card-price { font-size: 14px; }
  .cmp-workspace .cmp-multi-matrix .cmp-table .btn { padding: 6px 3px !important; font-size: 10px; }
  .cmp-workspace .cmp-multi-matrix .cmp-card-title { font-size: 11px; }
}

.cmp-page-heading.trek-hero-section { min-height: 0; padding: 105px 0 28px; }
.cmp-page-heading .trek-hero-container { padding-top: 0; padding-bottom: 0; }
.cmp-page-heading .trek-hero-title { font-size: 30px; line-height: 1.2; margin-bottom: 0; letter-spacing: 0; }
.cmp-workspace .cmp-control-card { margin-top: 0; padding: 22px 0; border: 0; border-bottom: 1px solid #dce4e8; border-radius: 0; box-shadow: none; }
.cmp-workspace .cmp-mode-switch { margin-bottom: 0; border-radius: 6px; }
.cmp-workspace .cmp-mode-btn { border-radius: 4px; }
.cmp-workspace .cmp-matrix-card { margin-top: 0; border-radius: 0; box-shadow: none; }
.cmp-workspace .cmp-table { table-layout: fixed; width: 100%; min-width: 0; }
.cmp-workspace .cmp-th-spec { width: 22%; }
.cmp-workspace .cmp-th-item { width: 39%; min-width: 0; padding: 16px; vertical-align: top; }
.cmp-workspace .cmp-card-top > img { width: 100%; max-width: 200px; height: 100px; object-fit: cover; border-radius: 6px; }
.cmp-workspace .cmp-card-top > img.cmp-card-avatar { width: 64px; height: 64px; }
.cmp-workspace .cmp-card-title { font-size: 15px; line-height: 1.45; letter-spacing: 0; }
.cmp-workspace .cmp-card-price { font-size: 24px; margin: 12px 0; }
.cmp-workspace .cmp-table th, .cmp-workspace .cmp-table td { overflow-wrap: anywhere; }
.cmp-workspace .cmp-table .btn { border-radius: 6px !important; white-space: normal; }
.cmp-detail-tools { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 14px; }
.cmp-detail-tools h2 { font-size: 18px; margin: 0; letter-spacing: 0; }
.cmp-detail-options { display: flex; flex-wrap: wrap; gap: 12px 20px; }
.cmp-detail-options label { display: flex; align-items: center; gap: 8px; font-size: 12px; cursor: pointer; }
.cmp-detail-options input { accent-color: #00674b; }
.cmp-workspace .cmp-section-button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 14px 12px; color: #183f39; background: #edf4f2; border: 0; text-align: left; font-size: 13px; font-weight: 700; }
.cmp-section-button > i:last-child { margin-left: auto; }
.cmp-section-button[aria-expanded="false"] > i:last-child { transform: rotate(-90deg); }
.cmp-workspace .cmp-sec-row td { padding: 0; }
.cmp-workspace .cmp-common-hidden, .cmp-workspace .cmp-section-hidden { display: none !important; }
.cmp-workspace .cmp-highlight .cmp-row[data-common="false"] td:not(:first-child) { background: #fff4d8; }

@media (max-width: 575px) {
  .cmp-page-heading.trek-hero-section { padding: 90px 0 22px; }
  .cmp-page-heading .trek-hero-title { font-size: 23px; }
  .cmp-workspace .cmp-control-card { padding: 16px 0; }
  .cmp-workspace .cmp-table { display: table; }
  .cmp-workspace .cmp-table thead { display: table-header-group; }
  .cmp-workspace .cmp-table tbody { display: table-row-group; }
  .cmp-workspace .cmp-table tr { display: table-row; }
  .cmp-workspace .cmp-table .cmp-th-spec { width: 24%; padding: 8px 5px; }
  .cmp-workspace .cmp-table .cmp-th-item { width: 38%; padding: 10px 6px; }
  .cmp-workspace .cmp-table .cmp-label-cell, .cmp-workspace .cmp-table .cmp-row td:not(:first-child) { padding: 10px 6px; font-size: 11px; }
  .cmp-workspace .cmp-card-top > img { height: 65px; }
  .cmp-workspace .cmp-card-top > img.cmp-card-avatar { width: 42px; height: 42px; }
  .cmp-workspace .cmp-card-title { font-size: 12px; }
  .cmp-workspace .cmp-card-price { font-size: 18px; }
  .cmp-workspace .cmp-card-meta, .cmp-workspace .cmp-table .btn { font-size: 11px; }
  .cmp-workspace .cmp-th-spec h3 { font-size: 12px; }
  .cmp-workspace .cmp-section-button { font-size: 12px; }
}

/* Control Bar */
.cmp-control-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--color-border-slate);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  padding: 24px 28px;
  margin-top: -40px;
  position: relative;
  z-index: 50;
}

.cmp-mode-switch {
  display: inline-flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
  margin-bottom: 20px;
}

.cmp-mode-btn {
  padding: 8px 18px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-text-slate);
  text-decoration: none;
  border: none;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.cmp-mode-btn.active {
  background: #ffffff;
  color: var(--color-heading);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cmp-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.cmp-field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.cmp-field-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-top: 18px;
}

.cmp-field-actions #btnRunCompare {
  margin-left: auto;
  min-height: 46px;
}

.cmp-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px dashed var(--color-accent);
  border-radius: 12px;
  color: var(--color-accent);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cmp-add-btn:hover {
  background: var(--color-accent-light);
}

.cmp-add-btn[hidden],
.cmp-limit-note[hidden],
.cmp-field-remove[hidden] {
  display: none;
}

.cmp-limit-note {
  font-size: 13px;
  color: var(--color-text-slate);
}

.cmp-field-remove {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 50%;
  color: var(--color-text-slate);
  font-size: 14px;
  cursor: pointer;
}

.cmp-field-remove:hover {
  background: #e2e8f0;
  color: var(--color-heading);
}

.cmp-input-wrap:has(.cmp-field-remove:not([hidden])) .cmp-input {
  padding-right: 44px;
}

.cmp-field-label {
  font-size: 12px;
  font-weight: 750;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cmp-input-wrap {
  position: relative;
}

.cmp-input {
  width: 100%;
  height: 48px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 0 16px 0 42px;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-heading);
  outline: none;
  transition: all 0.2s ease;
}

.cmp-input:focus {
  background: #ffffff;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-accent-glow);
}

.cmp-input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-slate-light);
  font-size: 14px;
  pointer-events: none;
}

/* Autocomplete Suggestion Dropdown */
.cmp-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.14);
  max-height: 320px;
  overflow-y: auto;
  z-index: 100;
  display: none;
}

.cmp-dropdown-menu.show {
  display: block;
}

.cmp-suggest-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: background-color 0.15s ease;
}

.cmp-suggest-item:last-child {
  border-bottom: none;
}

.cmp-suggest-item:hover {
  background: #f8fafc;
}

.cmp-suggest-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-heading);
}

.cmp-suggest-info {
  flex: 1;
  min-width: 0;
}

.cmp-suggest-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--color-heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-suggest-sub {
  font-size: 11.5px;
  color: var(--color-text-slate);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmp-suggest-right {
  text-align: right;
  flex-shrink: 0;
}

.cmp-suggest-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-heading);
}

.cmp-suggest-badge {
  font-size: 10px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  padding: 2px 6px;
  border-radius: 4px;
}

/* Compare Matrix Table & Cards */
.cmp-sticky-names { display: none; }

.cmp-matrix-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid var(--color-border-slate);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  margin-top: 36px;
}

.cmp-table {
  width: 100%;
  border-collapse: collapse;
}

.cmp-th-spec {
  width: 240px;
  background: #f8fafc;
  padding: 24px 20px;
  vertical-align: bottom;
  border-bottom: 1px solid var(--color-border-slate);
}

.cmp-th-item {
  width: calc((100% - 240px) / 2);
  padding: 24px 20px;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border-slate);
  border-left: 1px solid var(--color-border-slate);
  background: #ffffff;
}

.cmp-card-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.cmp-card-media {
  width: 100%;
  height: 160px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--color-heading);
  margin-bottom: 14px;
}

.cmp-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cmp-card-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  object-fit: cover;
  border: 2px solid var(--color-border-slate);
  margin-bottom: 12px;
}

.cmp-card-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--color-heading);
  margin-bottom: 6px;
  line-height: 1.3;
}

.cmp-card-meta {
  font-size: 12.5px;
  color: var(--color-text-slate);
  font-weight: 600;
  margin-bottom: 12px;
}

.cmp-card-price {
  font-size: 24px;
  font-weight: 850;
  color: var(--color-heading);
  margin-bottom: 14px;
}

.cmp-card-actions {
  display: flex;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

/* Section Dividers */
.cmp-sec-row td {
  background: var(--color-heading);
  color: #ffffff;
  padding: 10px 20px;
  font-size: 12.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Data Rows */
.cmp-row td {
  padding: 15px 20px;
  font-size: 14px;
  color: #334155;
  border-bottom: 1px solid #f1f5f9;
}

.cmp-row td:not(:first-child) {
  border-left: 1px solid #f1f5f9;
}

.cmp-row:nth-child(even) td {
  background: #fafafa;
}

.cmp-label-cell {
  font-weight: 700;
  color: #1e293b;
  background: #f8fafc !important;
}

@media (max-width: 991px) {
  .cmp-field, .cmp-input-wrap { min-width: 0; }
  .cmp-card-actions { flex-wrap: wrap; }
  .cmp-matrix-card .table-responsive { overflow-x: auto; overscroll-behavior-x: contain; }
  .cmp-table { min-width: 640px; table-layout: fixed; }
  .cmp-th-spec { width: 140px; }
  .cmp-th-item { width: 250px; }
  .cmp-table th, .cmp-table td { overflow-wrap: anywhere; }
  .cmp-th-spec, .cmp-th-item { padding: 16px 12px; }
  .cmp-row td { padding: 12px; font-size: 13px; }
  .cmp-card-title { font-size: 16px; }
  .cmp-card-price { font-size: 20px; }
  .cmp-card-actions .btn { white-space: normal; min-height: 40px; }
}

@media (max-width: 575px) {
  .cmp-page-container { padding-bottom: 40px; }
  .cmp-control-card { padding: 16px; margin-top: 20px; border-radius: 12px; }
  .cmp-mode-switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; margin-bottom: 0; }
  .cmp-mode-btn { justify-content: center; padding: 10px 6px; font-size: 12px; gap: 6px; min-height: 44px; }
  .cmp-mode-btn i { flex-shrink: 0; }
  .cmp-control-card > div > a { max-width: 100%; white-space: normal; overflow-wrap: anywhere; }
  .cmp-fields { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cmp-field-actions { flex-direction: column; align-items: stretch; gap: 10px; }
  .cmp-field-actions #btnRunCompare { margin-left: 0; width: 100%; min-height: 48px; justify-content: center; }
  .cmp-add-btn { width: 100%; justify-content: center; min-height: 46px; }
  .cmp-limit-note { text-align: center; }
  .cmp-input { font-size: 16px; padding-right: 10px; text-overflow: ellipsis; }
  .cmp-input::placeholder { font-size: 13px; }
  .cmp-dropdown-menu { max-height: 240px; }
  .cmp-suggest-item { flex-wrap: wrap; gap: 8px; padding: 10px; }
  .cmp-suggest-title, .cmp-suggest-sub { white-space: normal; overflow-wrap: anywhere; }
  .cmp-suggest-thumb { width: 36px; height: 36px; }
  .cmp-suggest-right { width: 100%; text-align: left; padding-left: 44px; }
  .cmp-matrix-card { margin-top: 24px; border-radius: 12px; overflow: visible; }
  .cmp-sticky-names {
    display: grid;
    height: 0;
    visibility: hidden;
    pointer-events: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    position: sticky;
    top: var(--header-height);
    z-index: 60;
    background: #ffffff;
  }
  .cmp-sticky-names.is-visible { visibility: visible; }
  .cmp-sticky-names span {
    background: #ffffff;
    border-bottom: 1px solid var(--color-border-slate);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
    min-width: 0;
    padding: 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--color-heading);
    overflow-wrap: anywhere;
  }
  .cmp-sticky-names span + span { border-left: 1px solid var(--color-border-slate); }
  .cmp-sticky-price { display: block; margin-top: 6px; color: var(--color-accent); font-size: 14px; }
  .cmp-sec-row td { letter-spacing: 0; padding: 10px 12px; }
  .cmp-table { display: block; min-width: 0; width: 100%; }
  .cmp-table thead, .cmp-table tbody { display: block; width: 100%; }
  .cmp-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cmp-table .cmp-th-spec { grid-column: 1 / -1; width: auto; text-align: left; padding: 12px; }
  .cmp-table .cmp-th-item { width: auto; min-width: 0; padding: 14px 10px; }
  .cmp-table .cmp-th-item:nth-child(2) { border-left: 0; }
  .cmp-table .cmp-sec-row td,
  .cmp-table .cmp-label-cell { grid-column: 1 / -1; }
  .cmp-table .cmp-label-cell { padding: 10px 12px; font-size: 12px; }
  .cmp-table .cmp-row td:not(:first-child) { min-width: 0; padding: 12px 10px; font-size: 12px; }
  .cmp-table .cmp-row td:nth-child(2) { border-left: 0; }
  .cmp-card-top { min-width: 0; height: 100%; }
  .cmp-card-title { font-size: 14px; line-height: 1.4; }
  .cmp-card-meta { font-size: 11px; }
  .cmp-card-meta .badge { white-space: normal; }
  .cmp-card-price { font-size: 18px; }
  .cmp-card-price .fs-6 { font-size: 11px !important; }
  .cmp-card-avatar { width: 56px; height: 56px; border-radius: 12px; }
  .cmp-card-media { height: auto; aspect-ratio: 4 / 3; }
  .cmp-card-actions { margin-top: auto; flex-direction: column; }
  .cmp-table .btn { max-width: 100%; white-space: normal; overflow-wrap: anywhere; font-size: 12px; padding: 8px !important; min-height: 40px; }
}
