.catlo-ui-responsive-search {
    --catlo-search-primary: #0d9ecc;
    --catlo-search-primary-hover: #087fa5;
    --catlo-search-border: #cbd5e1;
    --catlo-search-text: #111827;
    display: grid;
    width: 100%;
    grid-template-columns: minmax(260px, 2fr) minmax(140px, .9fr) minmax(150px, 1fr) auto;
    gap: 10px;
    align-items: end;
  }
  .catlo-ui-responsive-search__quick,
  .catlo-ui-search-filter-sheet,
  .catlo-ui-search-filter-sheet__panel,
  .catlo-ui-search-filter-sheet__body { display: contents; }
  .catlo-ui-responsive-search__keyword { min-width: 0; grid-column: 1; grid-row: 1; }
  .catlo-ui-responsive-search__label,
  .catlo-ui-responsive-search__field > span {
    display: block;
    margin: 0 0 6px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
  }
  .catlo-ui-responsive-search__keyword-control {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    height: 48px;
    align-items: center;
    border: 1px solid var(--catlo-search-border);
    border-radius: 10px;
    background: #fff;
  }
  .catlo-ui-responsive-search__keyword-control svg,
  .catlo-ui-responsive-search__submit svg,
  .catlo-ui-responsive-search__filter-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .catlo-ui-responsive-search__keyword-control svg { margin-left: 12px; color: #7b8ba1; }
  .catlo-ui-responsive-search__keyword-control input {
    box-sizing: border-box;
    width: 100%;
    height: 46px;
    min-width: 0;
    margin: 0;
    padding: 0 12px 0 6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--catlo-search-text);

  }
  .catlo-ui-responsive-search__keyword-control:hover { border-color: #94a3b8; }
  .catlo-ui-responsive-search__keyword-control:focus-within {
    border-color: var(--catlo-search-primary);
    outline: 0;
    box-shadow: 0 0 0 3px rgba(13, 158, 204, .18);
  }
  .catlo-ui-responsive-search .catlo-ui-responsive-search__keyword-control input:focus,
  .catlo-ui-responsive-search .catlo-ui-responsive-search__keyword-control input:focus-visible {
    outline: 0;
    box-shadow: none;
  }
  .catlo-ui-responsive-search__field select:focus {
    border-color: var(--catlo-search-primary);
    outline: 3px solid rgba(13, 158, 204, .18);
  }
  .catlo-ui-responsive-search__field { display: block; min-width: 0; }
  .catlo-ui-responsive-search__field--category { grid-column: 2; grid-row: 1; }
  .catlo-ui-responsive-search__field--province { grid-column: 3; grid-row: 1; }
  .catlo-ui-responsive-search__field select {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    min-height: 48px;
    margin: 0;
    padding: 0 38px 0 12px;
    border: 1px solid var(--catlo-search-border);
    border-radius: 10px;
    background-color: #fff;
    color: var(--catlo-search-text);

  }
  .catlo-ui-responsive-search__field select:disabled { color: #94a3b8; background-color: #f8fafc; }
  .catlo-ui-responsive-search__submit {
    display: inline-flex;
    min-width: 138px;
    min-height: 48px;
    grid-column: 4;
    grid-row: 1;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    padding: 0 20px;
    border: 0;
    border-radius: 10px;
    background: var(--catlo-search-primary);
    color: #fff;
    font-weight: 700;
    white-space: nowrap;
  }
  .catlo-ui-responsive-search__submit:hover,
  .catlo-ui-search-filter-sheet__apply:hover { background: var(--catlo-search-primary-hover); }
  .catlo-ui-responsive-search__filter-trigger,
  .catlo-ui-responsive-search__chips,
  .catlo-ui-search-filter-sheet__backdrop,
  .catlo-ui-search-filter-sheet__header,
  .catlo-ui-search-filter-sheet__footer { display: none; }

  @media (min-width: 1024px) {
    .catlo-ui-responsive-search__label,
    .catlo-ui-responsive-search__field > span {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      clip-path: inset(50%);
      white-space: nowrap;
      border: 0;
    }
  }

  @media (min-width: 768px) and (max-width: 1023px) {
    .catlo-ui-responsive-search { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 12px; }
    .catlo-ui-responsive-search__keyword { grid-column: 1; grid-row: 1; }
    .catlo-ui-responsive-search__submit { width: 100%; min-width: 0; grid-column: 2; grid-row: 1; }
    .catlo-ui-responsive-search__field--category { grid-column: 1; grid-row: 2; }
    .catlo-ui-responsive-search__field--province { grid-column: 2; grid-row: 2; }
  }

  @media (max-width: 767px) {
    .catlo-ui-responsive-search { display: block; }
    .catlo-ui-responsive-search__quick { display: flex; align-items: flex-end; gap: 8px; }
    .catlo-ui-responsive-search__keyword { flex: 1 1 auto; }
    .catlo-ui-responsive-search__label { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .catlo-ui-responsive-search__keyword-control { height: 48px; }
    .catlo-ui-responsive-search__submit { width: 48px; min-width: 48px; min-height: 48px; padding: 0; }
    .catlo-ui-responsive-search__submit span { position: fixed; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
    .catlo-ui-responsive-search__filter-trigger {
      display: inline-flex;
      min-width: 88px;
      min-height: 48px;
      align-items: center;
      justify-content: center;
      gap: 5px;
      margin: 0;
      padding: 0 10px;
      border: 1px solid #b9c7d5;
      border-radius: 10px;
      background: #fff;
      color: #334155;
      font-weight: 700;
    }
    .catlo-ui-responsive-search__filter-count {
      display: grid;
      width: 20px;
      height: 20px;
      place-items: center;
      border-radius: 50%;
      background: var(--catlo-search-primary);
      color: #fff;
      font-size: 11px;
    }
    .catlo-ui-responsive-search__chips {
      display: flex;
      max-width: 100%;
      gap: 6px;
      margin-top: 8px;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .catlo-ui-responsive-search__chips::-webkit-scrollbar { display: none; }
    .catlo-ui-responsive-search__chip {
      display: inline-flex;
      min-height: 38px;
      flex: 0 0 auto;
      align-items: center;
      gap: 6px;
      margin: 0;
      padding: 6px 10px;
      border: 1px solid #c5dce5;
      border-radius: 999px;
      background: #f3fbfd;
      color: #17677d;
      font-size: 12px;
      font-weight: 700;
    }
    .catlo-ui-search-filter-sheet { display: none; }
    .catlo-ui-search-filter-sheet.is-open { display: block; position: fixed; z-index: 10050; inset: 0; }
    .catlo-ui-search-filter-sheet__backdrop {
      display: block;
      position: fixed;
      z-index: 1;
      inset: 0;
      width: 100%;
      height: 100%;
      margin: 0;
      padding: 0;
      border: 0;
      background: rgba(15, 23, 42, .45);
    }
    .catlo-ui-search-filter-sheet__panel {
      display: flex;
      position: fixed;
      z-index: 2;
      right: 0;
      bottom: 0;
      left: 0;
      max-height: 88vh;
      flex-direction: column;
      border-radius: 18px 18px 0 0;
      background: #fff;
      box-shadow: 0 -12px 32px rgba(15, 23, 42, .2);
    }
    .catlo-ui-search-filter-sheet__header {
      display: flex;
      min-height: 58px;
      flex: 0 0 auto;
      align-items: center;
      justify-content: space-between;
      padding: 8px 14px 8px 18px;
      border-bottom: 1px solid #e5eaf0;
    }
    .catlo-ui-search-filter-sheet__header h2 { margin: 0; color: #172033; font-size: 19px; }
    .catlo-ui-search-filter-sheet__header button {
      width: 44px;
      height: 44px;
      margin: 0;
      padding: 0;
      border: 0;
      border-radius: 9px;
      background: #f5f7f9;
      color: #334155;
      font-size: 26px;
    }
    .catlo-ui-search-filter-sheet__body {
      display: grid;
      grid-template-columns: minmax(0, 1fr);
      gap: 16px;
      overflow-y: auto;
      padding: 18px;
      overscroll-behavior: contain;
    }
    .catlo-ui-search-filter-sheet__body .catlo-ui-responsive-search__field {
      width: 100%;
      grid-column: auto;
      grid-row: auto;
    }
    .catlo-ui-search-filter-sheet__footer {
      display: grid;
      grid-template-columns: minmax(100px, .7fr) minmax(0, 1.3fr);
      gap: 10px;
      flex: 0 0 auto;
      padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
      border-top: 1px solid #e5eaf0;
      background: #fff;
    }
    .catlo-ui-search-filter-sheet__footer button {
      min-height: 48px;
      margin: 0;
      border-radius: 10px;
      font-weight: 700;
    }
    .catlo-ui-search-filter-sheet__reset { border: 1px solid #b9c7d5; background: #fff; color: #334155; }
    .catlo-ui-search-filter-sheet__apply { border: 0; background: var(--catlo-search-primary); color: #fff; }
    body.catlo-ui-responsive-search-lock { overflow: hidden; }
  }

  /* text-fit-v2 is independently reversible and keeps the legacy form DOM. */
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] {
    width: 100%;
    min-width: 0;
    container-type: inline-size;
    container-name: catlo-responsive-search;
  }
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control input,
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field select {
    min-inline-size: 0;
    max-inline-size: 100%;
    font-size: clamp(15px, 1.15cqi, 16px);
    line-height: 1.4;
  }
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field select {
    inline-size: 100%;
    padding-inline: 14px 42px;
  }
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__label,
  .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field > span {
    font-size: clamp(12px, 1cqi, 14px);
    line-height: 1.4;
  }

  @container catlo-responsive-search (min-width: 900px) {
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search {
      grid-template-columns: minmax(320px, 2fr) minmax(160px, .85fr) minmax(180px, 1fr) max-content;
      gap: 10px;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__submit {
      width: auto;
      min-width: 120px;
      grid-column: 4;
      grid-row: 1;
      padding-inline: 14px;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field select {
      padding-inline: 6px 24px;
      font-size: clamp(12px, 1.25cqi, 14px);
    }
  }

  @container catlo-responsive-search (min-width: 768px) and (max-width: 899px) {
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 12px;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__quick {
      display: grid;
      grid-template-columns: minmax(0, 1fr) max-content;
      grid-column: 1 / -1;
      grid-row: 1;
      gap: 12px;
      align-items: end;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword {
      grid-column: 1;
      grid-row: 1;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__submit {
      width: auto;
      min-width: 138px;
      grid-column: 2;
      grid-row: 1;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field--category {
      grid-column: 1;
      grid-row: 2;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field--province {
      grid-column: 2;
      grid-row: 2;
    }
  }

  @media (max-width: 767px) {
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control input,
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__field select {
      font-size: 16px;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control {
      grid-template-columns: minmax(0, 1fr);
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control > svg {
      display: none;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control input {
      padding-inline: 8px;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__keyword-control input::placeholder {
      color: #64748b;
      font-size: clamp(11px, 3.05vw, 13px);
      opacity: 1;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__submit {
      width: 44px;
      min-width: 44px;
      min-height: 48px;
      padding: 0;
      border: 1px solid #b9c7d5;
      background: transparent;
      color: #334155;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__submit:hover,
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__submit:focus-visible {
      background: #f5f7f9;
      color: #0f172a;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__quick {
      gap: 6px;
      align-items: center;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__filter-trigger {
      position: relative;
      width: 44px;
      min-width: 44px;
      padding: 0;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__filter-trigger > span:not(.catlo-ui-responsive-search__filter-count) {
      position: fixed;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }
    .catlo-ui-responsive-search-shell[data-catlo-search-text-fit="1"] .catlo-ui-responsive-search__filter-count {
      position: absolute;
      top: -6px;
      right: -5px;
    }
  }
