/* Shared by stock vehicles and sale orders; sized around the CRM sidebar. */
.order-navigation-frame {
  container: order-sections / inline-size;
  min-width: 0;
  margin: 0 0 32px;
}

.order-navigation {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 12px;
  overflow: visible;
  background: #fff;
  border: 1px solid #e1e7f0;
  border-radius: 16px;
  box-shadow: 0 3px 14px #17243b04;
}

/* Nine vehicle sections form three balanced rows on wide screens. */
.vehicle-navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.order-navigation-link {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 68px;
  padding: 14px 18px;
  border: 1px solid #e5eaf3;
  border-radius: 10px;
  background: #f7f9fc;
  color: #53627a;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .15s, color .15s, border-color .15s;
  touch-action: manipulation;
}

.order-navigation-link:last-child:nth-child(7) { grid-column: span 2; }

.order-navigation-icon {
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: #f1f4f9;
  color: #64748d;
}

.order-navigation-icon svg {
  display: block;
  width: 20px;
  height: 20px;
}

/* The sidebar's generic `nav span` rules must not constrain tab labels. */
.order-navigation-label {
  display: block;
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (hover: hover) {
  .order-navigation-link:hover {
    background: #f2f5fc;
    border-color: #e3e9f5;
    color: #223e71;
  }
}

.order-navigation-link[aria-current="page"] {
  background: #0036ff;
  border-color: #0036ff;
  color: #fff;
  box-shadow: 0 3px 8px #0036ff24;
}

.order-navigation-link[aria-current="page"] .order-navigation-icon {
  background: #ffffff24;
  color: #fff;
}

.order-navigation-link:focus-visible {
  outline: 3px solid #7f9bff;
  outline-offset: 2px;
}

@container order-sections (max-width: 960px) {
  .order-navigation { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-navigation-link:last-child:nth-child(7) { grid-column: 1 / -1; }
  .order-navigation-link:last-child:nth-child(8) { grid-column: span 2; }
}

@container order-sections (max-width: 640px) {
  .vehicle-navigation .order-navigation-link:last-child:nth-child(9) { grid-column: 1 / -1; }
  .order-navigation-link:last-child:nth-child(8) { grid-column: auto; }
  .order-navigation {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
  }

  .order-navigation-link {
    min-height: 64px;
    gap: 10px;
    padding: 12px;
    font-size: 13px;
  }

  .order-navigation-icon {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    border-radius: 8px;
  }
}

@container order-sections (max-width: 360px) {
  .order-navigation { grid-template-columns: minmax(0, 1fr); }
}
