/* ============================================
   iTOOL SHOP — MINIMAL CHROME (HEADER + FOOTER)
   RTL / Persian / Dana (site font)
   Prefixes: .aith- (header)  .aitf- (footer)
   ============================================ */

:root {
  --aith-primary: #1e2a78;
  --aith-primary-2: #2a3a8c;
  --aith-accent: #22c55e;
  --aith-ink: #111111;
  --aith-muted: #6b7280;
  --aith-muted-2: #9ca3af;
  --aith-line: rgba(0, 0, 0, 0.07);
  --aith-bg-soft: #f7f8fa;
  --aith-font: var(--itoll-font-family, 'Tahoma', system-ui, sans-serif);
}

/* ============================================
   HEADER
   ============================================ */
.aith-header {
  background: #fff;
  font-family: var(--aith-font);
  direction: rtl;
  position: sticky;
  top: 0;
  z-index: 90;
  border-bottom: 1px solid var(--aith-line);
}
.aith-header__wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 0;
}

/* Desktop nav inside header */
.aith-header__nav {
  display: flex;
  align-items: center;
  flex: 1;
  height: 48px;
  margin-right: 16px;
}
.aith-header__nav .aith-cats-wrap {
  border-left: 1px solid var(--aith-line);
  margin-left: 4px;
}
.aith-header__nav .aith-nav__links {
  flex: 1;
  height: 100%;
}

/* Phone inside header (desktop) */
.aith-header__phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--aith-muted);
  white-space: nowrap;
  padding: 0 16px;
  border-right: 1px solid var(--aith-line);
  transition: color .2s;
}
.aith-header__phone:hover { color: var(--aith-primary); }
.aith-header__phone svg { width: 15px; height: 15px; color: var(--aith-accent); flex-shrink: 0; }
.aith-header__phone strong {
  color: var(--aith-ink); font-weight: 700; font-size: 13.5px;
  direction: rtl; unicode-bidi: embed; font-feature-settings: "tnum";
}

/* Logo */
.aith-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}
.aith-logo img {
  height: 24px !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  display: block;
}
.aith-logo__text {
  font-size: 22px;
  font-weight: 800;
  color: var(--aith-primary);
  letter-spacing: -0.01em;
}

/* Search bar — hidden by default, shown on toggle */
.aith-search-bar {
  border-top: 1px solid var(--aith-line);
  padding: 8px 24px 10px;
  background: #fff;
  display: none;
}
.aith-search-bar.is-open { display: block; }
.aith-search {
  width: 100%; max-width: 640px; margin: 0 auto;
  display: block; position: relative;
}
.aith-search__field {
  display: flex;
  align-items: center;
  height: 44px;
  background: var(--aith-bg-soft);
  border: none;
  border-radius: 100px;
  padding: 0 14px 0 6px;
  gap: 8px;
  transition: box-shadow .2s, background .2s;
}
.aith-search__field:focus-within {
  background: #fff;
  box-shadow: 0 0 0 2px var(--aith-primary);
}
.aith-search__input {
  flex: 1;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  height: 100%;
  font-family: inherit;
  font-size: 14px;
  color: var(--aith-ink);
  min-width: 0;
  direction: rtl;
  text-align: right;
}
.aith-search__input::placeholder { color: var(--aith-muted-2); }
.aith-search__input:focus { outline: none; }
.aith-search__submit {
  width: 32px; height: 32px;
  border-radius: 100px;
  background: transparent;
  color: var(--aith-muted);
  border: 0; cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: color .2s;
}
.aith-search__submit:hover { color: var(--aith-primary); background: transparent; }
.aith-search__submit svg { width: 18px; height: 18px; }

/* Live search dropdown */
.aith-search__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px); right: 0; left: 0;
  background: #fff;
  border: 1px solid var(--aith-line);
  border-radius: 16px;
  box-shadow: 0 20px 48px -12px rgba(16,24,40,.18);
  z-index: 200;
  overflow: hidden;
  padding: 6px;
}
.aith-search__dropdown.is-open { display: block; }

.aith-search__result {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px;
  border-radius: 10px;
  text-decoration: none; color: var(--aith-ink);
  transition: background .15s;
  cursor: pointer;
}
.aith-search__result:hover,
.aith-search__result.is-active { background: var(--aith-bg-soft); }

