/* ============================================================
   VTMM v2 – Vertical Tabbed Mega Menu
   ============================================================ */

/* ── CSS Variables (overridden per-site via Settings > inline_css_vars) ── */
:root {
  --vtmm-accent:        #0d6efd;
  --vtmm-accent-light:  rgba(13,110,253,.07);
  --vtmm-accent-mid:    rgba(13,110,253,.15);
  --vtmm-text:          #1a1a2e;
  --vtmm-muted:         #6b7280;
  --vtmm-border:        #e5e7eb;
  --vtmm-bg:            #ffffff;
  --vtmm-col1:          160px;
  --vtmm-col2:          210px;
  --vtmm-col3:          210px;
  --vtmm-max-h:         560px;
  --vtmm-speed:         220ms;
  --vtmm-r:             6px;
  --vtmm-shadow:        0 20px 56px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
  --vtmm-nav-h:         64px;
  --vtmm-bp:            991px;
}

/* ── Reset scoped to vtmm ── */
.vtmm-nav *,
.vtmm-nav *::before,
.vtmm-nav *::after { box-sizing: border-box; margin: 0; padding: 0; }
.vtmm-nav ul { list-style: none; }
.vtmm-nav a  { text-decoration: none;  }
.vtmm-nav button { }

/* ============================================================
   TOP NAV BAR
   ============================================================ */
.vtmm-nav {
 /* position: sticky; */ top: 0; z-index: 1000;
  background: var(--vtmm-bg);
  border-bottom: 1px solid var(--vtmm-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  
}

.vtmm-nav-inner {
  display: flex; align-items: center;
  height: var(--vtmm-nav-h);
  padding: 0 2rem; gap: 0;
  max-width: 1600px; margin: 0 auto;
}

/* ── Logo ── */
.vtmm-logo {
  font-size: 1.25rem; font-weight: 800;
  color: var(--vtmm-accent); margin-right: 1.5rem;
  letter-spacing: -.02em; flex-shrink: 0;
  text-decoration: none;
}

/* ── Top list ── */
.vtmm-top-list {
  display: flex; align-items: center;
  height: 100%; flex: 1;
}

.vtmm-top-item {
  position: static; height: 100%;
  display: flex; align-items: center;
}

.vtmm-top-link {
  display: inline-flex; align-items: center; gap: 5px;
  height: 100%; padding: 0 1rem;
  font-size: .9375rem; font-weight: 500; color: var(--vtmm-text);
  border-bottom: 2.5px solid transparent;
  transition: color var(--vtmm-speed), border-color var(--vtmm-speed);
  white-space: nowrap; cursor: pointer; user-select: none;
}

.vtmm-top-item:hover > .vtmm-top-link,
.vtmm-top-item.is-open > .vtmm-top-link {
  color: var(--vtmm-accent);
  border-bottom-color: var(--vtmm-accent);
}

/* Chevron */
.vtmm-chev {
  display: inline-block; width: 7px; height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--vtmm-speed);
}
.vtmm-top-item:hover > .vtmm-top-link .vtmm-chev,
.vtmm-top-item.is-open > .vtmm-top-link .vtmm-chev {
  transform: rotate(-135deg) translateY(2px);
}

/* Nav icon */
.vtmm-nav-icon {
  width: 18px; height: 18px; object-fit: contain; flex-shrink: 0;
}

/* ── Right actions ── */
.vtmm-actions {
  margin-left: auto; display: flex; align-items: center; gap: .75rem;
}
.vtmm-btn-cta {
  background: var(--vtmm-accent); color: #fff;
  border: none; padding: .5rem 1.25rem; border-radius: var(--vtmm-r);
  font-size: .875rem; font-weight: 600; cursor: pointer;
  transition: background var(--vtmm-speed), transform var(--vtmm-speed);
  text-decoration: none; display: inline-flex; align-items: center;
}
.vtmm-btn-cta:hover {
  background: #0a58ca; transform: translateY(-1px);
}

/* ============================================================
   MEGA DROPDOWN CONTAINER
   ============================================================ */
.vtmm-mega {
  position: absolute; top: var(--vtmm-nav-h); left: 0; width: 100%;
  background: var(--vtmm-bg);
 
  box-shadow: var(--vtmm-shadow);
  opacity: 0; visibility: hidden;
  transform: translateY(-10px);
  transition:
    opacity var(--vtmm-speed) ease,
    visibility var(--vtmm-speed) ease,
    transform var(--vtmm-speed) ease;
  pointer-events: none;
  z-index: 999;
}

