/* Hide obsolete 1.3.x controls immediately, even on a cached page. */
    .gmhs3-results-toolbar,
    .gmhs3-load-more-wrap,
    .gmhs3-all-results {
      display: none !important;
    }

    .gmhs4-search-module,
    .my-home-search-wrap {
      overflow: visible !important;
    }

    .my-home-search-wrap {
      position: relative !important;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      margin: 20px 0 40px;
      z-index: 20;
    }

    .gmhs4-search-input,
    #my-home-search {
      flex: 1 1 auto;
      width: 60%;
      max-width: 400px;
      min-width: 0;
      padding: 10px 20px;
      border: 1px solid #ccc;
      border-radius: 25px;
      outline: none;
      background: #fff;
      color: #333;
      font-size: 15px;
      line-height: 1.4;
      box-sizing: border-box;
    }

    .gmhs4-search-input:focus,
    #my-home-search:focus {
      border-color: #888;
      box-shadow: 0 0 6px rgba(0, 0, 0, .15);
    }

    .gmhs4-search-button,
    #my-home-search-btn,
    .filter-reset-btn {
      flex: 0 0 auto;
      padding: 10px 28px;
      border: 1px solid #ccc;
      border-radius: 25px;
      background: linear-gradient(180deg, #f6f6f6 0%, #d9d9d9 100%);
      color: #222;
      cursor: pointer;
      font-size: 15px;
      font-weight: 600;
      line-height: 1.4;
    }

    .my-home-search-results {
      position: absolute !important;
      top: calc(100% + 8px) !important;
      left: 50% !important;
      z-index: 999999 !important;
      display: none;
      width: min(600px, 94vw) !important;
      max-width: 600px !important;
      transform: translateX(-50%) !important;
      box-sizing: border-box;
    }

    .my-home-search-results.is-open {
      display: block !important;
    }

    .live-search-results {
      display: block !important;
      width: 100% !important;
      max-height: min(420px, 65vh);
      overflow-y: auto;
      padding: 10px;
      border: 1px solid #ddd;
      border-radius: 10px;
      background: #fff;
      box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
      box-sizing: border-box;
    }

    .live-search-results[dir="rtl"] { text-align: right; }
    .live-search-results[dir="ltr"] { text-align: left; }

    .live-search-results .result-item {
      appearance: none;
      -webkit-appearance: none;
      display: flex !important;
      align-items: center;
      gap: 10px;
      width: 100% !important;
      min-height: 58px;
      margin: 0 !important;
      padding: 7px 8px !important;
      border: 0 !important;
      border-radius: 7px;
      background: transparent !important;
      color: inherit;
      text-align: inherit;
      cursor: pointer;
      font: inherit;
      box-shadow: none !important;
      box-sizing: border-box;
    }

    .live-search-results .result-item + .result-item {
      border-top: 1px solid #eee !important;
    }

    .live-search-results .result-item:hover,
    .live-search-results .result-item:focus {
      background: #f0f8ff !important;
      outline: none;
    }

    .live-search-results .result-item img {
      display: block !important;
      width: 45px !important;
      height: 45px !important;
      min-width: 45px !important;
      max-width: 45px !important;
      margin: 0 !important;
      border-radius: 8px;
      object-fit: cover;
    }

    .live-search-results .result-title {
      display: block;
      min-width: 0;
      color: #333;
      font-size: 14px;
      line-height: 1.5;
    }


    .gmhs4-live-correction {
      margin: 0 0 8px;
      padding: 8px 10px;
      border: 1px solid #bae6fd;
      border-radius: 8px;
      background: #f0f9ff;
      color: #075985;
      font-size: 12px;
      font-weight: 700;
      line-height: 1.6;
      text-align: center;
    }

    /* Independent search output. Original product containers remain untouched below it. */
    .gmhs4-search-output {
      display: none;
      width: 100% !important;
      max-width: none !important;
      margin: 0 0 28px !important;
      padding: 0 !important;
      clear: both !important;
      float: none !important;
      box-sizing: border-box !important;

      /* Fallback when a page builder places the search block inside a grid/flex row. */
      grid-column: 1 / -1 !important;
      grid-row: auto !important;
      flex: 0 0 100% !important;
      align-self: stretch !important;
      justify-self: stretch !important;
    }

    .gmhs4-search-output.is-visible {
      display: block !important;
    }

    .gmhs4-search-heading {
      width: 100%;
      margin: 0 0 16px;
      text-align: center;
    }

    .gmhs4-search-heading h2 {
      margin: 0;
    }

    .gmhs4-results-toolbar {
      display: none;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      gap: 12px;
      width: 100%;
      margin: 0 0 18px;
      padding: 10px 12px;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      background: #fff;
      box-sizing: border-box;
    }

    .gmhs4-results-toolbar.is-visible {
      display: flex !important;
    }

    .gmhs4-results-limit {
      display: inline-flex;
      align-items: center;
      gap: 8px;
      margin: 0;
      white-space: nowrap;
      color: #374151;
      font-size: 14px;
      font-weight: 600;
    }

    .gmhs4-results-limit select {
      display: block !important;
      flex: 0 0 84px;
      width: 84px !important;
      min-width: 84px;
      max-width: 84px !important;
      height: 38px;
      margin: 0;
      padding: 4px 26px 4px 8px;
      direction: ltr;
      text-align: center;
      text-align-last: center;
      border: 1px solid #d1d5db;
      border-radius: 8px;
      background-color: #fff;
      color: #111827;
      font-size: 14px;
      cursor: pointer;
      box-sizing: border-box;
    }

    .gmhs4-results-count {
      color: #1f2937;
      font-size: 14px;
      font-weight: 700;
      line-height: 1.6;
    }

    .gmhs4-correction-note {
      display: none;
      width: 100%;
      padding-top: 2px;
      color: #075985;
      font-size: 13px;
      line-height: 1.6;
      text-align: center;
    }

    .gmhs4-correction-note.is-visible {
      display: block;
    }

    .gmhs4-results-container {
      display: block !important;
      width: 100% !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
      clear: both !important;
      float: none !important;
      box-sizing: border-box !important;
    }

    .gmhs4-results-grid {
      display: grid !important;
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      gap: 18px !important;
      width: 100% !important;
      margin: 0 !important;
      padding: 0 !important;
      box-sizing: border-box !important;
    }

    .gmhs4-product-card {
      display: block !important;
      width: auto !important;
      min-width: 0 !important;
      max-width: none !important;
      margin: 0 !important;
      padding: 0 !important;
      border: 1px solid #e5e7eb;
      border-radius: 10px;
      background: #fff;
      overflow: hidden;
      float: none !important;
      clear: none !important;
      position: relative !important;
      transform: none !important;
      box-sizing: border-box !important;
    }

    .gmhs4-product-card > a {
      display: flex !important;
      flex-direction: column;
      height: 100%;
      padding: 10px;
      color: inherit;
      text-decoration: none;
      box-sizing: border-box;
    }

    .gmhs4-product-card img {
      display: block !important;
      width: 100% !important;
      height: auto !important;
      aspect-ratio: 1 / 1;
      margin: 0 !important;
      object-fit: contain;
    }

    .gmhs4-product-card h3 {
      margin: 10px 0 6px;
      font-size: 15px;
      line-height: 1.5;
    }

    .gmhs4-product-card .price {
      display: block;
      margin-top: auto;
    }

    .gmhs4-live-message,
    .gmhs4-loading-message,
    .gmhs4-empty-message,
    .gmhs4-error-message {
      width: 100%;
      padding: 12px;
      margin: 0;
      border-radius: 10px;
      text-align: center;
      font-size: 14px;
      box-sizing: border-box;
    }

    .gmhs4-searching-card {
      position: relative;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 14px;
      width: 100%;
      min-height: 92px;
      padding: 18px 20px;
      overflow: hidden;
      border: 1px solid #93c5fd;
      border-radius: 14px;
      background: linear-gradient(110deg, #eff6ff 0%, #ffffff 45%, #ecfeff 100%);
      box-shadow: 0 8px 24px rgba(14, 116, 144, .10);
      color: #0c4a6e;
      box-sizing: border-box;
    }

    .gmhs4-searching-card::before {
      content: '';
      position: absolute;
      inset: 0;
      transform: translateX(-110%);
      background: linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent);
      animation: gmhs4-search-shimmer 1.6s infinite;
      pointer-events: none;
    }

    .gmhs4-searching-card.is-compact {
      min-height: 68px;
      padding: 12px 14px;
      border-radius: 10px;
      box-shadow: none;
    }

    .gmhs4-search-icon {
      position: relative;
      z-index: 1;
      display: grid;
      place-items: center;
      flex: 0 0 44px;
      width: 44px;
      height: 44px;
      border-radius: 50%;
      background: #fff;
      box-shadow: 0 4px 14px rgba(2, 132, 199, .20);
      font-size: 23px;
      animation: gmhs4-search-pulse 1.2s ease-in-out infinite;
    }

    .gmhs4-search-copy {
      position: relative;
      z-index: 1;
      display: flex;
      flex-direction: column;
      align-items: flex-start;
      min-width: 0;
      text-align: start;
    }

    .gmhs4-search-copy strong {
      color: #0c4a6e;
      font-size: 15px;
      line-height: 1.5;
    }

    .gmhs4-search-query {
      display: inline-block;
      max-width: 100%;
      margin-top: 4px;
      padding: 3px 9px;
      overflow: hidden;
      border: 1px solid #bae6fd;
      border-radius: 999px;
      background: rgba(255,255,255,.85);
      color: #075985;
      font-size: 13px;
      font-weight: 700;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .gmhs4-search-subtext {
      margin-top: 5px;
      color: #527085;
      font-size: 12px;
      line-height: 1.5;
    }

    .gmhs4-search-dots {
      display: inline-flex;
      gap: 4px;
      margin-inline-start: 5px;
      vertical-align: middle;
    }

    .gmhs4-search-dots i {
      display: block;
      width: 5px;
      height: 5px;
      border-radius: 50%;
      background: #0284c7;
      animation: gmhs4-search-dot 1.1s infinite ease-in-out;
    }

    .gmhs4-search-dots i:nth-child(2) { animation-delay: .15s; }
    .gmhs4-search-dots i:nth-child(3) { animation-delay: .30s; }

    .gmhs4-infinite-status {
      display: none;
      width: 100%;
      margin: 18px 0 2px;
    }

    .gmhs4-infinite-status.is-visible { display: block; }
    .gmhs4-infinite-status .gmhs4-searching-card { min-height: 72px; }

    @keyframes gmhs4-search-shimmer {
      100% { transform: translateX(110%); }
    }

    @keyframes gmhs4-search-pulse {
      0%, 100% { transform: scale(1); }
      50% { transform: scale(1.09); }
    }

    @keyframes gmhs4-search-dot {
      0%, 70%, 100% { transform: translateY(0); opacity: .35; }
      35% { transform: translateY(-4px); opacity: 1; }
    }

    .gmhs4-empty-message {
      border: 1px solid #e5e7eb;
      background: #f9fafb;
      color: #374151;
    }

    .gmhs4-error-message {
      border: 1px solid #fecaca;
      background: #fef2f2;
      color: #b91c1c;
    }

    .gmhs4-load-more-wrap {
      display: none;
      justify-content: center;
      width: 100%;
      margin: 24px 0 8px;
    }

    .gmhs4-load-more-wrap.is-visible {
      display: block !important;
      width: 100% !important;
      height: 1px !important;
      min-height: 1px !important;
      margin: 0 !important;
      padding: 0 !important;
      overflow: hidden !important;
      visibility: hidden !important;
      pointer-events: none !important;
    }

    .gmhs4-load-more-button {
      display: none !important;
      min-width: 170px;
      padding: 11px 24px;
      border: 1px solid #cbd5e1;
      border-radius: 25px;
      background: linear-gradient(180deg, #fff 0%, #e5e7eb 100%);
      color: #111827;
      cursor: pointer;
      font-size: 15px;
      font-weight: 700;
      line-height: 1.4;
    }

    .gmhs4-load-more-button:disabled {
      cursor: wait;
      opacity: .7;
    }

    .gmhs4-all-results {
      display: none;
      width: 100%;
      margin: 20px 0 0;
      text-align: center;
      color: #6b7280;
      font-size: 14px;
    }

    .gmhs4-all-results.is-visible {
      display: block;
    }

    @media (max-width: 900px) {
      .gmhs4-results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      }
    }

    @media (max-width: 650px) {
      .my-home-search-wrap { gap: 8px; }

      .gmhs4-search-input,
      #my-home-search {
        width: 72%;
        font-size: 14px;
      }

      .gmhs4-search-button,
      #my-home-search-btn {
        padding: 8px 16px;
        font-size: 14px;
      }

      .my-home-search-results {
        left: 0 !important;
        width: 100% !important;
        max-width: none !important;
        transform: none !important;
      }

      .gmhs4-results-toolbar {
        align-items: stretch;
      }

      .gmhs4-results-limit {
        width: 100%;
        justify-content: space-between;
      }

      .gmhs4-results-count {
        width: 100%;
        text-align: center;
      }

      .gmhs4-results-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
      }
    }

    @media (max-width: 380px) {
      .gmhs4-results-grid {
        grid-template-columns: 1fr !important;
      }
    }