.aith-search__result-img {
  width: 44px; height: 44px; border-radius: 8px;
  background: var(--aith-bg-soft);
  overflow: hidden; flex-shrink: 0;
  display: grid; place-items: center;
}
.aith-search__result-img img { width: 100%; height: 100%; object-fit: contain; }
.aith-search__result-placeholder { width: 100%; height: 100%; background: var(--aith-bg-soft); }

.aith-search__result-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
}
.aith-search__result-title {
  font-size: 13.5px; font-weight: 500;
  color: var(--aith-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aith-search__result-title mark {
  background: transparent; color: var(--aith-primary); font-weight: 700;
}
.aith-search__result-price {
  font-size: 12px; color: var(--aith-accent); font-weight: 600;
  direction: rtl;
}

.aith-search__result-more {
  display: block; text-align: center;
  padding: 10px; margin-top: 4px;
  border-top: 1px solid var(--aith-line);
  font-size: 13px; font-weight: 600;
  color: var(--aith-primary); text-decoration: none;
  border-radius: 0 0 10px 10px;
  transition: background .15s;
}
.aith-search__result-more:hover { background: var(--aith-bg-soft); }

.aith-search__no-result {
  padding: 16px; text-align: center;
  font-size: 13px; color: var(--aith-muted);
}

/* Loading dots */
.aith-search__loading {
  display: flex; justify-content: center; gap: 5px; padding: 18px;
}
.aith-search__loading span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--aith-primary); opacity: .3;
  animation: aitl-bounce .8s ease-in-out infinite;
}
.aith-search__loading span:nth-child(2) { animation-delay: .15s; }
.aith-search__loading span:nth-child(3) { animation-delay: .3s; }
@keyframes aitl-bounce {
  0%, 80%, 100% { transform: scale(.7); opacity: .3; }
  40%           { transform: scale(1);  opacity: 1; }
}

/* Actions */
.aith-actions { display: flex; align-items: center; gap: 4px; }
.aith-action {
  position: relative;
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  color: var(--aith-ink);
  text-decoration: none;
  transition: background .2s, color .2s;
}
.aith-action:hover { background: var(--aith-bg-soft); color: var(--aith-primary); }
.aith-action svg { width: 22px; height: 22px; }
.aith-action__badge {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--aith-accent);
  color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 18px; height: 18px;
  border-radius: 9px;
  display: grid; place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  font-feature-settings: "tnum";
}

/* Burger */
.aith-burger {
  display: none;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: transparent;
  color: var(--aith-ink);
  border: 0; cursor: pointer;
  place-items: center;
  transition: background .2s;
}
.aith-burger:hover { background: var(--aith-bg-soft); }
.aith-burger svg { width: 20px; height: 20px; }

/* ============================================
   NAV STRIP
   ============================================ */
.aith-nav {
  background: #fff;
  border-bottom: 1px solid var(--aith-line);
  font-family: var(--aith-font);
  direction: rtl;
}
.aith-nav__wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
  height: 48px;
  overflow: hidden;
}

/* Categories wrapper + button */
.aith-cats-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  border-left: 1px solid var(--aith-line);
  margin-left: 8px;
}
.aith-cats {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  color: var(--aith-ink);
  padding: 0 16px 0 14px;
  height: 100%;
  font-size: 13.5px; font-weight: 700;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: color .2s;
}
.aith-cats:hover { color: var(--aith-primary); }
.aith-cats__icon { display: inline-flex; color: var(--aith-primary); }
.aith-cats__icon svg { width: 16px; height: 16px; }
.aith-cats__arrow { width: 12px; height: 12px; color: var(--aith-muted); transition: transform .25s; }
.aith-cats[aria-expanded="true"] .aith-cats__arrow { transform: rotate(-180deg); }

.aith-cats__menu {
  position: absolute;
  top: calc(100% + 4px); right: 0;
  min-width: 280px;
  background: #fff;
  border: 1px solid var(--aith-line);
  border-radius: 14px;
  box-shadow: 0 18px 40px -16px rgba(16,24,40,.18);
  padding: 6px;
  z-index: 100;
  opacity: 0; visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .2s, visibility .2s, transform .2s;
}
.aith-cats[aria-expanded="true"] + .aith-cats__menu,
.aith-cats-wrap.is-open .aith-cats__menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.aith-cats__item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: 9px;
  text-decoration: none; color: var(--aith-ink);
  font-size: 13.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.aith-cats__item:hover { background: var(--aith-bg-soft); color: var(--aith-primary); }
