html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  background: #f5f6f8;
  color: #151515;
}

.page-shell {
  padding-top: 64px;
}

.brand-logo {
  width: auto;
  height: 40px;
  object-fit: contain;
}

.nav-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  position: relative;
}

.nav-brand {
  justify-self: start;
}

.nav-cart {
  position: absolute;
  left: 50%;
  justify-self: auto;
  transform: translateX(-50%);
}

.nav-contact {
  justify-self: end;
  color: #ffd400;
  font-weight: 700;
  line-height: 1.35;
  text-align: right;
}

.cart-link {
  display: inline-flex;
  min-width: 94px;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.cart-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #ced4da;
  border-radius: 6px;
  overflow: hidden;
  background-color: #fff;
  height: 30px;
  vertical-align: middle;
}

.cart-stepper .cart-remove,
.cart-stepper .cart-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  padding: 0;
  border: none;
  border-radius: 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: background-color 120ms ease, color 120ms ease;
}

.cart-stepper .cart-remove {
  background-color: #f8f9fa;
  color: #495057;
  border-right: 1px solid #ced4da;
}

.cart-stepper .cart-remove:hover {
  background-color: #e9ecef;
  color: #212529;
}

.cart-stepper .cart-add {
  background-color: #212529;
  color: #fff;
  border-left: 1px solid #212529;
}

.cart-stepper .cart-add:hover {
  background-color: #343a40;
  color: #fff;
}

.cart-stepper .cart-remove:active,
.cart-stepper .cart-add:active {
  transform: scale(0.96);
}

.cart-stepper .cart-qty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 0 4px;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  background-color: #fff;
  user-select: none;
}

.cart-stepper .cart-qty.has-qty {
  background-color: yellow;
}

.part-name-link {
  color: #111827;
  /* font-weight: 600; */
  font-size: 1rem;
  text-decoration: none;
}

.part-name-link:hover {
  color: #0d6efd;
  text-decoration: underline;
}

.part-detail-image {
  min-height: 420px;
}

.part-detail-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 28px;
}

.part-number-display {
  color: #ffd400;
  font-size: clamp(3rem, 12vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  margin-bottom: 1rem;
  text-shadow: 0 1px 0 #111;
}

.part-detail-list dt {
  color: #6b7280;
}

.part-detail-list dd {
  font-weight: 600;
}

.checkout-table-wrap {
  width: 100%;
}

.checkout-table {
  table-layout: fixed;
  width: 100%;
  font-size: 0.875rem;
}

.checkout-table th,
.checkout-table td {
  overflow-wrap: anywhere;
  vertical-align: middle;
}

.checkout-part-col {
  width: 44%;
}

.checkout-drone-col {
  width: 11%;
}

.checkout-section-col {
  width: 12%;
}

.checkout-rrp-col {
  width: 8%;
}

.checkout-qty-col {
  width: 5%;
}

.checkout-total-col {
  width: 11%;
}

.checkout-actions-col {
  width: 9%;
}

.checkout-part-cell {
  max-width: 60%;
  white-space: normal;
}

.checkout-table .btn-group-sm > .btn {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
}

.checkout-table tfoot {
  border-top: 2px solid #111827;
}

.checkout-table tfoot th {
  font-size: 1rem;
  font-weight: 700;
  color: #111827;
  padding: 0.75rem 0.5rem;
}

.drone-card {
  display: block;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.drone-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.drone-image,
.diagram-frame {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.drone-image {
  aspect-ratio: 4 / 3;
}

.drone-image img,
.diagram-frame img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.diagram-frame {
  min-height: 320px;
}

.diagram-frame--annotated {
  position: relative;
  min-height: 0;
}

.diagram-frame--annotated img {
  display: block;
}

.diagram-annotations {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.diagram-annotation {
  fill: rgba(255, 193, 7, .18);
  stroke: #d97706;
  stroke-width: .008;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  pointer-events: all;
  cursor: pointer;
  transition: opacity 120ms ease, fill 120ms ease;
}

.diagram-annotation.is-highlighted,
.diagram-annotation:focus {
  opacity: 1;
  fill: rgba(36, 213, 0, 0.5);
  outline: none;
}

.parts-table tr.is-annotation-highlighted > * {
  background-color: rgba(36, 213, 0, .18) !important;
}

.annotation-editor-canvas {
  width: 100%;
  overflow: auto;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
}

.annotation-part-item.is-active {
  border-color: #d97706;
  background: #fff7ed;
}

.annotation-part-details,
.annotation-part-actions {
  flex: 0 0 calc(50% - .25rem);
  max-width: calc(50% - .25rem);
  min-width: 0;
}

.annotation-part-details {
  overflow-wrap: anywhere;
}

.annotation-parts-scroll {
  max-height: 500px;
  overflow-y: auto;
}

.parts-table-scroll {
  max-height: 700px;
  overflow-y: auto;
}

.image-placeholder {
  display: grid;
  min-height: 100%;
  place-items: center;
  color: #6b7280;
  font-weight: 700;
  background: #eef2f7;
}

.image-placeholder.large {
  min-height: 320px;
}

.quick-nav {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.quick-nav-item {
  flex: 0 0 150px;
  color: #111;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 10px;
}

.quick-nav-item img,
.quick-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: #eef2f7;
  border-radius: 6px;
  margin-bottom: 8px;
}

.quick-nav-item span {
  display: block;
  font-size: 0.875rem;
  line-height: 1.25;
}

.section-block,
.checkout-block {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 28px;
}

.parts-table th,
.parts-table td {
  /* white-space: nowrap; */
}

.parts-table td:nth-child(3) {
  min-width: 100px;
  white-space: normal;
}

.admin-narrow {
  max-width: 460px;
}

.clickable-row {
  cursor: pointer;
}

@media (max-width: 767.98px) {
  .nav-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    width: 100%;
  }

  .nav-brand {
    margin-right: 0;
    position: absolute;
    left: 1rem;
  }

  .brand-logo {
    height: 22px;
  }

  .brand-text {
    display: none;
  }

  .nav-cart {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
  }

  .checkout-table,
  .checkout-table thead,
  .checkout-table tbody,
  .checkout-table tr,
  .checkout-table td {
    display: block;
    width: 100%;
  }

  .checkout-table thead {
    display: none;
  }

  .checkout-table tr {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem 0;
  }

  .checkout-table td {
    border: 0;
    display: grid;
    grid-template-columns: 7rem 1fr;
    gap: 0.75rem;
    padding: 0.25rem 0;
    text-align: left !important;
  }

  .checkout-table td::before {
    content: attr(data-label);
    color: #6b7280;
    font-weight: 600;
  }

  .checkout-table td[colspan] {
    display: block;
  }

  .checkout-table td[colspan]::before {
    content: none;
  }

  .checkout-table tfoot {
    display: block;
    width: 100%;
    border-top: 2px solid #111827;
  }

  .checkout-table tfoot tr {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 0;
    padding: 0.75rem 0;
  }

  .checkout-table tfoot th {
    display: inline-block;
    padding: 0;
    font-size: 1.05rem;
    font-weight: 700;
  }

  .checkout-table tfoot .checkout-total-empty {
    display: none;
  }

  .section-block,
  .checkout-block {
    padding: 16px;
  }
}
