/* =========================================================
   BOM Shelter — 04 Overlays + responsive
   ========================================================= */

/* ---------- Cart drawer ---------- */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(6, 24, 35, 0.48);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}
.scrim.is-open { opacity: 1; pointer-events: auto; }
.scrim[hidden] { display: none; }

.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: 100;
  width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border-left: 1px solid var(--line-2);
  box-shadow: -20px 0 50px -20px rgba(4, 20, 30, 0.4);
  transform: translateX(102%);
  transition: transform 0.26s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: hidden;
}
.drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.drawer__title { display: flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; }
.drawer__title b { color: var(--orange); font-weight: 600; }
.drawer__close {
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid color-mix(in srgb, var(--paper) 30%, transparent);
  border-radius: 3px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  transition: background 0.15s ease;
}
.drawer__close:hover { background: color-mix(in srgb, var(--paper) 16%, transparent); }
.drawer__close svg { width: 14px; height: 14px; }
.drawer__body { flex: 1; overflow-y: auto; padding: 0 20px; }
.drawer__foot { border-top: 1px solid var(--line-2); padding: 18px 20px 22px; background: var(--paper-2); }

.cart-empty { padding: 48px 10px; text-align: center; }
.cart-empty__box {
  border: 1px dashed var(--line-2);
  border-radius: 4px;
  padding: 32px 20px;
  margin-bottom: 18px;
  background: var(--raised);
}
.cart-empty svg { width: 38px; height: 38px; margin: 0 auto 12px; color: var(--ink-3); }
.cart-empty h3 { font-size: 20px; margin-bottom: 6px; }
.cart-empty p { font-size: 13.5px; color: var(--ink-3); margin-bottom: 18px; }

.cart-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line__icon {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--raised);
  color: var(--ink-2);
}
.cart-line__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.cart-line__name { font-size: 13.5px; font-weight: 500; line-height: 1.35; color: var(--ink); }
.cart-line__meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); margin-top: 2px; }
.cart-line__remove { border: 0; background: none; padding: 0; cursor: pointer; color: var(--ink-3); line-height: 1; transition: color 0.15s ease; }
.cart-line__remove:hover { color: var(--red); }
.cart-line__remove svg { width: 13px; height: 13px; }
.cart-line__bot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.cart-line__price { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--ink); }

.shipbar { margin-bottom: 16px; }
.shipbar__labels {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.shipbar__labels b { color: var(--green); font-weight: 600; }
.shipbar__track {
  position: relative;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--line-2);
}
.shipbar__track span { position: absolute; inset: 0 auto 0 0; background: var(--blue); border-radius: 3px; transition: width 0.3s ease; }
.cart-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
}
.cart-sub span { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); }
.cart-sub b { font-family: var(--font-display); font-size: 28px; letter-spacing: -0.025em; color: var(--ink); }
.cart-tax { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; color: var(--ink-3); margin-bottom: 14px; }
.cart-note { display: flex; align-items: center; gap: 7px; margin-top: 12px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.03em; color: var(--ink-3); }
.cart-note svg { width: 13px; height: 13px; color: var(--green); flex: none; }

/* ---------- Modal ---------- */
.modal-wrap { position: fixed; inset: 0; z-index: 110; display: grid; place-items: center; padding: 24px; }
.modal-wrap[hidden] { display: none; }
.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(6, 24, 35, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal {
  position: relative;
  z-index: 1;
  width: min(780px, 100%);
  max-height: min(88vh, 820px);
  overflow-y: auto;
  padding: 28px;
  background: var(--raised);
  border: 1px solid var(--line-2);
  border-radius: 6px;
  box-shadow: var(--shadow);
  animation: modalIn 0.22s ease;
}
@keyframes modalIn { from { opacity: 0; transform: translateY(10px); } }
.modal__close {
  position: absolute;
  top: 14px; right: 14px;
  display: grid;
  place-items: center;
  width: 32px; height: 32px;
  border: 1px solid var(--line-2);
  border-radius: 3px;
  background: var(--raised);
  cursor: pointer;
  color: var(--ink-2);
  z-index: 2;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.modal__close:hover { border-color: var(--orange); color: var(--orange); }
.modal__close svg { width: 14px; height: 14px; }

/* ---------- Toast ---------- */
.toasts {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 130;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 3px;
  box-shadow: var(--shadow);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  animation: toastIn 0.2s ease;
  pointer-events: auto;
}
.toast svg { width: 14px; height: 14px; color: #4ade80; flex: none; }
.toast--out { opacity: 0; transform: translateY(6px); transition: opacity 0.22s ease, transform 0.22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } }

/* Tighten the chrome on narrow desktops before the mobile menu takes over */
@media (max-width: 1180px) and (min-width: 981px) {
  .head__in { gap: 20px; }
  .nav { gap: 12px; }
}
@media (max-width: 1040px) and (min-width: 981px) {
  .cart-btn { padding: 8px 9px; }
  .cart-btn > span:not(.cart-count) { display: none; }
}

/* Mobile menu on primary nav */
@media (max-width: 980px) {
  .menu-btn { display: grid; }
  .nav {
    position: fixed;
    top: var(--head-h);
    left: 0; right: 0;
    z-index: 65;
    background: var(--raised);
    border-bottom: 1px solid var(--line-2);
    box-shadow: var(--shadow);
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 12px 20px 20px;
  }
  .nav.is-open { display: flex; }
  .nav a {
    padding: 12px 6px;
    font-size: 13px;
    border-bottom: 1px solid var(--line);
  }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
  .nav a[aria-current="page"] { color: var(--orange); }
}

/* Keep the chrome on one line on small phones */
@media (max-width: 600px) {
  .head__in { gap: 12px; }
  .brand { gap: 9px; }
  .brand__mark { width: 32px; height: 32px; }
  .brand__name { font-size: 18px; }
  .brand__sub { display: none; }
  .head__tools { gap: 8px; }
  .cart-btn { padding: 8px 9px; }
  .cart-btn > span:not(.cart-count) { display: none; }
}