.aith-cats__item-icon {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--aith-bg-soft);
  display: grid; place-items: center; padding: 4px; flex-shrink: 0;
}
.aith-cats__item-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* ---- Mega menu (Digikala-style: category rail + brand panel) ---- */
.aith-cats__menu--mega {
  width: 760px;
  max-width: calc(100vw - 48px);
  padding: 0;
  overflow: hidden;
}
.aith-mega {
  display: flex;
  min-height: 340px;
}
.aith-mega__rail {
  flex-shrink: 0;
  width: 232px;
  list-style: none;
  margin: 0;
  padding: 8px;
  background: var(--aith-bg-soft);
  border-left: 1px solid var(--aith-line);
  overflow-y: auto;
  max-height: 460px;
}
.aith-mega__cat-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 9px;
  text-decoration: none;
  color: var(--aith-ink);
  font-size: 13.5px;
  font-weight: 600;
  transition: background .18s, color .18s;
}
.aith-mega__cat.is-active .aith-mega__cat-link,
.aith-mega__cat-link:hover {
  background: #fff;
  color: var(--aith-primary);
  box-shadow: 0 4px 14px -8px rgba(16,24,40,.25);
}
.aith-mega__cat-icon {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: #fff;
  display: grid; place-items: center;
  padding: 4px; flex-shrink: 0;
}
.aith-mega__cat.is-active .aith-mega__cat-icon { background: var(--aith-bg-soft); }
.aith-mega__cat-icon img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aith-mega__cat-name { flex: 1; }
.aith-mega__cat-arrow {
  width: 14px; height: 14px;
  color: var(--aith-muted-2);
  opacity: 0;
  transition: opacity .18s;
}
.aith-mega__cat.is-active .aith-mega__cat-arrow { opacity: 1; color: var(--aith-primary); }

.aith-mega__content {
  flex: 1;
  background: #fff;
  padding: 20px 22px;
  overflow-y: auto;
  max-height: 460px;
}
.aith-mega__panel { display: none; }
.aith-mega__panel.is-active { display: block; }
.aith-mega__all {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  color: var(--aith-primary);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 14px;
}
.aith-mega__all svg { width: 15px; height: 15px; }
.aith-mega__all:hover { text-decoration: underline; }
.aith-mega__brands-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--aith-muted);
  margin: 4px 0 10px;
}
.aith-mega__brands {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.aith-mega__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--aith-line);
  border-radius: 10px;
  background: var(--aith-bg-soft);
  text-decoration: none;
  color: var(--aith-ink);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.aith-mega__brand::before {
  content: "";
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--aith-accent);
  flex-shrink: 0;
}
.aith-mega__brand:hover {
  background: #fff;
  color: var(--aith-primary);
  border-color: var(--aith-primary);
  box-shadow: 0 6px 16px -10px rgba(30,42,120,.4);
  transform: translateY(-1px);
}
.aith-mega__empty {
  margin: 6px 0 0;
  color: var(--aith-muted-2);
  font-size: 13px;
}

/* Nav links */
.aith-nav__links {
  display: flex; align-items: center;
  list-style: none; margin: 0; padding: 0;
  flex: 1; height: 100%;
}
.aith-nav__link {
  padding: 0 14px;
  font-size: 13.5px; font-weight: 500;
  color: #374151;
  text-decoration: none; height: 100%;
  display: inline-flex; align-items: center;
  position: relative; white-space: nowrap;
  transition: color .2s;
}
.aith-nav__link:hover { color: var(--aith-primary); }
.aith-nav__link--active { color: var(--aith-primary); font-weight: 600; }
.aith-nav__link--active::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: -1px;
  height: 2px; background: var(--aith-accent); border-radius: 2px;
}

/* Phone */
.aith-nav__phone {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 500;
  color: var(--aith-muted); text-decoration: none;
  margin-right: auto; white-space: nowrap;
  transition: color .2s;
}
.aith-nav__phone:hover { color: var(--aith-primary); }
.aith-nav__phone svg { width: 14px; height: 14px; color: var(--aith-accent); }
.aith-nav__phone strong {
  color: var(--aith-ink); font-weight: 700;
  direction: ltr; unicode-bidi: embed;
  font-feature-settings: "tnum"; white-space: nowrap;
}

