/* Category navigation (owner 2026-11-04): All Categories trigger, mega panel / drill-down drawer,
   Categories landing tiles and taxonomy pages. OneMkan tokens (om-premium.css); logical properties keep RTL. */

/* ---------- Trigger: first item of the strip ---------- */
.om-allcat-trigger {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 36px; padding: 0 10px; border-radius: 4px;
  color: inherit; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.om-allcat-trigger:hover { outline: 1px solid currentColor; }
.om-allcat-trigger:focus-visible { outline: 2px solid var(--om-accent); outline-offset: 1px; }
.amazon-subnav .om-strip-free-shipping { flex: none; }

/* ---------- Dialog shell ---------- */
html.om-allcat-open, html.om-allcat-open body { overflow: hidden; }
.om-allcat {
  padding: 0; border: 0; color: var(--om-ink); background: #fff;
  box-shadow: 0 12px 40px rgba(15, 17, 17, .25);
}
.om-allcat::backdrop { background: rgba(15, 17, 17, .45); }
.om-allcat-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 12px 10px 16px; border-block-end: 1px solid var(--om-line); background: var(--om-soft);
}
.om-allcat-head h2 { margin: 0; font-size: 1.125rem; }
.om-allcat-status { padding: 24px 16px; color: var(--om-ink-2); }
.om-allcat a { color: var(--om-ink); text-decoration: none; }
.om-allcat a:hover { color: var(--om-link); text-decoration: underline; }
.om-allcat a:focus-visible, .om-allcat button:focus-visible { outline: 2px solid var(--om-select); outline-offset: 2px; border-radius: 4px; }

