.ec-app {
  --ec-indigo: #1912d5;
  --ec-indigo-dark: #1109a9;
  --ec-ink: #141526;
  --ec-muted: #66697a;
  --ec-line: #dfe1ef;
  --ec-soft: #f7f6fc;
  --ec-card: #ffffff;
  --ec-module-max-width: 1180px;
  color: var(--ec-ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ec-app *,
.ec-app *::before,
.ec-app *::after {
  box-sizing: border-box;
}

.ec-app.ec-full-bleed {
  position: relative !important;
  left: 50% !important;
  width: 100vw !important;
  max-width: 100vw !important;
  margin-right: 0 !important;
  margin-left: -50vw !important;
}

.ec-compare-shell {
  padding: 32px 0 72px;
}

.ec-background-soft .ec-compare-shell { background: var(--ec-soft); }
.ec-background-white .ec-compare-shell { background: #fff; }
.ec-background-transparent .ec-compare-shell { background: transparent; }

.ec-container {
  width: min(var(--ec-module-max-width), calc(100% - 40px)) !important;
  max-width: none !important;
  margin-inline: auto !important;
  padding: 0 !important;
}

.ec-has-overlap .ec-compare-shell {
  padding-top: 0;
}

.ec-has-overlap .ec-filter {
  margin-top: -58px;
}

.ec-filter {
  position: relative;
  z-index: 3;
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 16px;
  margin: 0;
  padding: 24px;
  border: 1px solid rgba(223, 225, 239, 0.95);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 20px 50px rgba(31, 34, 76, 0.12);
}

.ec-field { min-width: 0; }

.ec-field label,
.ec-sort-wrap label {
  display: block;
  margin: 0 0 7px;
  color: #2e3041;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 600;
}

.ec-field input,
.ec-field select,
.ec-sort {
  width: 100%;
  height: 44px;
  margin: 0;
  border: 1px solid #d7d9e8;
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: #343648;
  font: inherit;
  font-size: 14px;
  outline: 0;
  box-shadow: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ec-field input:focus,
.ec-field select:focus,
.ec-sort:focus {
  border-color: var(--ec-indigo);
  box-shadow: 0 0 0 3px rgba(25, 18, 213, 0.12);
}

.ec-filter__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-self: end;
}

.ec-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 17px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.ec-button:hover { transform: translateY(-1px); }

.ec-button--primary {
  background: var(--ec-indigo);
  color: #fff;
  box-shadow: 0 9px 20px rgba(25, 18, 213, 0.2);
}

.ec-button--primary:hover { background: var(--ec-indigo-dark); color: #fff; }
.ec-button--muted { background: #e8eafd; color: #303249; }

.ec-button--outline {
  min-height: 38px;
  border-color: #8d88ff;
  background: #fff;
  color: var(--ec-indigo);
  white-space: nowrap;
}

.ec-button--outline:hover { background: #f0efff; color: var(--ec-indigo-dark); }
.ec-button[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }

.ec-results {
  scroll-margin-top: 24px;
  padding-top: 38px;
}

.ec-results__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.ec-results h2 {
  margin: 0;
  color: #171827;
  font-size: 26px;
  line-height: 1.25;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.ec-results__summary {
  margin: 5px 0 0;
  color: var(--ec-muted);
  font-size: 14px;
}

.ec-sort-wrap { width: 190px; flex: 0 0 auto; }

.ec-app .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ec-grid {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
}

.ec-plan-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dcdeec;
  border-radius: 10px;
  background: var(--ec-card);
  box-shadow: 0 4px 18px rgba(31, 36, 67, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ec-plan-card:hover {
  transform: translateY(-3px);
  border-color: #c6c8e9;
  box-shadow: 0 14px 30px rgba(31, 36, 67, 0.09);
}

.ec-plan-card__provider {
  display: flex;
  min-height: 47px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e6f0;
  background: #f2f3ff;
}

.ec-provider-name {
  overflow: hidden;
  color: #34364b;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ec-provider-badge {
  flex: 0 0 auto;
  border-radius: 4px;
  padding: 4px 6px;
  background: var(--ec-indigo);
  color: #fff;
  font-size: 10px;
  line-height: 1;
  font-weight: 700;
}

.ec-plan-card__body {
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 16px;
}

.ec-plan-card__title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 49px;
  margin: 0 0 14px;
  color: var(--ec-indigo);
  font-size: 19px;
  line-height: 1.32;
  font-weight: 750;
  letter-spacing: -0.02em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ec-plan-card__meta {
  display: grid;
  gap: 10px;
  color: #55586c;
  font-size: 13px;
}

.ec-meta-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 7px;
  align-items: start;
}

.ec-meta-row__icon { color: #202338; font-size: 14px; line-height: 1.25; }

.ec-meta-row span:last-child {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ec-plan-card__footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #edeef5;
}

.ec-price { display: grid; gap: 2px; min-width: 0; }
.ec-price__old { color: #6f7283; font-size: 12px; }
.ec-price__current { color: #10111d; font-size: 21px; line-height: 1.1; letter-spacing: -0.03em; }

.ec-pagination {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 28px;
}

.ec-page-button,
.ec-page-ellipsis {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid #d3d5e6;
  border-radius: 8px;
  background: #fff;
  color: #383a4d;
  font: inherit;
  font-size: 14px;
}

.ec-page-button { cursor: pointer; }
.ec-page-button:hover:not(:disabled),
.ec-page-button.is-current { border-color: var(--ec-indigo); background: var(--ec-indigo); color: #fff; }
.ec-page-button:disabled { cursor: not-allowed; opacity: 0.45; }
.ec-page-ellipsis { border-color: transparent; background: transparent; }

.ec-message {
  grid-column: 1 / -1;
  border: 1px dashed #cfd2e5;
  border-radius: 12px;
  padding: 34px;
  background: rgba(255, 255, 255, 0.75);
  color: #64677b;
  text-align: center;
}

.ec-message--error { border-color: #f3b6b6; background: #fff6f6; color: #9a2a2a; }

.ec-skeleton {
  min-height: 298px;
  padding: 18px;
  animation: ec-pulse 1.3s ease-in-out infinite;
}

.ec-skeleton > div {
  height: 15px;
  margin-bottom: 15px;
  border-radius: 6px;
  background: #eceef6;
}

.ec-skeleton > div:first-child { width: 62%; height: 22px; }
.ec-skeleton > div:nth-child(2) { width: 88%; }
.ec-skeleton > div:nth-child(3) { width: 72%; }
.ec-skeleton > div:last-child { width: 45%; height: 38px; margin-top: 80px; margin-bottom: 0; }

@keyframes ec-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@media (max-width: 1040px) {
  .ec-filter { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ec-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .ec-container { width: min(100% - 28px, 720px); }
  .ec-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 18px; }
  .ec-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .ec-app.ec-full-bleed { width: 100%; margin-left: 0; margin-right: 0; }
  .ec-container { width: min(100% - 22px, 520px); }
  .ec-has-overlap .ec-filter { margin-top: -42px; }
  .ec-filter { grid-template-columns: 1fr; border-radius: 12px; }
  .ec-filter__actions { grid-template-columns: 1fr; }
  .ec-results__header { align-items: stretch; flex-direction: column; gap: 14px; }
  .ec-sort-wrap { width: 100%; }
  .ec-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ec-app *,
  .ec-app *::before,
  .ec-app *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}


/* Theme isolation: keep the comparison module stable across block/classic themes. */
.ec-app {
  display: block !important;
  position: relative !important;
  clear: both !important;
  isolation: isolate;
  width: auto;
  max-width: none;
  margin-block: 0 !important;
  padding: 0 !important;
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
  text-indent: 0;
  text-transform: none;
  letter-spacing: normal;
}

.ec-app :where(section, form, article, div, nav, header, footer, h1, h2, h3, h4, p, span, label, dl, dt, dd) {
  min-width: 0;
  float: none;
}

.ec-app :where(h1, h2, h3, h4, p, form, dl) {
  margin-block-start: 0;
}

.ec-app :where(button, input, select, textarea, a) {
  font-family: inherit !important;
  font-style: normal !important;
  letter-spacing: normal !important;
  text-transform: none !important;
}

.ec-app :where(button, input, select, textarea) {
  max-width: 100% !important;
}

.ec-app button,
.ec-app [type="button"],
.ec-app [type="submit"],
.ec-app [type="reset"] {
  width: auto !important;
  appearance: none;
  -webkit-appearance: none;
}

.ec-app select {
  appearance: auto;
  -webkit-appearance: menulist;
}

.ec-app .ec-compare-shell,
.ec-app .ec-filter,
.ec-app .ec-results,
.ec-app .ec-grid {
  width: 100%;
  max-width: none;
}

.ec-app .ec-filter {
  float: none !important;
}

.ec-app .ec-results h2,
.ec-app .ec-plan-card__title {
  font-family: inherit !important;
}

@supports (width: 100dvw) {
  .ec-app.ec-full-bleed {
    width: 100dvw !important;
    max-width: 100dvw !important;
    margin-left: -50dvw !important;
  }
}

@media (max-width: 560px) {
  .ec-app.ec-full-bleed {
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* Layout refinement 1.3.4: compact labels and keep both actions on row two. */
.ec-app .ec-field {
  display: flex !important;
  min-width: 0 !important;
  flex-direction: column !important;
  align-self: end !important;
  gap: 6px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ec-app .ec-field > label {
  display: block !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
}

.ec-app .ec-field > input,
.ec-app .ec-field > select {
  display: block !important;
  margin: 0 !important;
}

.ec-app .ec-filter__actions {
  display: flex !important;
  min-width: 0 !important;
  flex-direction: row !important;
  align-items: stretch !important;
  align-self: end !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.ec-app .ec-filter__actions > .ec-button {
  width: 100% !important;
  min-width: 0 !important;
  flex: 1 1 0 !important;
  margin: 0 !important;
  padding-right: 10px !important;
  padding-left: 10px !important;
  white-space: nowrap !important;
}

@media (min-width: 1041px) {
  .ec-app .ec-filter {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    grid-auto-flow: row !important;
    align-items: end !important;
    column-gap: 16px !important;
    row-gap: 12px !important;
  }

  .ec-app .ec-filter > .ec-field:nth-of-type(1) { grid-column: 1 !important; grid-row: 1 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(2) { grid-column: 2 !important; grid-row: 1 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(3) { grid-column: 3 !important; grid-row: 1 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(4) { grid-column: 4 !important; grid-row: 1 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(5) { grid-column: 1 !important; grid-row: 2 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(6) { grid-column: 2 !important; grid-row: 2 !important; }
  .ec-app .ec-filter > .ec-field:nth-of-type(7) { grid-column: 3 !important; grid-row: 2 !important; }
  .ec-app .ec-filter > .ec-filter__actions {
    grid-column: 4 !important;
    grid-row: 2 !important;
  }
}

@media (max-width: 560px) {
  .ec-app .ec-filter__actions {
    flex-direction: column !important;
  }
}


/* 1.3.9: không render kết quả trước khi khách chủ động tìm kiếm. */
.ec-app .ec-results[hidden] {
  display: none !important;
}