.vtmm-top-item:hover > .vtmm-mega,
.vtmm-top-item.is-open > .vtmm-mega {
  opacity: 1; visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.vtmm-mega:hover { opacity: 1; visibility: visible; transform: translateY(0); }

.vtmm-mega-inner {
  display: flex; align-items: stretch;
  max-height: var(--vtmm-max-h);
  max-width: 1600px; margin: 0 auto;
  overflow: hidden;
}

/* ============================================================
   COL 1  –  Primary categories (left sidebar)
   ============================================================ */
.vtmm-col1 {
 /* width: var(--vtmm-col1);*/ flex-shrink: 0;
  background: #f8f9fc;
  border-right: 1px solid var(--vtmm-border);
  padding: 1rem 0; overflow-y: auto;
}

.vtmm-cat-item { position: relative; display: block; }

.vtmm-cat-btn {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: .625rem 1rem .625rem 1.25rem;
  font-size: .875rem; font-weight: 500; color: #4b5563;
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; cursor: pointer;
  transition: background var(--vtmm-speed), color var(--vtmm-speed), border-color var(--vtmm-speed);
  white-space: nowrap;
}

.vtmm-cat-btn:hover,
.vtmm-cat-item.is-active > .vtmm-cat-btn {
  background: var(--vtmm-accent-light);
  color: var(--vtmm-accent);
  border-left-color: var(--vtmm-accent);
}

.vtmm-cat-icon {
  width: 25px; height: 25px; object-fit: contain; flex-shrink: 0;
}

.vtmm-cat-arrow {
  margin-left: auto; font-size: .95rem;
  opacity: 0; transition: opacity var(--vtmm-speed), transform var(--vtmm-speed);
}
.vtmm-cat-item.is-active > .vtmm-cat-btn .vtmm-cat-arrow,
.vtmm-cat-btn:hover .vtmm-cat-arrow { opacity: 1; transform: translateX(2px); }

/* ============================================================
   COL 2  –  Sub-categories
   ============================================================ */
.vtmm-col2 {
 /* width: var(--vtmm-col2); */ flex-shrink: 0;
  border-right: 1px solid var(--vtmm-border);
  padding: 1rem 0; overflow-y: auto;
  background: var(--vtmm-bg);
}

/* All panels hidden by default; active one shown */
.vtmm-panel { display: none; }
.vtmm-panel.is-active { display: block; animation: vtmm-slide-in var(--vtmm-speed) ease; }

.vtmm-subcat-item { display: block; }

.vtmm-subcat-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: .55rem 1rem .55rem 1.25rem;
  font-size: .875rem; font-weight: 450; color: #4b5563;
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; cursor: pointer;
  transition: background var(--vtmm-speed), color var(--vtmm-speed), border-color var(--vtmm-speed);
  white-space: nowrap;
}

.vtmm-subcat-btn:hover,
.vtmm-subcat-item.is-active > .vtmm-subcat-btn {
  background: var(--vtmm-accent-light);
  color: var(--vtmm-accent);
  border-left-color: var(--vtmm-accent);
}

.vtmm-subcat-label { flex: 1; }
.vtmm-subcat-arr {
  font-size: .85rem; opacity: .35;
  transition: opacity var(--vtmm-speed), transform var(--vtmm-speed);
}
.vtmm-subcat-item.is-active > .vtmm-subcat-btn .vtmm-subcat-arr,
.vtmm-subcat-btn:hover .vtmm-subcat-arr { opacity: 1; transform: translateX(2px); }

/* ============================================================
   COL 3  –  Third-level (series / types)
   ============================================================ */
.vtmm-col3 {
 /* width: var(--vtmm-col3);*/ flex-shrink: 0;
  border-right: 1px solid var(--vtmm-border);
  padding: 1rem 0; overflow-y: auto;
  background: #fafbff;
  display: none;
}
.vtmm-col3.is-visible { display: block; animation: vtmm-slide-in var(--vtmm-speed) ease; }

