/* ==========================================================================
   patch-cart.css — Handlekurv (cart) page
   Matches: variations/cart.jsx
   Load: only on is_cart()
   ========================================================================== */

/* Reset Woo defaults that fight the design */
.woocommerce-cart .woocommerce,
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart .cart-collaterals,
.woocommerce-cart table.shop_table {
  all: revert;
}

.n3d-cart {
  --ink: oklch(0.20 0.01 260);
  --ink-2: oklch(0.30 0.01 260);
  --ink-3: oklch(0.40 0.01 250);
  --line: oklch(0.92 0.005 250);
  --line-soft: oklch(0.94 0.005 250);
  --bg-soft: oklch(0.96 0.005 250);
  --accent: #2F80ED;

  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 48px 80px;
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  color: var(--ink);
}
@media (max-width: 900px) {
  .n3d-cart { grid-template-columns: 1fr; gap: 28px; padding: 16px 20px 100px; }
}

/* ----- Heading ----- */
.n3d-cart__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.n3d-cart__head h1 {
  font-family: 'Geist', 'Inter', sans-serif;
  font-weight: 400;
  font-size: 44px;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1;
}
.n3d-cart__count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: oklch(0.5 0.01 250);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ----- Line items ----- */
.n3d-cart__list { list-style: none; padding: 0; margin: 0; }
.n3d-cart__row {
  display: grid;
  grid-template-columns: 100px 1fr auto auto;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--line-soft);
  align-items: center;
}
@media (max-width: 600px) {
  .n3d-cart__row {
    grid-template-columns: 80px 1fr;
    grid-template-areas:
      "img body"
      "img qty"
      "img price";
    gap: 8px 16px;
  }
  /* Image's own 100px width would overflow the 80px grid column and
     overlap the body. Lock it to the column width on mobile. */
  .n3d-cart__img {
    grid-area: img;
    width: 80px;
    min-width: 0;
  }
  .n3d-cart__body { grid-area: body; min-width: 0; }
  .n3d-cart__qty { grid-area: qty; justify-self: start; }
  .n3d-cart__price { grid-area: price; justify-self: start; }
}

.n3d-cart__img {
  display: block;
  width: 100px;
  aspect-ratio: 1;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  overflow: hidden;
  border-radius: 4px;
}
.n3d-cart__img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.n3d-cart__cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: oklch(0.5 0.01 250);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}
.n3d-cart__t {
  font-size: 15px;
  font-weight: 500;
  margin: 0 0 4px 0;
  color: var(--ink);
  font-family: 'Geist', 'Inter', sans-serif;
}
.n3d-cart__t a { color: inherit; text-decoration: none; }
.n3d-cart__meta {
  font-size: 13px;
  color: oklch(0.45 0.01 250);
}
.n3d-cart__rm {
  background: none;
  border: none;
  padding: 6px 0;
  font-size: 12px;
  color: oklch(0.5 0.01 250);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-family: 'Inter', sans-serif;
  margin-top: 6px;
}
.n3d-cart__rm:hover { color: var(--ink); }

/* Qty stepper */
.n3d-cart__qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid oklch(0.88 0.005 250);
  border-radius: 999px;
  background: white;
}
.n3d-cart__qty button {
  width: 36px; height: 40px;
  border: none; background: transparent;
  font-size: 16px; cursor: pointer;
  color: var(--ink-2);
}
.n3d-cart__qty button:hover { color: var(--ink); }
.n3d-cart__qty span {
  width: 28px; text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}

.n3d-cart__price {
  font-size: 16px;
  font-weight: 500;
  min-width: 80px;
  text-align: right;
  font-family: 'Geist', 'Inter', sans-serif;
}

/* ----- Summary aside ----- */
.n3d-cart__aside { padding-top: 8px; }
.n3d-cart__sum {
  background: var(--bg-soft);
  padding: 28px;
  border-radius: 8px;
  position: sticky;
  top: 24px;
}
.n3d-cart__sum-h {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: oklch(0.5 0.01 250);
  margin-bottom: 20px;
}
.n3d-cart__sum-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  padding: 6px 0;
  color: var(--ink-2);
}
.n3d-cart__sum-row > :last-child {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
}
.n3d-cart__sum-note {
  font-size: 12px;
  color: oklch(0.45 0.55 145);
  font-family: 'JetBrains Mono', monospace;
  margin: 4px 0;
}
.n3d-cart__sum-divider {
  height: 1px;
  background: oklch(0.88 0.005 250);
  margin: 16px 0;
}
.n3d-cart__sum-total {
  display: flex;
  justify-content: space-between;
  font-size: 22px;
  font-weight: 500;
  color: oklch(0.18 0.01 260);
  font-family: 'Geist', 'Inter', sans-serif;
}
.n3d-cart__sum-mva {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: oklch(0.5 0.01 250);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 24px;
  text-align: right;
}

.n3d-cart__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: oklch(0.18 0.01 260);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
}
.n3d-cart__checkout:hover { background: oklch(0.10 0.01 260); color: white; }
.n3d-cart__checkout-note {
  font-size: 12px;
  color: oklch(0.45 0.01 250);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

.n3d-cart__trust {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid oklch(0.88 0.005 250);
}
.n3d-cart__trust-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: oklch(0.35 0.01 260);
  padding: 5px 0;
}
.n3d-cart__trust-row::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ----- Vipps mark ----- */
.n3d-vipps {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #FF5B24;
  color: white;
  width: 44px; height: 18px;
  border-radius: 3px;
  font-family: 'Inter', sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.02em;
}

/* ----- Empty cart ----- */
.n3d-cart-empty {
  max-width: 520px;
  margin: 80px auto;
  padding: 0 24px;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: var(--ink);
}
.n3d-cart-empty__icon {
  width: 88px; height: 88px;
  margin: 0 auto 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-soft);
  border-radius: 50%;
}
.n3d-cart-empty__h {
  font-family: 'Geist', 'Inter', sans-serif;
  font-weight: 400;
  font-size: 36px;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.n3d-cart-empty__p {
  font-size: 15px;
  color: var(--ink-3);
  margin: 0 0 32px;
}
.n3d-cart-empty__cta {
  display: inline-block;
  padding: 14px 28px;
  background: oklch(0.18 0.01 260);
  color: white;
  border-radius: 999px;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.n3d-cart-empty__cta:hover { background: oklch(0.08 0.01 260); color: white; }

/* ----- Sticky mobile checkout ----- */
@media (max-width: 900px) {
  .n3d-cart__aside { padding-top: 0; }
  .n3d-cart__sum { position: static; }
  .n3d-cart__mobile-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: white;
    border-top: 1px solid var(--line);
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 50;
  }
  .n3d-cart__mobile-bar-total {
    flex: 1;
    font-family: 'Geist', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 500;
  }
  .n3d-cart__mobile-bar .n3d-cart__checkout {
    width: auto;
    padding: 12px 20px;
    font-size: 14px;
  }
}
@media (min-width: 901px) {
  .n3d-cart__mobile-bar { display: none; }
}