/* ============================================
   MOBILE DRAWER
   ============================================ */
.aith-drawer {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  z-index: 200;
  opacity: 0; transition: opacity .25s;
  font-family: var(--aith-font); direction: rtl;
}
.aith-drawer[aria-hidden="false"] { display: block; opacity: 1; }
.aith-drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  background: #fff;
  padding: 18px 16px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; gap: 12px;
}
.aith-drawer[aria-hidden="false"] .aith-drawer__panel { transform: translateX(0); }
.aith-drawer__head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 12px; border-bottom: 1px solid var(--aith-line);
}
.aith-drawer__close {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--aith-bg-soft); color: var(--aith-ink);
  border: 0; cursor: pointer; display: grid; place-items: center;
}
.aith-drawer__close svg { width: 18px; height: 18px; }
.aith-drawer__title { font-weight: 700; font-size: 15px; margin: 0; }
.aith-drawer__nav {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.aith-drawer__nav a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--aith-ink);
  text-decoration: none; transition: background .2s, color .2s;
}
.aith-drawer__nav a:hover { background: var(--aith-bg-soft); color: var(--aith-primary); }
.aith-drawer__nav a svg { width: 14px; height: 14px; color: var(--aith-muted-2); }
.aith-drawer__section-title {
  font-size: 11px; font-weight: 700; color: var(--aith-muted);
  letter-spacing: .04em; padding: 12px 12px 4px;
}
.aith-drawer__contact {
  margin-top: auto; padding: 14px; border-radius: 12px;
  background: var(--aith-bg-soft); font-size: 12.5px; color: var(--aith-muted);
  display: flex; flex-direction: column; gap: 4px;
}
.aith-drawer__contact strong {
  color: var(--aith-ink); font-size: 15px;
  direction: ltr; unicode-bidi: embed; font-weight: 700;
}

/* ============================================
   RESPONSIVE — header
   ============================================ */
/* Search toggle — visible on all sizes */
.aith-search-toggle {
  background: transparent !important;
  box-shadow: none !important;
}

@media (max-width: 820px) {
  .aith-header__wrap {
    padding: 10px 14px;
    gap: 6px;
    flex-direction: row;
    justify-content: space-between;
  }
  /* راست: burger + لوگو */
  .aith-burger { display: grid; order: 1; }
  .aith-logo { order: 2; }
  /* چپ: آیکون‌ها (margin-right: auto فضا رو پر می‌کنه) */
  .aith-actions { order: 3; margin-right: auto; }
  .aith-logo img { height: 28px !important; }
  .aith-logo__text { font-size: 20px; }
  .aith-action { width: 40px; height: 40px; }
  .aith-action svg { width: 20px; height: 20px; }
  .aith-header__nav { display: none; }
  .aith-header__phone { display: none; }
  .aith-nav { display: none; }
  .aith-search-bar { padding: 8px 14px 10px; }
  .aith-search__field { height: 40px; }
  /* input border hidden */
  .aith-search__input { border: none !important; outline: none !important; box-shadow: none !important; }
}

/* ============================================
   FOOTER
   ============================================ */
.aitf-footer {
  background: #fff;
  color: #374151;
  font-family: var(--aith-font);
  direction: rtl;
  border-top: 1px solid var(--aith-line);
  padding: 56px 24px 0;
}
.aitf-wrap { max-width: 1280px; margin: 0 auto; }
.aitf-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 48px;
  padding-bottom: 40px;
}

.aitf-col__title {
  color: var(--aith-ink); font-size: 14px; font-weight: 700;
  margin: 0 0 18px; letter-spacing: -0.005em;
}

/* About */
.aitf-about__brand {
  display: inline-flex; align-items: center;
  margin-bottom: 16px; text-decoration: none; color: inherit;
}
.aitf-about__brand img { height: 48px; width: auto; display: block; }
.aitf-about__brand__text {
  font-size: 18px; font-weight: 800; color: var(--aith-primary);
}
.aitf-about__desc {
  font-size: 13px; line-height: 1.95; color: var(--aith-muted);
  margin: 0 0 22px; max-width: 360px;
}

