/* ANYSOFTHUB mobile layer (<= 900px).
   Load AFTER design-v3-8.min.css. Desktop is untouched: everything new is
   hidden above 900px and every override sits inside the media query.
   !important is used only where the older stylesheets already force a value. */

:root {
  --m-navy: #0f1f3d;
  --m-navy-2: #162c52;
  --m-navy-3: #1f3b6b;
  --m-line: rgba(255, 255, 255, .09);
  --m-ink: #e8eefb;
  --m-mute: #9fb1d2;
  --m-blue: #2563eb;
  --m-sky: #7fb0ff;
  --m-bn-h: 64px;
}

.m-overlay,
.m-drawer,
.m-bottom-nav { display: none; }

@media (max-width: 900px) {

  /* ---------- page frame ---------- */
  body { padding-bottom: calc(var(--m-bn-h) + env(safe-area-inset-bottom)); }
  body.m-lock { overflow: hidden; touch-action: none; }
  input, select, textarea { font-size: 16px; } /* stops iPhone zoom-on-focus */

  /* old inline dropdown menu is replaced by the drawer */
  .as-main-nav { display: none !important; }

  /* ---------- announcement bar: one short line ---------- */
  .as-noticebar-slim .as-notice-cats,
  .as-noticebar-slim .as-notice-lics,
  .as-noticebar-slim .as-notice-divider { display: none !important; }
  .as-noticebar-slim .as-noticebar-inner {
    justify-content: center !important;
    min-height: 0 !important;
    padding-top: 6px !important;
    padding-bottom: 6px !important;
  }
  .as-noticebar-slim .as-notice-delivery { font-size: 12.5px !important; }

  /* ---------- header: menu | brand | cart, then search ---------- */
  #as-site-header { position: static !important; }
  #as-site-header .as-header-inner {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 10px 8px !important;
    padding-top: 10px !important;   /* keep the theme's side gutters */
    padding-bottom: 12px !important;
  }
  #as-site-header .mobile-menu-trigger {
    order: 1 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 12px;
    background: #eef3fd !important;
    color: #14223d !important;
  }
  #as-site-header .mobile-menu-label { display: none !important; }

  #as-site-header .as-site-brand {
    order: 2 !important;
    display: flex !important;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto !important;
    min-width: 0 !important;
  }
  #as-site-header .as-site-brand img { display: none !important; }
  #as-site-header .as-site-brand::before {
    content: "";
    flex: none;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: url(../img/android-chrome-192x192.png) center / cover no-repeat;
  }
  #as-site-header .as-site-brand strong { font-size: 16px !important; line-height: 1.1; letter-spacing: .2px; }
  #as-site-header .as-site-brand small { font-size: 9px !important; letter-spacing: 2.6px !important; }

  #as-site-header .as-header-actions { order: 3 !important; gap: 6px !important; margin-left: auto; }
  #as-site-header .as-currency-switcher,
  #as-site-header .as-head-wishlist-link,
  #as-site-header .as-head-account-btn,
  #as-site-header .as-header-cart-val { display: none !important; }

  #as-site-header .as-head-cart-btn {
    position: relative;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0 !important;
    border-radius: 12px;
    background: #eef3fd !important;
    color: #14223d !important;
  }
  #as-site-header .as-head-cart-btn > span:not(.cartcount) { display: none !important; }
  #as-site-header .as-head-cart-btn .cartcount {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 10px;
    background: var(--m-blue);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 19px;
    text-align: center;
  }

  #as-site-header .as-search-wrapper { order: 4 !important; flex: 0 0 100% !important; display: block !important; position: relative; }
  #as-site-header .as-search-cat-select { display: none !important; }
  #as-site-header .as-search-techubiz {
    display: flex !important;
    width: 100% !important;
    max-width: none !important;
    height: 46px;
    overflow: hidden;
    border: 1.5px solid #d6e0f2;
    border-radius: 13px;
    background: #f7f9fe;
  }
  #as-site-header .as-search-techubiz input[type="search"] {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 14px !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
  #as-site-header .as-search-techubiz button { flex: none; width: 52px; border: 0; background: var(--m-blue); color: #fff; }

  /* ---------- floating helpers sit above the bottom bar ---------- */
  .as-chat-launcher-wrap { position: static !important; }
  .as-smart-bot-launcher {
    position: fixed !important;
    right: 14px !important;
    left: auto !important;
    bottom: calc(var(--m-bn-h) + 16px + env(safe-area-inset-bottom)) !important;
    width: 48px !important;
    height: 48px !important;
    z-index: 800 !important;
  }
  .as-chat-tooltip { display: none !important; }
  #as-sticky-mobile-bar { bottom: calc(var(--m-bn-h) + env(safe-area-inset-bottom)) !important; }
  body.m-lock .as-chat-launcher-wrap { display: none !important; }

  /* ---------- bottom bar ---------- */
  .m-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: end;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #e3eaf6;
    box-shadow: 0 -8px 26px rgba(15, 31, 61, .08);
  }
  .m-bn {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    min-height: 52px;
    margin: 0;
    padding: 4px 2px 2px;
    border: 0;
    background: none;
    color: #5a6a86;
    font: 600 11px/1.1 'DM Sans', system-ui, sans-serif;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .m-bn svg { display: block; width: 23px; height: 23px; }
  .m-bn.is-active { color: var(--m-blue); }
  .m-bn-ico { position: relative; display: grid; place-items: center; width: 40px; height: 28px; }
  .m-bn-label { display: block; white-space: nowrap; }

  .m-bn-cart .m-bn-ico {
    width: 50px;
    height: 50px;
    margin-top: -22px;
    border: 4px solid #fff;
    border-radius: 50%;
    background: var(--m-blue);
    color: #fff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .35);
  }
  .m-bn-cart svg { width: 24px; height: 24px; }
  .m-bn-cart.is-active { color: var(--m-blue); }

  .m-bottom-nav .m-bn-badge {
    position: absolute;
    top: -3px;
    left: calc(50% + 4px);
    display: block;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5484d;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
  }
  .m-bn-cart .m-bn-badge { top: -7px; left: auto; right: -9px; border: 2px solid #fff; box-sizing: content-box; }
  .m-bn-badge[hidden],
  .m-tile-badge[hidden] { display: none !important; }

  /* ---------- slide-over menu ---------- */
  .m-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: block;
    background: rgba(8, 16, 34, .56);
    opacity: 0;
    visibility: hidden;
    transition: opacity .22s ease, visibility 0s linear .22s;
  }
  .m-overlay[hidden] { display: none; }
  .m-overlay.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }

  .m-drawer {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1210;
    display: flex;
    flex-direction: column;
    width: min(88vw, 380px);
    padding-top: env(safe-area-inset-top);
    background: var(--m-navy);
    color: var(--m-ink);
    font-family: 'DM Sans', system-ui, sans-serif;
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform .27s cubic-bezier(.22, .8, .3, 1), visibility 0s linear .27s;
    box-shadow: 18px 0 48px rgba(0, 0, 0, .3);
  }
  .m-drawer.is-open { transform: none; visibility: visible; transition-delay: 0s; }

  .m-drawer a, .m-drawer button { -webkit-tap-highlight-color: transparent; }
  .m-drawer :focus-visible { outline: 2px solid var(--m-sky); outline-offset: 2px; }

  .m-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px 18px;
  }
  .m-drawer-title { display: inline-flex; align-items: center; gap: 12px; font: 700 20px/1 'Outfit', 'DM Sans', system-ui, sans-serif; color: #fff; }
  .m-drawer-title svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; background: var(--m-blue); }
  .m-drawer-close {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--m-navy-2);
    color: var(--m-ink);
    cursor: pointer;
  }
  .m-drawer-close svg { width: 20px; height: 20px; }

  .m-search {
    position: relative;
    margin: 4px 16px 14px;
  }
  .m-search input {
    width: 100%;
    height: 48px;
    padding: 0 48px 0 16px;
    border: 1px solid var(--m-line);
    border-radius: 14px;
    background: var(--m-navy-2);
    color: #fff;
    outline: 0;
    -webkit-appearance: none;
    appearance: none;
  }
  .m-search input::placeholder { color: #8397bd; }
  .m-search input:focus { border-color: var(--m-sky); }
  .m-search button {
    position: absolute;
    top: 4px;
    right: 4px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: var(--m-sky);
    cursor: pointer;
  }
  .m-search button svg { width: 21px; height: 21px; }

  .m-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--m-line); }
  .m-tabs button {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    border: 0;
    background: none;
    color: var(--m-mute);
    font: 600 15px/1 'DM Sans', system-ui, sans-serif;
    cursor: pointer;
  }
  .m-tabs button svg { width: 18px; height: 18px; }
  .m-tabs button.is-active { color: #fff; }
  .m-tabs button.is-active::after {
    content: "";
    position: absolute;
    left: 14%;
    right: 14%;
    bottom: -1px;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--m-sky);
  }

  .m-panels { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
  .m-panel { padding: 6px 0 12px; }
  .m-panel[hidden] { display: none; }

  .m-cat { border-bottom: 1px solid var(--m-line); }
  .m-cat-row { display: flex; align-items: stretch; }
  .m-cat-link {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 14px;
    min-height: 58px;
    padding: 8px 8px 8px 18px;
    color: var(--m-ink);
    font-size: 16.5px;
    font-weight: 600;
    text-decoration: none;
  }
  .m-cat-link img { flex: none; width: 26px; height: 26px; object-fit: contain; }
  .m-cat-dot { flex: none; width: 10px; height: 10px; margin: 0 8px; border-radius: 50%; background: var(--m-sky); }
  .m-cat-toggle {
    display: grid;
    place-items: center;
    flex: none;
    width: 56px;
    border: 0;
    background: none;
    color: var(--m-mute);
    cursor: pointer;
  }
  .m-cat-toggle svg { width: 20px; height: 20px; transition: transform .2s ease; }
  .m-cat-toggle[aria-expanded="true"] svg { transform: rotate(180deg); color: var(--m-sky); }
  .m-cat-sub { margin: 0 18px 12px 30px; padding-left: 14px; border-left: 2px solid var(--m-navy-3); }
  .m-cat-sub[hidden] { display: none; }
  .m-cat-sub a {
    display: block;
    padding: 11px 6px;
    color: #c4d1ea;
    font-size: 15px;
    text-decoration: none;
  }
  .m-cat-sub a.m-cat-all { color: var(--m-sky); font-weight: 700; }

  .m-link {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 6px 18px;
    border-bottom: 1px solid var(--m-line);
    color: var(--m-ink);
    font-size: 16.5px;
    font-weight: 600;
    text-decoration: none;
  }
  .m-link > span { flex: 1; }
  .m-link > svg { width: 18px; height: 18px; color: var(--m-mute); }
  .m-hot { padding: 3px 7px; border-radius: 6px; background: #e5484d; color: #fff; font-size: 10.5px; font-style: normal; font-weight: 800; letter-spacing: .04em; }

  .m-currency { display: flex; align-items: center; gap: 8px; padding: 16px 18px 6px; color: var(--m-mute); font-size: 14px; }
  .m-currency span { margin-right: auto; }
  .m-currency a {
    padding: 8px 13px;
    border: 1px solid var(--m-line);
    border-radius: 10px;
    color: var(--m-ink);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
  }
  .m-currency a.is-on { border-color: var(--m-sky); background: var(--m-navy-3); color: #fff; }

  .m-quick {
    flex: none;
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--m-line);
    background: #0b1930;
  }
  .m-quick-title { margin: 0 4px 10px; color: var(--m-mute); font-size: 13px; font-weight: 600; }
  .m-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .m-tile {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 74px;
    margin: 0;
    padding: 8px 4px;
    border: 1px solid var(--m-line);
    border-radius: 14px;
    background: var(--m-navy-2);
    color: var(--m-ink);
    font: 600 12.5px/1.1 'DM Sans', system-ui, sans-serif;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
  }
  .m-tile svg { width: 24px; height: 24px; color: var(--m-sky); }
  .m-tile-wa { border-color: rgba(52, 211, 153, .35); background: #0f2e2c; color: #86efc3; }
  .m-tile-wa svg { color: #34d399; }
  .m-tile-badge {
    position: absolute;
    top: 6px;
    right: 8px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #e5484d;
    color: #fff;
    font-size: 10.5px;
    font-weight: 700;
    line-height: 18px;
  }

  /* ---------- home hero slider: swipe + dots only ---------- */
  #as-hero-prev,
  #as-hero-next { display: none !important; }
}

@media (min-width: 901px) {
  .m-overlay, .m-drawer, .m-bottom-nav { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  .m-drawer, .m-overlay, .m-cat-toggle svg { transition: none !important; }
}
