/* ORAN Store TEST r10 / Mobile-only visual corrections for approved r9.
   No changes to logo sizing, desktop navigation, product/payment or footer templates.
   Mobile breakpoint matches r9 and Classic: max-width 767px. */
@media (max-width: 767px) {
  /* Searchbar ps_searchbar v2: icon is a direct child of form, not a button.
     Place it at the right; preserve the module's own input, Enter and clear JS. */
  #header #search_widget form {
    position: relative !important;
  }
  #header #search_widget form > input[type="text"],
  #header #search_widget form > input[type="search"] {
    padding-left: 18px !important;
    padding-right: 84px !important;
    box-sizing: border-box;
  }
  #header #search_widget form > i.material-icons.search {
    position: absolute !important;
    left: auto !important;
    right: 17px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    font-size: 23px !important;
    line-height: 1 !important;
    color: #8d12e9 !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 2;
    pointer-events: none;
  }
  #header #search_widget form > i.material-icons.clear {
    position: absolute !important;
    left: auto !important;
    right: 52px !important;
    top: 50% !important;
    bottom: auto !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    z-index: 3;
  }
  /* In older ps_searchbar templates search is an actual submit button. */
  #header #search_widget form > button[type="submit"] {
    position: absolute !important;
    left: auto !important;
    right: 0 !important;
    top: 0 !important;
    width: 53px;
    height: 43px;
    padding: 0 !important;
    border: 0;
    background: transparent !important;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  #header #search_widget form > button[type="submit"] .material-icons {
    color: #8d12e9 !important;
  }

  /* Hero: original desktop art untouched. A softly padded mobile rendition of
     the *same* r9 image ensures the handwritten sentence is fully visible. */
  #index .oran-r9-hero-visual {
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: 689 / 374;
    background-image: url('../img/oran-r10-hero-mobile.webp') !important;
    background-position: center center !important;
    background-size: cover !important;
    background-repeat: no-repeat !important;
    background-color: #fbf1fa;
  }
  #index .oran-r9-hero-visual:before {
    background: none !important;
  }
  #index .oran-r9-dots { bottom: 7px; }

  /* The independent TEST catalog is currently empty. Only hide an empty
     featured-products widget; the moment real product cards appear, it remains.
     :has() is supported in current Android Chrome; no JS or database edit. */
  #index .oran-featured:not(:has(.product-miniature, .products .product, [data-id-product])) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
  }

  /* Reduce whitespace specifically between the final category and newsletter.
     Scope to homepage; do not modify other CMS/product/checkout pages. */
  #index .oran-r9-home > .oran-category-grid {
    margin-bottom: 8px !important;
  }
  #index .oran-r9-home { padding-bottom: 0 !important; }
  #index #wrapper { padding-bottom: 0 !important; }
  #index #footer { padding-top: 0 !important; }
  #index #footer > .container > .row { padding-top: 8px !important; }
}
