/* ==========================================================================
   Gear Plus Garage - Premium Mega Menu Styles (Desktop & Mobile)
   ========================================================================== */

/* ── Header Wrap Stacking ── */
#hd .wrap.hd {
  position: relative;
}

/* ── Desktop Navigation Layout ── */
@media (min-width: 1001px) {
  nav#nav {
    position: static;
  }
  nav#nav .nav-list {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
  }
  nav#nav .nav-item {
    position: relative;
  }
  nav#nav .nav-link-wrap {
    display: inline-flex;
    align-items: center;
  }
  nav#nav .nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 13.5px;
    font-weight: 600;
    color: #e5e7eb;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  nav#nav .nav-item:hover > .nav-link-wrap .nav-link,
  nav#nav .nav-item:focus-within > .nav-link-wrap .nav-link,
  nav#nav .nav-item.open > .nav-link-wrap .nav-link {
    background: rgba(255, 255, 255, 0.09);
    color: #ffffff;
  }
  nav#nav .nav-arrow {
    display: inline-block;
    font-size: 11px;
    line-height: 1;
    margin-left: 2px;
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s;
  }
  nav#nav .nav-item:hover .nav-arrow,
  nav#nav .nav-item:focus-within .nav-arrow,
  nav#nav .nav-item.open .nav-arrow {
    transform: rotate(180deg);
    color: var(--red, #f0361b);
  }
  nav#nav .mm-mob-trigger {
    display: none !important;
  }
  nav#nav .mm-mob-panel {
    display: none !important;
  }
  nav#nav .mm-mob-extra {
    display: none !important;
  }

  /* ── Desktop Mega Menu Floating Card ── */
  .megamenu-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    width: min(1080px, calc(100vw - 40px));
    background: rgba(17, 19, 24, 0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    box-shadow: 0 36px 90px rgba(0, 0, 0, 0.88), 0 0 1px rgba(255, 255, 255, 0.16);
    padding: 28px 34px 22px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.26s ease, transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.26s;
    z-index: 1000;
  }
  /* Invisible hover bridge to eliminate gap flicker */
  .megamenu-panel::before {
    content: "";
    position: absolute;
    top: -20px;
    left: 0;
    right: 0;
    height: 20px;
  }
  .has-megamenu:hover .megamenu-panel,
  .has-megamenu:focus-within .megamenu-panel,
  .has-megamenu.open .megamenu-panel {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  /* ── 4-Column Grid Layout ── */
  .mm-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px 32px;
  }
  .mm-col {
    display: flex;
    flex-direction: column;
    gap: 22px;
  }
  .mm-section {
    display: flex;
    flex-direction: column;
  }

  /* ── Category Title ── */
  .mm-cat-title {
    font-size: 11px;
    font-weight: 800;
    color: #ff3823;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: Sora, sans-serif;
  }

  /* ── Item Rows ── */
  .mm-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .mm-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: #d1d5db;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mm-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    transform: translateX(4px);
  }
  .mm-item-name {
    flex: 1;
    transition: color 0.2s;
  }
  .mm-item:hover .mm-item-name {
    color: #ffffff;
  }

  /* ── Footer Bar ── */
  .mm-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 18px;
    margin-top: 22px;
    gap: 20px;
  }
  .mm-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 9px 20px;
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    text-decoration: none;
    transition: all 0.24s ease;
    font-family: Sora, sans-serif;
  }
  .mm-all-btn:hover {
    background: var(--red, #f0361b);
    border-color: var(--red, #f0361b);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(240, 54, 27, 0.45);
  }
  .mm-all-btn svg {
    transition: transform 0.2s;
  }
  .mm-all-btn:hover svg {
    transform: translateX(3px);
  }
  .mm-promo-text {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .mm-promo-text a {
    color: #f3f4f6;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s;
  }
  .mm-promo-text a:hover {
    color: var(--red, #f0361b);
  }
  .mm-bullet {
    color: rgba(255, 255, 255, 0.3);
  }
}

/* ── Badges (Used in Desktop & Mobile) ── */
.mm-badge {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

/* Car Brand Logo Badge - Clean White Contrast Container */
.mm-badge-brand {
  background: #ffffff;
  padding: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.mm-badge-brand .mm-logo-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.mm-badge-brand .mm-svg {
  width: 22px;
  height: 22px;
  display: block;
}

/* Service Icon Badge - High-Tech Red / Dark Accent */
.mm-badge-service {
  background: linear-gradient(135deg, rgba(240, 54, 27, 0.14), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(240, 54, 27, 0.28);
  box-shadow: 0 2px 10px rgba(240, 54, 27, 0.12);
  padding: 5px;
}
.mm-badge-service .mm-svc-svg {
  width: 18px;
  height: 18px;
  color: var(--red, #f0361b);
  display: block;
  transition: transform 0.2s ease, color 0.2s ease;
}

/* Hover Polish */
.mm-item:hover .mm-badge-brand {
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}
.mm-item:hover .mm-badge-service {
  background: rgba(240, 54, 27, 0.28);
  border-color: rgba(240, 54, 27, 0.65);
  box-shadow: 0 4px 18px rgba(240, 54, 27, 0.4);
  transform: scale(1.08);
}
.mm-item:hover .mm-badge-service .mm-svc-svg {
  color: #ff543e;
  transform: scale(1.12);
}

/* ==========================================================================
   Mobile Navigation & Drawer Experience (<= 1000px)
   ========================================================================== */
@media (max-width: 1000px) {
  /* Hide Desktop Panels */
  .megamenu-panel {
    display: none !important;
  }

  /* Nav container in mobile */
  nav#nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #0d0f14;
    border-bottom: 1px solid var(--ln, #262930);
    display: none;
    max-height: 82vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
    z-index: 999;
  }
  nav#nav.open {
    display: block;
    animation: mmSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes mmSlideDown {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  nav#nav .nav-list {
    display: flex;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
  }
  nav#nav .nav-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2px 0;
  }
  nav#nav .nav-item:last-child {
    border-bottom: none;
  }

  /* Link & Accordion Trigger Row */
  nav#nav .nav-link-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }
  nav#nav .nav-link {
    display: block;
    padding: 12px 6px;
    font-size: 15px;
    font-weight: 600;
    color: #e5e7eb;
    text-decoration: none;
    flex: 1;
    font-family: Sora, sans-serif;
  }
  nav#nav .nav-arrow {
    display: none; /* replaced by button on mobile */
  }

  /* Mobile Accordion Toggle Button */
  .mm-mob-trigger {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    padding: 0;
  }
  .mm-mob-trigger:active,
  .mm-mob-trigger.active {
    background: rgba(240, 54, 27, 0.2);
    border-color: var(--red, #f0361b);
    color: var(--red, #f0361b);
  }
  .mm-mob-arrow {
    display: inline-block;
    font-size: 12px;
    line-height: 1;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .mm-mob-trigger[aria-expanded="true"] .mm-mob-arrow {
    transform: rotate(180deg);
    color: var(--red, #f0361b);
  }

  /* Mobile Accordion Content Panel */
  .mm-mob-panel {
    display: none;
    padding: 8px 0 16px;
    animation: mmFadeIn 0.2s ease-out;
  }
  .mm-mob-panel.open {
    display: block;
  }
  @keyframes mmFadeIn {
    from {
      opacity: 0;
      transform: translateY(-4px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Horizontal Filter Tabs */
  .mm-mob-tabs-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px 0 12px;
    margin: 0 -4px;
    scrollbar-width: none;
  }
  .mm-mob-tabs-wrap::-webkit-scrollbar {
    display: none;
  }
  .mm-mob-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 0 4px;
  }
  .mm-mob-tab {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #9ca3af;
    font-size: 11.5px;
    font-weight: 700;
    padding: 6px 13px;
    border-radius: 50px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    font-family: Sora, sans-serif;
  }
  .mm-mob-tab.on {
    background: var(--red, #f0361b);
    border-color: var(--red, #f0361b);
    color: #ffffff;
    box-shadow: 0 2px 10px rgba(240, 54, 27, 0.35);
  }

  /* Mobile Grid (2 Columns) */
  .mm-mob-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-right: 4px;
  }
  .mm-mob-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    padding: 8px 10px;
    text-decoration: none;
    color: #e5e7eb;
    transition: all 0.18s ease;
    box-sizing: border-box;
  }
  .mm-mob-card:active {
    background: rgba(240, 54, 27, 0.15);
    border-color: rgba(240, 54, 27, 0.3);
    transform: scale(0.98);
  }
  .mm-mob-name {
    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }

  /* View All Button inside mobile accordion */
  .mm-mob-footer {
    margin-top: 14px;
    padding-top: 10px;
  }
  .mm-mob-viewall-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 50px;
    padding: 10px 16px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-align: center;
    transition: all 0.2s;
    font-family: Sora, sans-serif;
  }
  .mm-mob-viewall-btn:active {
    background: var(--red, #f0361b);
    border-color: var(--red, #f0361b);
  }

  /* Mobile Drawer Bottom Extras (Booking & Hotline) */
  .mm-mob-extra {
    margin-top: 14px;
    padding-top: 16px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
  }
  .mm-mob-contact-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .mm-mob-book-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    box-sizing: border-box;
    font-family: Sora, sans-serif;
  }
  .mm-mob-quick-links {
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    gap: 8px;
  }
  .mm-mob-quick-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 9px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #e5e7eb;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mm-mob-quick-btn.wa {
    background: rgba(37, 211, 102, 0.12);
    border-color: rgba(37, 211, 102, 0.3);
    color: #25d366;
  }
}

@media (max-width: 440px) {
  .mm-mob-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Brand hover flyout: Repair / Service / Maintenance ── */
.mm-item-arrow{opacity:.45;flex:0 0 12px;transition:opacity .2s,transform .2s}
@media (min-width: 1001px){
  .mm-brand{position:relative}
  .mm-brand:hover .mm-item-arrow,.mm-brand:focus-within .mm-item-arrow{opacity:1;transform:translateX(2px)}
  .mm-sub{position:absolute;top:-6px;left:100%;padding-left:10px;z-index:30;opacity:0;visibility:hidden;pointer-events:none;transform:translateX(-6px);transition:opacity .18s ease,transform .18s ease,visibility .18s}
  .mm-col:nth-child(n+4) .mm-sub{left:auto;right:100%;padding-left:0;padding-right:10px;transform:translateX(6px)}
  .mm-brand:hover>.mm-sub,.mm-brand:focus-within>.mm-sub{opacity:1;visibility:visible;pointer-events:auto;transform:translateX(0)}
  .mm-sub-in{min-width:210px;background:#15181f;border:1px solid rgba(255,255,255,.1);border-radius:14px;padding:8px;box-shadow:0 22px 50px rgba(0,0,0,.75);display:flex;flex-direction:column;gap:2px}
  .mm-sub-in a{display:block;padding:10px 14px;border-radius:9px;color:#d1d5db;font:600 13px Sora,sans-serif;white-space:nowrap;text-decoration:none;transition:background .15s,color .15s}
  .mm-sub-in a:hover{background:rgba(240,54,27,.18);color:#fff}
}
@media (max-width: 1000px){
  .mm-item-arrow{display:none}
  .mm-mob-brandcard{flex-wrap:wrap;cursor:pointer}
  .mm-mob-brandcard.open{grid-column:1/-1;border-color:rgba(240,54,27,.4)}
  .mm-mob-sub{display:none;flex:0 0 100%;flex-direction:column;gap:4px;padding-top:6px}
  .mm-mob-brandcard.open .mm-mob-sub{display:flex}
  .mm-mob-sub a{display:block;padding:10px 12px;border-radius:9px;background:rgba(255,255,255,.05);color:#e5e7eb;font-size:13px;font-weight:600;text-decoration:none}
  .mm-mob-sub a:active{background:rgba(240,54,27,.2)}
}
