/* GebraBit mobile home layout
   Reference: compact two-row service header, centered hero/search,
   5 + 2 category grid, compact footer. */

@media (max-width: 700px) {
  .home-topbar {
    min-height: 118px;
    display: grid;
    grid-template-columns: repeat(3, max-content);
    grid-auto-rows: auto;
    align-content: center;
    justify-content: center;
    column-gap: 24px;
    row-gap: 10px;
    padding: 14px 10px 12px;
    direction: rtl;
    overflow: hidden;
  }

  .home-topbar-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    color: #2e3339;
    font-size: 0.69rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .home-topbar-brand .home-topbar-mark {
    display: none !important;
  }

  .home-topbar-brand span:last-child {
    display: inline !important;
  }

  .home-topbar-nav {
    display: contents;
  }

  .home-topbar-item,
  .home-topbar-item.is-pending {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    color: #2e3339;
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
  }

  .home-topbar-badge {
    min-width: 28px;
    min-height: 22px;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.61rem;
  }

  .home-search-page {
    min-height: calc(100dvh - 118px);
    overflow-x: hidden;
  }

  .home-hero {
    width: calc(100% - 18px);
    margin-top: 52px;
  }

  .home-brand-emblem {
    width: 108px;
    height: 108px;
    border-radius: 30px;
  }

  .home-brand-emblem span {
    width: 72px;
    height: 72px;
    border-radius: 22px;
    font-size: 2.1rem;
  }

  .home-brand-emblem i {
    top: 14px;
    right: 16px;
  }

  .home-hero h1 {
    display: none;
  }

  .home-hero > p {
    margin: 26px 0 22px;
    color: #20242a;
    font-size: 0.88rem;
    font-weight: 800;
  }

  .home-main-search {
    width: 100%;
    min-height: 62px;
    grid-template-columns: 124px minmax(0, 1fr) 54px;
    grid-template-areas: "modes input submit";
    border: 7px solid #f6f7f9;
    border-radius: 34px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.055);
  }

  .home-search-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    direction: ltr;
    border-right: 1px solid #e5e7ea;
    background: #ffffff;
  }

  .home-search-mode,
  .home-search-mode.is-disabled {
    display: flex !important;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 3px;
    font-size: 0.61rem;
  }

  .home-search-mode.is-active {
    margin: 5px 3px;
    border-radius: 18px;
  }

  .home-main-search input {
    min-height: 48px;
    padding: 0 12px;
    font-size: 0.77rem;
    text-align: right;
    direction: rtl;
  }

  .home-main-search input::placeholder {
    font-size: 0.75rem;
    text-align: right;
    direction: rtl;
  }

  .home-search-submit {
    width: 44px;
    height: 44px;
  }

  .home-search-submit svg {
    width: 23px;
    height: 23px;
  }

  .home-category-grid {
    width: min(100%, 520px);
    margin: 54px auto 0;
    padding: 0 8px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 30px 5px;
    overflow: visible;
    direction: rtl;
  }

  .home-category-card {
    min-width: 0;
    width: auto;
    display: grid;
    justify-items: center;
    gap: 9px;
  }

  .home-category-card:nth-child(6) {
    grid-column: 3;
  }

  .home-category-card:nth-child(7) {
    grid-column: 4;
  }

  .home-category-icon {
    width: 68px;
    height: 68px;
  }

  .home-category-icon svg {
    width: 41px;
    height: 41px;
  }

  .home-category-card strong {
    font-size: 0.66rem;
    line-height: 1.55;
  }

  .home-category-count {
    top: -5px;
    right: calc(50% - 35px);
    min-width: 31px;
    min-height: 20px;
    padding: 2px 5px;
    border-radius: 7px;
    font-size: 0.55rem;
  }

  .home-category-icon--all {
    font-size: 1.45rem;
  }

  .home-footer {
    margin-top: auto;
    padding: 82px 10px calc(26px + env(safe-area-inset-bottom));
  }

  .home-footer nav {
    display: flex;
    justify-content: center;
    flex-wrap: nowrap;
  }

  .home-footer nav span {
    padding-inline: 10px;
    font-size: 0.62rem;
    white-space: nowrap;
  }

  .home-footer p {
    display: none;
  }

  .home-accessibility {
    left: auto;
    right: 14px;
    bottom: calc(112px + env(safe-area-inset-bottom));
    width: 52px;
    height: 52px;
  }
}

@media (max-width: 390px) {
  .home-topbar {
    column-gap: 15px;
  }

  .home-topbar-brand,
  .home-topbar-item,
  .home-topbar-item.is-pending {
    font-size: 0.63rem;
  }

  .home-main-search {
    grid-template-columns: 112px minmax(0, 1fr) 50px;
  }

  .home-main-search input,
  .home-main-search input::placeholder {
    font-size: 0.69rem;
  }

  .home-category-grid {
    gap: 26px 3px;
  }

  .home-category-icon {
    width: 62px;
    height: 62px;
  }

  .home-category-icon svg {
    width: 37px;
    height: 37px;
  }

  .home-category-card strong {
    font-size: 0.61rem;
  }
}