.om-allcat-rail { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; overscroll-behavior: contain; }
.om-allcat-dept {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 14px;
  font-size: .9375rem; line-height: 1.2;
}
.om-allcat-dept .om-dept-icon { flex: none; color: var(--om-ink-2); }
.om-allcat-dept span:first-of-type { flex: 1; }
.om-allcat-chev { color: var(--om-ink-2); font-size: 1.25rem; }
[dir="rtl"] .om-allcat-chev { transform: scaleX(-1); }
.om-allcat-dept.is-active { background: #eaf3f5; }
.om-allcat-dept:hover { text-decoration: none !important; }
@media (hover: hover) { .om-allcat-dept:hover { background: #eaf3f5; } }
.om-allcat-dept.is-active { font-weight: 700; box-shadow: inset 3px 0 0 var(--om-select); }
[dir="rtl"] .om-allcat-dept.is-active { box-shadow: inset -3px 0 0 var(--om-select); }
.om-allcat-dept.is-active .om-dept-icon { color: var(--om-select); }

.om-allcat-panel { overflow-y: auto; overscroll-behavior: contain; padding: 14px 20px 24px; }
.om-allcat-panel-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-block-end: 10px; }
.om-allcat-panel-head h2 { margin: 0; font-size: 1.25rem; }
.om-allcat-see-all { color: var(--om-link) !important; font-size: .875rem; }
.om-allcat-back {
  display: none; min-height: 44px; padding: 0; border: 0; background: none;
  color: var(--om-link); font: inherit; font-weight: 700; cursor: pointer;
}
.om-allcat-groups { columns: 210px 3; column-gap: 28px; }
.om-allcat-group { break-inside: avoid; margin-block-end: 16px; }
.om-allcat-group h3 { margin: 0 0 4px; font-size: .9375rem; }
.om-allcat-group ul { list-style: none; margin: 0; padding: 0; }
.om-allcat-group li a { display: block; padding: 4px 0; font-size: .875rem; color: var(--om-ink-2); }

/* Desktop: rail + adjacent mega panel, both scrolling inside the viewport. */
@media (min-width: 900px) {
  .om-allcat {
    position: fixed; inset: 64px auto auto 16px; margin: 0;
    width: min(1180px, calc(100vw - 32px)); height: min(640px, calc(100vh - 88px)); max-height: none; max-width: none;
    border-radius: var(--om-radius); display: none; flex-direction: column;
  }
  [dir="rtl"] .om-allcat { inset: 64px 16px auto auto; }
  .om-allcat[open] { display: flex; }
  .om-allcat-slot, .om-allcat-body { flex: 1; min-height: 0; }
  .om-allcat-body { display: grid; grid-template-columns: 270px 1fr; height: 100%; }
  .om-allcat-rail { border-inline-end: 1px solid var(--om-line); background: #fff; }
  .om-allcat-panels { min-height: 0; overflow: hidden; display: flex; }
  .om-allcat-panel { flex: 1; }
}

/* Phones and tablets: full-screen drawer, drill-down. */
@media (max-width: 899.98px) {
  .om-allcat {
    margin: 0; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none;
    display: none; flex-direction: column;
  }
  .om-allcat[open] { display: flex; }
  .om-allcat-slot { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .om-allcat-body { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .om-allcat-rail { flex: 1; padding-block-end: calc(16px + var(--om-safe-bottom, 0px)); }
  .om-allcat-rail li + li { border-block-start: 1px solid #eef0f0; }
  .om-allcat-dept { min-height: 52px; font-size: 1rem; }
  .om-allcat-dept.is-active { box-shadow: none; font-weight: 400; background: none; }
  .om-allcat-panels { display: none; }
  .om-allcat.is-drilled .om-allcat-rail { display: none; }
  .om-allcat.is-drilled .om-allcat-panels { display: flex; flex: 1; min-height: 0; }
  .om-allcat-panel { flex: 1; padding: 6px 16px calc(24px + var(--om-safe-bottom, 0px)); }
  .om-allcat-back { display: inline-flex; align-items: center; width: 100%; }
  .om-allcat-panel-head { margin-block-end: 6px; }
  .om-allcat-groups { columns: 1; }
  .om-allcat-group { padding-block: 10px; margin: 0; border-block-end: 1px solid #eef0f0; }
  .om-allcat-group ul { display: flex; flex-wrap: wrap; gap: 8px; margin-block-start: 8px; }
  .om-allcat-group li a {
    display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px;
    border: 1px solid var(--om-line); border-radius: 18px; color: var(--om-ink);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .om-allcat[open] { animation: om-allcat-in .14s ease-out; }
  @keyframes om-allcat-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
}

/* ---------- Categories landing ---------- */
.om-cat-landing { max-width: 1280px; margin: 0 auto; padding: 16px; }
.om-cat-landing-head h1 { margin: 0; font-size: 1.5rem; }
.om-cat-landing-head p { margin: 4px 0 14px; color: var(--om-ink-2); font-size: .875rem; }
.om-cat-tiles {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
}
.om-cat-tile a {
  display: flex; flex-direction: column; height: 100%; border: 1px solid var(--om-line); border-radius: var(--om-radius);
  overflow: hidden; color: var(--om-ink); text-decoration: none; background: #fff;
}
.om-cat-tile a:hover { border-color: #a6b0b0; box-shadow: var(--om-shadow); }
.om-cat-tile a:focus-visible { outline: 2px solid var(--om-select); outline-offset: 2px; }
.om-cat-tile-media { display: grid; place-items: center; aspect-ratio: 4 / 3; background: var(--om-soft); overflow: hidden; }
.om-cat-tile-media img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.om-cat-tile.is-icon .om-cat-tile-media { aspect-ratio: 2 / 1; }
.om-cat-tile-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; color: var(--om-select); }
.om-cat-tile-label { display: flex; align-items: center; gap: 6px; padding: 10px 10px 2px; font-weight: 700; font-size: .9375rem; line-height: 1.25; }
.om-cat-tile-icon-inline { display: inline-flex; color: var(--om-ink-2); flex: none; }
.om-cat-tile-note { padding: 0 10px 10px; color: var(--om-ink-2); font-size: .75rem; }
.om-cat-tile-label:last-child { padding-block-end: 10px; }
@media (max-width: 700px) {
  .om-cat-landing { padding: 12px; }
  .om-cat-landing-head h1 { font-size: 1.25rem; }
  .om-cat-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .om-cat-tile-label { font-size: .875rem; }
}

/* ---------- Taxonomy pages ---------- */
.om-category-page { max-width: 1500px; margin: 0 auto; padding: 10px 16px 24px; }
.om-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 0 0 8px; padding: 0; font-size: .8125rem; }
.om-crumbs li + li::before { content: "›"; margin-inline-end: 4px; color: var(--om-ink-2); }
.om-crumbs a { color: var(--om-link); }
.om-category-head { display: flex; align-items: center; gap: 10px; margin-block-end: 10px; }
.om-category-head h1 { margin: 0; font-size: 1.5rem; }
.om-category-icon { display: inline-flex; color: var(--om-select); }
.om-category-children.is-department { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); margin-block-end: 16px; }
.om-category-group { border-block-end: 1px solid #eef0f0; }
.om-category-group summary { display: flex; align-items: center; min-height: 44px; font-weight: 700; cursor: pointer; }
.om-category-group summary:focus-visible { outline: 2px solid var(--om-select); }
.om-category-group ul { list-style: none; margin: 0 0 10px; padding: 0; }
.om-category-group li a { display: block; padding: 5px 0; color: var(--om-ink-2); font-size: .875rem; }
.om-category-group li a:hover { color: var(--om-link); }
.om-category-group-all { font-weight: 700; color: var(--om-link) !important; }
.om-category-chips { display: flex; gap: 8px; overflow-x: auto; list-style: none; margin: 0 0 14px; padding: 2px 0 6px; scrollbar-width: thin; }
.om-category-chips a {
  display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; white-space: nowrap;
  border: 1px solid var(--om-line); border-radius: 18px; color: var(--om-ink); text-decoration: none; font-size: .875rem;
}
.om-category-chips a.is-listed { border-color: var(--om-select); }
.om-category-chips a:hover { background: var(--om-soft); }
@media (max-width: 700px) {
  .om-category-page { padding: 8px 12px 20px; }
  .om-category-head h1 { font-size: 1.25rem; }
}

/* The department shortcuts scroll inside their row: fade the trailing edge so a partly shown name reads as
   "more to scroll", not as a clipped label. */
.amazon-subnav .amazon-department-nav {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
[dir="rtl"] .amazon-subnav .amazon-department-nav {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}