.vtmm-l3-item { display: block; }
.vtmm-l3-btn {
  display: flex; align-items: center; gap: 6px;
  width: 100%; padding: .5rem 1rem .5rem 1.25rem;
  font-size: .8125rem; font-weight: 450; color: #4b5563;
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; cursor: pointer;
  transition: background var(--vtmm-speed), color var(--vtmm-speed), border-color var(--vtmm-speed);
}
.vtmm-l3-btn:hover,
.vtmm-l3-item.is-active > .vtmm-l3-btn {
  background: var(--vtmm-accent-light);
  color: var(--vtmm-accent);
  border-left-color: var(--vtmm-accent);
}

/* ============================================================
   PRODUCT PANEL  (rightmost, flex-grow)
   ============================================================ */
.vtmm-product-panel {
  flex: 1; min-width: 0;
  padding: 1.5rem 2rem;
  overflow-y: auto; background: var(--vtmm-bg);
  display: none;
}
.vtmm-product-panel.is-active {
  display: block;
  animation: vtmm-fade-in var(--vtmm-speed) ease;
}

/* Panel heading */
.vtmm-panel-heading {
  font-size: .72rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--vtmm-muted);
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--vtmm-border);
}

/* Section divider inside panel */
.vtmm-section-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: #9ca3af; margin: 1.25rem 0 .75rem;
}

/* Panel link */
.vtmm-panel-link {
  display: inline-block; margin-top: .75rem;
  font-size: .875rem; font-weight: 600; color: var(--vtmm-accent);
}
.vtmm-panel-link:hover { text-decoration: underline; }

/* ── Featured cards ── */
.vtmm-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.vtmm-feat-card {
  border: 1px solid var(--vtmm-border); border-radius: var(--vtmm-r);
  overflow: hidden; background: #fff;
  transition: transform var(--vtmm-speed), box-shadow var(--vtmm-speed);
  cursor: pointer;
}
.vtmm-feat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}

.vtmm-feat-card > img {
  width: 100%; height: 148px; object-fit: cover; display: block;
}
.vtmm-feat-body { padding: 1rem 1.125rem 1.25rem; }
.vtmm-feat-body h6 { font-size: .9375rem; font-weight: 650; margin-bottom: .35rem; color: var(--vtmm-text); }
.vtmm-feat-body p  { font-size: .8rem; color: var(--vtmm-muted); line-height: 1.55; margin-bottom: .65rem; }
.vtmm-feat-body a  { font-size: .8rem; font-weight: 600; color: var(--vtmm-accent); }
.vtmm-feat-body a:hover { text-decoration: underline; }

/* ── Product cards ── */
.vtmm-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: .875rem;
}

.vtmm-prod-card {
  display: flex; align-items: center; gap: .875rem;
  padding: .75rem 1rem;
  border: 1px solid var(--vtmm-border); border-radius: var(--vtmm-r);
  background: #fff; cursor: pointer;
  transition: transform var(--vtmm-speed), box-shadow var(--vtmm-speed), border-color var(--vtmm-speed);
}
.vtmm-prod-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,110,253,.12);
  border-color: var(--vtmm-accent);
}
.vtmm-prod-card > img {
  width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; border-radius: 4px;
}
.vtmm-prod-info { display: flex; flex-direction: column; gap: 3px; }
.vtmm-prod-name { font-size: .875rem; font-weight: 600; color: var(--vtmm-text); line-height: 1.3; }
.vtmm-prod-sub  { font-size: .7rem; color: var(--vtmm-muted); line-height: 1.4; }

/* ── Software & Platforms tile grid ── */
.vtmm-sw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: .875rem;
}
.vtmm-sw-card {
  display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.25rem 1rem;
  border: 1px solid var(--vtmm-border); border-radius: var(--vtmm-r);
  background: #fff; cursor: pointer; text-align: center;
  transition: transform var(--vtmm-speed), box-shadow var(--vtmm-speed), border-color var(--vtmm-speed);
}
.vtmm-sw-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13,110,253,.12);
  border-color: var(--vtmm-accent);
}
.vtmm-sw-card > img { width: 48px; height: 48px; object-fit: contain; }
.vtmm-sw-card-name { font-size: .875rem; font-weight: 600; color: var(--vtmm-text); }
.vtmm-sw-card-desc { font-size: .7rem; color: var(--vtmm-muted); line-height: 1.4; }

