@media (max-width: 767px), (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
  /* App header layout */
  #gstore-mobile-header.gstore-header-app {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 10000;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-radius: 0;
  }

  #gstore-mobile-header.gstore-header-app .header-main {
    width: 100%;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  #gstore-mobile-header.gstore-header-app .header-logo {
    height: 44px;
    width: auto;
    object-fit: contain;
    cursor: pointer;
    padding-top: 2px;
    padding-bottom: 2px;
    margin: 0;
    display: block;
  }

  #gstore-mobile-header.gstore-header-app .icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #gstore-mobile-header.gstore-header-app .search-bar-container {
    display: none;
    align-items: center;
    width: 100%;
    height: 60px;
    gap: 8px;
    margin: 0;
  }

  #gstore-mobile-header.gstore-header-app .search-bar-container form {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    margin: 0;
  }

  #gstore-mobile-header.gstore-header-app.is-search-open .header-main {
    display: none;
  }

  #gstore-mobile-header.gstore-header-app.is-search-open .search-bar-container {
    display: flex;
  }

  #gstore-mobile-header.gstore-header-app .search-input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.5);
    font-size: 1rem;
    font-family: 'TBC Contractica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    outline: none;
    transition: all 0.3s ease;
    height: 40px;
    min-width: 0;
  }

  #gstore-mobile-header.gstore-header-app .search-input::placeholder {
    font-family: 'TBC Contractica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-transform: uppercase;
  }

  #gstore-mobile-header.gstore-header-app .search-input:focus {
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
  }

  body.dark-mode #gstore-mobile-header.gstore-header-app .search-input {
    background: rgba(255,255,255,0.1);
    color: #fff;
    border-color: rgba(255,255,255,0.2);
  }

  #gstore-mobile-header.gstore-header-app .gstore-header-search-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Results wrapper (map to app styles) */
  #gstore-mobile-header.gstore-header-app .wd-search-results-wrapper {
    position: fixed;
    left: 6px;
    right: 28px;
    top: 70px;
    z-index: 10001;
    animation: fadeIn 0.3s ease;
    display: none;
  }

  #gstore-mobile-header.gstore-header-app .wd-search-results {
    display: block !important;
    background: rgba(255, 255, 255, 0.65) !important;
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    width: 100%;
    overflow: hidden !important;
  }

  #gstore-mobile-header.gstore-header-app .wd-search-results {
    max-height: calc(100dvh - 140px - var(--wd-toolbar-h, 76px));
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(var(--wd-toolbar-h, 76px) + env(safe-area-inset-bottom, 0px));
  }

  /* Live search tiles (map to app suggestion styles) */
  #gstore-mobile-header.gstore-header-app .gstore-search-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile {
    background: rgba(255, 255, 255, 0.7) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 8px !important;
    padding: 6px !important;
    display: flex !important;
    gap: 6px !important;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    align-items: flex-start !important;
    min-height: 78px;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile:active {
    transform: scale(0.98);
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-link {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-image {
    width: 44px !important;
    height: 44px !important;
    padding-top: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
    background: #fff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-image-track,
  #gstore-mobile-header.gstore-header-app .gstore-search-tile-image-slide {
    position: absolute !important;
    inset: 0 !important;
    opacity: 1 !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-image-dots {
    display: none !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-info {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.2;
    margin: 0 0 2px;
    color: #333;
    font-weight: 500;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-price {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    align-self: flex-start;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-price-old {
    font-size: 7px;
    color: #888;
    text-decoration: line-through;
    font-weight: 500;
    line-height: 1.2;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile-price-current {
    font-size: 8px;
    color: #e60023;
    font-weight: 700;
    line-height: 1.2;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-view-all {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    margin-top: 10px;
    font-size: 13px;
    color: #333;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-weight: 500;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-view-all:hover {
    background: rgba(255, 255, 255, 0.8);
  }

  #gstore-mobile-header.gstore-header-app .gstore-popular-searches {
    padding: 10px;
  }

  #gstore-mobile-header.gstore-header-app .gstore-popular-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'TBC Contractica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  }

  #gstore-mobile-header.gstore-header-app .gstore-popular-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  #gstore-mobile-header.gstore-header-app .gstore-popular-tag {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-family: 'TBC Contractica', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-decoration: none !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-popular-tag:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
  }

  body.gstore-side-menu-open #gstore-mobile-header.gstore-header-app,
  body.mini-cart-open #gstore-mobile-header.gstore-header-app,
  body.gstore-mobile-nav-open #gstore-mobile-header.gstore-header-app {
    transform: translateY(-150%);
    opacity: 0;
    pointer-events: none;
  }
}

@media (max-width: 767px), (max-width: 1024px) and (orientation: portrait) {
  /* Mobile/tablet live search overrides (force app card layout) */
  .gstore-header-search .wd-search-results-wrapper,
  .wd-search-results-wrapper {
    position: fixed;
    left: 6px;
    right: 28px;
    top: 70px;
    z-index: 10001;
  }

  .gstore-header-search .wd-search-results-wrapper.is-active,
  .wd-search-results-wrapper.is-active {
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(18px) saturate(180%);
    -webkit-backdrop-filter: blur(18px) saturate(180%);
    border-radius: 12px;
  }

  .gstore-header-search .wd-search-results,
  .wd-search-results {
    background: rgba(255, 255, 255, 0.82) !important;
    backdrop-filter: blur(22px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(180%) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 10px !important;
    padding: 10px !important;
    max-height: calc(100dvh - 140px - var(--wd-toolbar-h, 76px)) !important;
    overflow-y: auto !important;
  }

  .gstore-search-tiles-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .gstore-search-tile {
    display: flex !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 6px !important;
    background: rgba(255, 255, 255, 0.7) !important;
    border-radius: 8px !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    min-height: 45px !important;
  }

  .gstore-search-tile-link {
    display: flex !important;
    gap: 6px !important;
    width: 100% !important;
    text-decoration: none !important;
    color: inherit !important;
  }

  .gstore-search-tile-image {
    width: 44px !important;
    height: 44px !important;
    padding-top: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    background: #fff !important;
    flex: 0 0 auto !important;
    position: relative !important;
  }

  .gstore-search-tile-image-track,
  .gstore-search-tile-image-slide {
    position: absolute !important;
    inset: 0 !important;
  }

  .gstore-search-tile-image-slide {
    opacity: 1 !important;
  }

  .gstore-search-tile-image-slide img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    display: block !important;
  }

  /* Valentines badge on compact mobile search cards */
  #gstore-mobile-header.gstore-header-app .gstore-search-tile .gstore-valentine-ribbon,
  .gstore-search-tile .gstore-valentine-ribbon {
    position: absolute !important;
    top: 28px !important;
    left: -16px !important;
    transform: rotate(35deg) !important;
    background: linear-gradient(135deg, #ff3b6b, #ff6fa5) !important;
    color: #fff !important;
    padding: 1px 18px !important;
    font-family: "Great Vibes", cursive !important;
    font-weight: 400 !important;
    font-size: 7px !important;
    line-height: 1 !important;
    letter-spacing: 0.2px !important;
    box-shadow: 0 6px 12px rgba(255, 0, 80, 0.2) !important;
    z-index: 6 !important;
    pointer-events: none !important;
    white-space: nowrap !important;
  }

  #gstore-mobile-header.gstore-header-app .gstore-search-tile .gstore-badge-rose,
  .gstore-search-tile .gstore-badge-rose {
    position: absolute !important;
    right: 1px !important;
    top: 1px !important;
    font-size: 10px !important;
    z-index: 7 !important;
    pointer-events: none !important;
  }

  .gstore-search-tile-image-dots {
    display: none !important;
  }

  .gstore-search-tile-info {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
    flex: 1 !important;
  }

  .gstore-search-tile-info a {
    text-decoration: none !important;
  }

  .gstore-search-tile-title {
    font-size: 12px !important;
    line-height: 1.2 !important;
  }

  .gstore-search-tile-price {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  /* Hide badges in live search (mobile only) */
  .gstore-search-tile .gstore-badge-group {
    display: none !important;
  }

  /* View all results button - smaller glassmorphic */
  .gstore-search-view-all {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 8px 12px !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, 0.45) !important;
    backdrop-filter: blur(10px) saturate(160%) !important;
    -webkit-backdrop-filter: blur(10px) saturate(160%) !important;
    border: 1px solid rgba(255, 255, 255, 0.35) !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #2b2b2b !important;
    margin: 8px auto 0 !important;
    width: auto !important;
  }
}

@media (min-width: 1025px) {
  #gstore-mobile-header.gstore-header-app { display: none !important; }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
