/* POL.FAN | M5 BAZAR mobile polish V3 2026-11-28.
 * V2 stays installed. We only correct the home-search layout, not logic.
 */
@media (max-width:760px) {
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search {
    display: grid !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    column-gap: 8px !important;
    row-gap: 9px !important;
    padding: 0 !important;
    margin: 0 0 13px !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > label {
    box-sizing: border-box !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > label:first-child {
    grid-column: 1 / -1 !important;
    order: 1 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > label:nth-of-type(2),
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > label:nth-of-type(3) {
    grid-column: auto !important;
    order: 2 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search :is(input[name="q"],select[name="category"],select[name="filter"]) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 9px 10px !important;
    font-size: 13px !important;
    color: #271b45 !important;
    background: #fff !important;
    border: 1px solid #d5cae8 !important;
    border-radius: 11px !important;
  }
  /* Filter BEFORE submit: current HTML puts the submit button too early. */
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row {
    box-sizing: border-box !important;
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    gap: 9px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 11px !important;
    order: 4 !important;
    background: #faf8fe !important;
    border: 1px solid #e6d9f4 !important;
    border-radius: 12px !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    color: #312252 !important;
    line-height: 1.3 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label:nth-child(2) {
    grid-column: 2 !important;
    grid-row: 1 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label > select {
    box-sizing: border-box !important;
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 8px 7px !important;
    background: #fff !important;
    border: 1px solid #d5cae8 !important;
    border-radius: 10px !important;
    color: #2c2248 !important;
    font-size: 12px !important;
    font-weight: 600 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > .m5b-radius-options {
    box-sizing: border-box !important;
    display: grid !important;
    grid-column: 1 / -1 !important;
    grid-row: 2 !important;
    grid-template-columns: minmax(0,1fr) 91px !important;
    width: 100% !important;
    min-width: 0 !important;
    gap: 9px !important;
    margin: 2px 0 0 !important;
    align-items: center !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-radius-options > label.m5b-radius-check {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px !important;
    min-width: 0 !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1.25 !important;
    color: #34264f !important;
    font-size: 12px !important;
    font-weight: 700 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-radius-options > label.m5b-radius-check > input {
    box-sizing: border-box !important;
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    flex: 0 0 18px !important;
    margin: 0 !important;
    accent-color: #7d31d9 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-radius-options > label:last-child {
    display: block !important;
    box-sizing: border-box !important;
    width: 91px !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-radius-options > label:last-child select {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 6px !important;
    border: 1px solid #d5cae8 !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: #32204f !important;
    font-size: 12px !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-location-filter-row > p.m5b-search-note {
    box-sizing: border-box !important;
    display: block !important;
    grid-column: 1 / -1 !important;
    grid-row: 3 !important;
    width: 100% !important;
    margin: 0 !important;
    font-size: 10px !important;
    line-height: 1.35 !important;
    color: #706783 !important;
    overflow-wrap: anywhere !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > button.m5b-btn {
    display: flex !important;
    box-sizing: border-box !important;
    grid-column: 1 / -1 !important;
    order: 5 !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 9px 12px !important;
    margin: 0 !important;
    border-radius: 11px !important;
    border: 0 !important;
    background: linear-gradient(110deg,#c12ae9,#7133db) !important;
    box-shadow: 0 5px 12px rgba(88,39,160,.12) !important;
    color: white !important;
    font-size: 14px !important;
    font-weight: 850 !important;
    line-height: 1.2 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-category-panel {
    margin-top: 12px !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-categories {
    display: grid !important;
    grid-template-columns: repeat(3,minmax(0,1fr)) !important;
    gap: 7px !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-categories a.m5b-category {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 67px !important;
    padding: 8px 5px !important;
    margin: 0 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-category-name {
    overflow-wrap: anywhere !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
  }
}
@media (max-width: 355px) {
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row {
    grid-template-columns: minmax(0,1fr) !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label:first-child {
    grid-column: 1 !important;
    grid-row: 1 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > label:nth-child(2) {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] form.m5b-search > .m5b-location-filter-row > .m5b-radius-options {
    grid-column: 1 !important;
    grid-row: 3 !important;
  }
  html body #m5b-root.m5hero-neon [data-m5b-home-content] .m5b-location-filter-row > p.m5b-search-note {
    grid-column: 1 !important;
    grid-row: 4 !important;
  }
}