/* ── Badges ── */
.vtmm-badge {
  display: inline-block; padding: 1px 6px;
  font-size: .6rem; font-weight: 700; letter-spacing: .05em;
  border-radius: 3px; line-height: 1.7; text-transform: uppercase;
  background: var(--vtmm-accent); color: #fff; vertical-align: middle;
  margin-left: 4px; flex-shrink: 0;
}
.vtmm-badge.hot  { background: #ef4444; }
.vtmm-badge.new  { background: #10b981; }
.vtmm-badge.sale { background: #f59e0b; color: #fff; }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes vtmm-slide-in {
  from { opacity: 0; transform: translateX(-8px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes vtmm-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   SCROLLBARS (Webkit)
   ============================================================ */
.vtmm-mega-inner *::-webkit-scrollbar { width: 4px; }
.vtmm-mega-inner *::-webkit-scrollbar-track { background: transparent; }
.vtmm-mega-inner *::-webkit-scrollbar-thumb {
  background: #d1d5db; border-radius: 4px;
}
.vtmm-mega-inner *::-webkit-scrollbar-thumb:hover { background: var(--vtmm-accent); }

/* ============================================================
   MOBILE HAMBURGER TOGGLE
   ============================================================ */
.vtmm-mob-toggle {
  display: none;
  align-items: center; gap: 8px;
  background: none; border: none;
  padding: .5rem .875rem; font-size: .9rem; font-weight: 700;
  color: var(--vtmm-text); cursor: pointer;
  border-radius: var(--vtmm-r);
  transition: background var(--vtmm-speed);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.vtmm-mob-toggle:hover,
.vtmm-mob-toggle:focus-visible { background: var(--vtmm-accent-light); outline: none; }

.vtmm-mob-label { font-size: .85rem; }

.hbg { display: flex; flex-direction: column; gap: 5px; width: 22px; }
.hbg span {
  display: block; height: 2px; background: currentColor;
  border-radius: 2px;
  transition: transform 250ms ease, opacity 250ms ease;
  transform-origin: center;
}
.vtmm-mob-toggle.is-open .hbg span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.vtmm-mob-toggle.is-open .hbg span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.vtmm-mob-toggle.is-open .hbg span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================================
   MOBILE MENU  (accordion)
   ============================================================ */
.vtmm-mob-menu {
  display: none;
  border-top: 2px solid var(--vtmm-accent);
  background: var(--vtmm-bg);
  /* Use dvh so mobile browser chrome changes don't clip content */
  max-height: calc(100dvh - var(--vtmm-nav-h));
  overflow-y: auto;
  overflow-x: hidden;
  /* Momentum scrolling on iOS */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* Fallback for browsers without dvh */
@supports not (height: 100dvh) {
  .vtmm-mob-menu { max-height: calc(var(--vtmm-mob-vh, 100vh) - var(--vtmm-nav-h)); }
}
.vtmm-mob-menu.is-open { display: block; animation: vtmm-fade-in .2s ease; }

/* ── L1 (top-level nav items) ── */
.vtmm-mob-l1 { border-bottom: 1px solid var(--vtmm-border); }

.vtmm-mob-l1-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: .9rem 1.25rem; font-size: .9375rem; font-weight: 600;
  cursor: pointer; user-select: none;
  transition: color var(--vtmm-speed), background var(--vtmm-speed);
  min-height: 52px;          /* comfortable touch target */
  -webkit-tap-highlight-color: transparent;
}
.vtmm-mob-l1-hd:hover,
.vtmm-mob-l1.is-open > .vtmm-mob-l1-hd { color: var(--vtmm-accent); }
.vtmm-mob-l1-hd a {
  flex: 1; color: inherit; text-decoration: none;
  /* Extend tap area to the whole row */
  padding: .25rem 0;
}

/* Chevron — shared */
.vtmm-mob-chev {
  width: 9px; height: 9px; flex-shrink: 0;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 260ms cubic-bezier(.4,0,.2,1);
  /* Enlarge tap target without growing the visual */
  padding: 6px; box-sizing: content-box; margin: -6px;
}
.vtmm-mob-l1.is-open > .vtmm-mob-l1-hd .vtmm-mob-chev,
.vtmm-mob-l2.is-open > .vtmm-mob-l2-hd .vtmm-mob-chev,
.vtmm-mob-l3.is-open > .vtmm-mob-l3-hd .vtmm-mob-chev {
  transform: rotate(-135deg);
}

/* Accordion bodies — height driven by JS via scrollHeight, NOT css max-height */
.vtmm-mob-l1-body,
.vtmm-mob-l2-body,
.vtmm-mob-l3-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 340ms cubic-bezier(.4,0,.2,1);
}

.vtmm-mob-l1-body {
  background: #f8f9fc;
  border-left: 3px solid var(--vtmm-accent);
  margin-left: 1rem;
}

/* ── L2 (categories inside a mega) ── */
.vtmm-mob-l2 { border-bottom: 1px solid #ebebeb; }

.vtmm-mob-l2-hd {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .75rem 1.25rem; font-size: .875rem; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: color var(--vtmm-speed), background var(--vtmm-speed);
  min-height: 48px;
  -webkit-tap-highlight-color: transparent;
}
.vtmm-mob-l2-hd:hover,
.vtmm-mob-l2.is-open > .vtmm-mob-l2-hd { color: var(--vtmm-accent); }

.vtmm-mob-l2-body {
  background: #fff;
  margin-left: .875rem;
  border-left: 2px solid var(--vtmm-border);
}

/* ── L3 (sub-categories) ── */
.vtmm-mob-l3 { border-bottom: 1px solid #f2f2f2; }

.vtmm-mob-l3-hd {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .65rem 1.25rem; font-size: .8125rem; font-weight: 500;
  cursor: pointer; user-select: none;
  transition: color var(--vtmm-speed), background var(--vtmm-speed);
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.vtmm-mob-l3-hd:hover,
.vtmm-mob-l3.is-open > .vtmm-mob-l3-hd { color: var(--vtmm-accent); }

.vtmm-mob-l3-body {
  background: #fafafa;
  margin-left: .875rem;
  border-left: 2px solid #e8e8e8;
}

/* ── Leaf links (deepest level) ── */
.vtmm-mob-leaf {
  display: flex; align-items: center; gap: 8px;
  padding: .625rem 1.25rem;
  font-size: .8125rem; color: #4b5563;
  transition: color var(--vtmm-speed), background var(--vtmm-speed);
  text-decoration: none;
  min-height: 42px;
  -webkit-tap-highlight-color: transparent;
}
.vtmm-mob-leaf:hover,
.vtmm-mob-leaf:focus { color: var(--vtmm-accent); background: var(--vtmm-accent-light); }
.vtmm-mob-leaf .vtmm-badge { font-size: .55rem; }

/* ── Mobile category / sub-category links ── */
.vtmm-mob-cat-link,
.vtmm-mob-sub-link {
  flex: 1; color: inherit; text-decoration: none;
  font-size: inherit; font-weight: inherit;
  /* pad vertically for easier tapping */
  padding: .25rem 0;
}
.vtmm-mob-cat-link:hover,
.vtmm-mob-sub-link:hover { color: var(--vtmm-accent); }

/* ── "View all" footer link inside accordion ── */
.vtmm-mob-view-all {
  display: block; padding: .7rem 1.25rem .85rem;
  font-size: .8rem; font-weight: 600; color: var(--vtmm-accent);
  text-decoration: none; border-top: 1px solid var(--vtmm-border);
}
.vtmm-mob-view-all:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 991px) {
  .vtmm-top-list,
  .vtmm-actions          { display: none !important; }
  .vtmm-mob-toggle       { display: flex; margin-left: auto; }
}

@media (min-width: 992px) {
  .vtmm-mob-toggle,
  .vtmm-mob-menu         { display: none !important; }
}

/* Tighter columns on mid-range desktops */
@media (max-width: 1200px) {
  :root {
    --vtmm-col1: 140px;
    --vtmm-col2: 185px;
    --vtmm-col3: 185px;
  }
}

/* Small phones — reduce horizontal padding slightly */
@media (max-width: 400px) {
  .vtmm-mob-l1-hd { padding-left: 1rem; padding-right: 1rem; }
  .vtmm-mob-l1-body { margin-left: .75rem; }
}

/* ============================================================
   v2.3 — Cursor helpers
   ============================================================ */
.vtmm-cat-btn,
.vtmm-subcat-btn,
.vtmm-l3-btn { cursor: pointer; }
