/* Cart, bag badge and toast.
 *
 * Colours come from each site's own custom properties, with a fallback so
 * nothing renders invisible if a variable is missing on some page.
 */

:root {
  --shop-fg: var(--cart-fg, #F5F0EB);
  --shop-bg: var(--cart-bg, #0A0A0A);
  --shop-line: var(--cart-line, rgba(245, 240, 235, 0.16));
  --shop-dim: var(--cart-dim, #8a8a8a);
  --shop-accent: var(--cart-accent, #F5F0EB);
}

/* ---------- bag badge (icon-only nav links) ---------- */

a.cart-icon { position: relative; }

a.cart-icon .shop-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 8px;
  background: var(--shop-accent);
  color: var(--shop-bg);
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  letter-spacing: 0;
  pointer-events: none;
}

/* ---------- toast ---------- */

#shop-toast {
  position: fixed;
  top: 84px;
  right: 20px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: min(360px, calc(100vw - 40px));
  padding: 13px 18px;
  background: var(--shop-bg);
  color: var(--shop-fg);
  border: 1px solid var(--shop-line);
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-14px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}

#shop-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#shop-toast .shop-toast-msg { flex: 1 1 auto; }

#shop-toast a {
  flex: 0 0 auto;
  color: var(--shop-fg);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  #shop-toast { top: auto; bottom: 16px; right: 16px; left: 16px; max-width: none; }
}

/* ---------- cart page ---------- */

#shop-cart { margin: 0 0 56px; }

#shop-cart .shop-empty { padding: 36px 0 8px; }
#shop-cart .shop-empty p { margin: 0 0 20px; }

.shop-cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 34px;
  font-size: 14px;
}

.shop-cart-table th {
  padding: 0 12px 12px 0;
  border-bottom: 1px solid var(--shop-line);
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shop-dim);
}

.shop-cart-table td {
  padding: 18px 12px 18px 0;
  border-bottom: 1px solid var(--shop-line);
  vertical-align: middle;
}

/* The flex box lives in a wrapper, not on the <td> itself — a display:flex
   cell drops its own bottom border and the row rule breaks mid-table. */
.shop-cell-item .shop-item { display: flex; align-items: center; gap: 16px; }
.shop-cell-item img { flex: 0 0 auto; width: 64px; height: 64px; object-fit: cover; }
.shop-cell-item a { color: inherit; text-decoration: none; font-weight: 600; }
.shop-cell-item a:hover { text-decoration: underline; text-underline-offset: 3px; }
.shop-cell-item small { display: block; margin-top: 3px; color: var(--shop-dim); font-size: 12px; }

.shop-cell-price, .shop-cell-line { white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop-cell-line { font-weight: 700; }

.shop-cell-qty input {
  width: 62px;
  padding: 9px 10px;
  background: transparent;
  color: inherit;
  border: 1px solid var(--shop-line);
  font: inherit;
  text-align: center;
}

.shop-cell-x { width: 34px; text-align: right; }

.shop-cell-x button {
  width: 30px;
  height: 30px;
  background: transparent;
  color: var(--shop-dim);
  border: 0;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.shop-cell-x button:hover { color: var(--shop-fg); }

/* ---------- totals ---------- */

.shop-totals {
  max-width: 380px;
  margin-left: auto;
  padding: 24px;
  border: 1px solid var(--shop-line);
}

.shop-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 7px 0;
  font-size: 14px;
}

.shop-row-total {
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid var(--shop-line);
  font-size: 17px;
}

.shop-nudge {
  margin: 10px 0 2px;
  color: var(--shop-dim);
  font-size: 12px;
}

.shop-totals .btn, .shop-totals .shop-checkout { width: 100%; margin-top: 20px; }

.shop-note {
  margin: 14px 0 0;
  color: var(--shop-dim);
  font-size: 11.5px;
  line-height: 1.5;
}

.shop-error {
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid #a33;
  color: #e88;
  font-size: 12.5px;
}

@media (max-width: 720px) {
  .shop-cart-table thead { display: none; }
  .shop-cart-table, .shop-cart-table tbody, .shop-cart-table tr, .shop-cart-table td { display: block; width: 100%; }
  .shop-cart-table tr { position: relative; padding: 18px 0; border-bottom: 1px solid var(--shop-line); }
  .shop-cart-table td { padding: 3px 0; border: 0; }
  .shop-cell-item .shop-item { padding-right: 38px; }
  .shop-cell-price { color: var(--shop-dim); font-size: 13px; }
  .shop-cell-x { position: absolute; top: 14px; right: 0; width: auto; }
  .shop-totals { max-width: none; }
}

/* ---------- order confirmed ---------- */

.shop-confirmed { max-width: 620px; padding: 48px 0 64px; }
.shop-confirmed h1 { margin: 0 0 18px; }
.shop-confirmed p { margin: 0 0 16px; line-height: 1.65; }