.aitf-contact { display: flex; flex-direction: column; gap: 12px; }
.aitf-contact__item {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; color: #4b5563; line-height: 1.7;
  text-decoration: none;
}
.aitf-contact__item-icon {
  width: 18px; height: 18px; color: var(--aith-accent);
  flex-shrink: 0; margin-top: 2px;
}
.aitf-contact__item-icon svg { width: 100%; height: 100%; }
.aitf-contact__item-label {
  display: block; font-size: 11px; color: var(--aith-muted-2);
  margin-bottom: 2px; font-weight: 500;
}
.aitf-contact__item-value { color: var(--aith-ink); font-weight: 600; }
.aitf-contact__item-value--ltr {
  direction: rtl; font-feature-settings: "tnum";
}

/* Links */
.aitf-links {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 11px;
}
.aitf-links a {
  color: var(--aith-muted); text-decoration: none;
  font-size: 13px; transition: color .2s; font-weight: 500;
}
.aitf-links a:hover { color: var(--aith-primary); }

/* Trust badges */
.aitf-trust { display: flex; gap: 10px; flex-wrap: wrap; }
.aitf-trust__badge {
  background: #fff; border: 1px solid var(--aith-line);
  border-radius: 12px; padding: 6px;
  width: 92px; height: 110px;
  display: grid; place-items: center;
  transition: border-color .2s, transform .25s;
  text-decoration: none;
}
.aitf-trust__badge:hover { border-color: var(--aith-primary); transform: translateY(-2px); }
.aitf-trust__badge img { max-width: 100%; max-height: 100%; object-fit: contain; }
.aitf-trust__placeholder {
  width: 100%; height: 100%; border-radius: 8px;
  background: repeating-linear-gradient(45deg, #f7f8fa 0 6px, #eef0f4 6px 12px);
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; text-align: center; gap: 4px;
  font-size: 10px; color: var(--aith-muted); line-height: 1.3; padding: 6px;
}
.aitf-trust__placeholder strong {
  color: #374151; font-weight: 700; font-size: 10.5px;
  font-family: var(--aith-font);
}
.aitf-trust__placeholder svg { width: 22px; height: 22px; color: var(--aith-muted-2); }

/* Social */
.aitf-social { display: flex; gap: 6px; margin-top: 18px; }
.aitf-social a {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--aith-bg-soft); color: var(--aith-muted);
  display: grid; place-items: center; text-decoration: none;
  transition: background .2s, color .2s;
}
.aitf-social a:hover { background: var(--aith-primary); color: #fff; }
.aitf-social a svg { width: 15px; height: 15px; }

/* Bottom bar */
.aitf-bottom {
  border-top: 1px solid var(--aith-line); padding: 18px 0;
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
}
.aitf-copy { font-size: 12px; color: var(--aith-muted); margin: 0; }
.aitf-powered {
  font-size: 12px; color: var(--aith-muted);
  display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; transition: color .2s;
}
.aitf-powered:hover { color: var(--aith-ink); }
.aitf-powered img { height: 18px; width: auto; }

/* ============================================
   RESPONSIVE — footer
   ============================================ */
@media (max-width: 960px) {
  .aitf-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .aitf-about { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .aitf-footer { padding: 36px 16px 0; }
  .aitf-grid { grid-template-columns: 1fr; gap: 28px; padding-bottom: 28px; }
  .aitf-bottom {
    flex-direction: column-reverse; gap: 8px;
    text-align: center; padding: 14px 0;
  }
  .aitf-trust__badge { width: 86px; height: 100px; }
}

/* ============================================
   MOBILE CATS MODAL
   ============================================ */
.aitcats-modal {
  display: none;
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  bottom: calc(62px + env(safe-area-inset-bottom, 0px));
  z-index: 190;
  background: rgba(15,23,42,.5);
  align-items: flex-end;
}
@media (max-width: 768px) {
  .aitcats-modal { display: flex; }
}
.aitcats-modal[aria-hidden="true"] { pointer-events: none; opacity: 0; }
.aitcats-modal[aria-hidden="false"] { pointer-events: auto; opacity: 1; }

.aitcats-modal__inner {
  background: #fff;
  width: 100%;
  max-height: calc(88vh - 62px);
  border-radius: 20px 20px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,.72,0,1);
  font-family: var(--aith-font);
  direction: rtl;
}
.aitcats-modal[aria-hidden="false"] .aitcats-modal__inner {
  transform: translateY(0);
}

.aitcats-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--aith-line);
  flex-shrink: 0;
}
.aitcats-modal__title {
  font-size: 15px;
  font-weight: 800;
  color: var(--aith-ink);
}
.aitcats-modal__close {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--aith-bg-soft);
  display: grid; place-items: center;
  cursor: pointer;
  color: var(--aith-muted);
}
.aitcats-modal__close svg { width: 16px; height: 16px; }

.aitcats-modal__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}
.aitcats-modal__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px;
  text-decoration: none;
  color: var(--aith-ink);
  border-radius: 12px;
  transition: background .15s;
  text-align: center;
}
.aitcats-modal__item:active { background: var(--aith-bg-soft); }
.aitcats-modal__img {
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--aith-bg-soft);
  display: grid; place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}
.aitcats-modal__img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.aitcats-modal__img svg { width: 24px; height: 24px; color: var(--aith-muted-2); }
.aitcats-modal__name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--aith-ink);
}

/* ---- Mobile cats accordion (category → brands) ---- */
.aitcats-acc {
  list-style: none;
  margin: 0; padding: 8px 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
}
.aitcats-acc__item { border-bottom: 1px solid var(--aith-line); }
.aitcats-acc__item:last-child { border-bottom: 0; }
.aitcats-acc__head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 4px;
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--aith-font);
  color: var(--aith-ink);
  text-align: right;
}
.aitcats-acc__icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: var(--aith-bg-soft);
  display: grid; place-items: center;
  overflow: hidden; flex-shrink: 0;
}
.aitcats-acc__icon img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }
.aitcats-acc__icon svg { width: 20px; height: 20px; color: var(--aith-muted-2); }
.aitcats-acc__name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
}
.aitcats-acc__arrow {
  width: 16px; height: 16px;
  color: var(--aith-muted);
  transition: transform .25s;
  flex-shrink: 0;
}
.aitcats-acc__item.is-open .aitcats-acc__arrow { transform: rotate(180deg); }
.aitcats-acc__body { display: none; padding: 0 4px 14px 4px; }
.aitcats-acc__item.is-open .aitcats-acc__body { display: block; }
.aitcats-acc__all {
  display: inline-block;
  color: var(--aith-primary);
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  margin: 2px 0 10px;
}
.aitcats-acc__brands {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.aitcats-acc__brands a {
  display: block;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--aith-bg-soft);
  color: var(--aith-ink);
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
}
.aitcats-acc__brands a:active { background: #eef0f4; color: var(--aith-primary); }

/* ============================================
   MOBILE BOTTOM NAV
   ============================================ */
.aitnav-bottom {
  display: none;
}
@media (max-width: 768px) {
  .aitnav-bottom {
    display: flex;
    position: fixed;
    bottom: 0;
    right: 0;
    left: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid var(--aith-line);
    /* content row stays 62px; total grows to clear the iOS home indicator */
    height: calc(62px + env(safe-area-inset-bottom, 0px));
    direction: rtl;
    box-shadow: 0 -2px 16px rgba(0,0,0,.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .aitnav-bottom__item,
  button.aitnav-bottom__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
    color: var(--aith-muted);
    font-family: var(--aith-font);
    font-size: 11px;
    font-weight: 500;
    transition: color .15s;
    padding-bottom: 2px;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
  }
  .aitnav-bottom__item svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
  }
  .aitnav-bottom__item.is-active {
    color: var(--aith-primary);
    font-weight: 700;
  }
  .aitnav-bottom__item.is-active svg {
    stroke: var(--aith-primary);
  }
  .aitnav-bottom__cart-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .aitnav-bottom__badge {
    position: absolute;
    top: -6px;
    left: -8px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--aith-font);
    min-width: 18px;
    height: 18px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    border: 2px solid #fff;
  }
  /* push page content above nav bar */
  body {
    padding-bottom: calc(62px + env(safe-area-inset-bottom, 0)) !important;
  }
  /* hide desktop drawer burger on mobile — bottom nav replaces it */
  .aith-burger { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .aith-cats__menu, .aith-drawer, .aith-drawer__panel,
  .aitf-trust__badge, .aitf-social a, .aitf-links a { transition: none !important; }
}
