/* ==========================================================
   Limka Knitters - Cart page styles
   (loads after style.css, which provides the header, footer,
    buttons and colour variables)
   ========================================================== */

[hidden] { display: none !important; }

/* ---------- Page banner ---------- */
.page-banner {
  background:
    radial-gradient(circle at 90% 0%, rgba(242, 169, 0, 0.18), transparent 45%),
    linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 22px 0 30px;
}
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span:last-child { color: #fff; font-weight: 500; }
.page-banner h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); line-height: 1.2; }
.page-banner p { margin-top: 4px; color: rgba(255, 255, 255, 0.82); font-size: 0.95rem; }

/* ---------- Page body ---------- */
.cart-page { padding-top: 28px; padding-bottom: 64px; }
.cart-loading { text-align: center; color: var(--muted); padding: 60px 0; }

.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 28px;
  align-items: start;
}

.btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Cart list ---------- */
.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.cart-head h2 { font-size: 1.1rem; color: var(--brand); }
.link-danger {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.86rem;
  color: #c0392b;
  cursor: pointer;
  text-decoration: underline;
}
.link-danger:hover { color: #962d22; }

.notice {
  background: #fff4d6;
  border: 1px solid #f0d98a;
  color: #6f5200;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.88rem;
  margin-bottom: 16px;
}
.notice ul { margin: 6px 0 0 18px; padding: 0; list-style: disc; }

.cart-list { display: grid; gap: 14px; }

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
}
.cart-item.unavailable { opacity: 0.85; border-color: #e8b4ad; background: #fff9f8; }

.item-img {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-alt);
}
.item-img img { width: 100%; height: 100%; object-fit: cover; }
.img-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #fff;
}
.img-fallback svg { width: 50%; height: 50%; opacity: 0.9; }

.item-info { min-width: 0; }
.item-school {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--brand);
}
.item-name { font-size: 1rem; font-weight: 600; line-height: 1.3; margin: 2px 0; }
.item-meta { font-size: 0.84rem; color: var(--muted); }
.item-price { margin-top: 8px; font-size: 0.9rem; color: var(--text); }
.item-price s { color: var(--muted); margin-left: 6px; font-size: 0.82rem; }

.badge {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.badge-bulk { background: var(--brand-light); color: var(--brand); }
.badge-warn { background: #fdecea; color: #c0392b; }

.badge-made { margin-right: 6px; }
.badge-tailored { background: #efe5fb; color: #6a3d9a; }
.badge-nairobi { background: #e3eefc; color: #1a5fb4; }

.bulk-hint { margin-top: 6px; font-size: 0.78rem; color: var(--brand); }

.item-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}
.item-total { font-size: 1.05rem; font-weight: 700; color: var(--text); white-space: nowrap; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 2px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}
.qty button {
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--brand);
  cursor: pointer;
  transition: background 0.15s ease;
}
.qty button:hover:not(:disabled) { background: var(--brand-light); }
.qty button:disabled { color: #b7bfba; cursor: not-allowed; }
.qty input {
  width: 46px;
  height: 36px;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  text-align: center;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.qty input::-webkit-outer-spin-button,
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { background: var(--brand-light); }

.remove-btn {
  border: none;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  color: #c0392b;
  cursor: pointer;
  text-decoration: underline;
}
.stock-note { font-size: 0.76rem; color: var(--muted); text-align: right; }
.stock-note.low { color: #b5472f; font-weight: 500; }

.continue-link {
  display: inline-block;
  margin-top: 20px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--brand);
}
.continue-link:hover { color: var(--accent-dark); }

/* ---------- Summary ---------- */
.summary {
  position: sticky;
  top: 90px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.summary h2 { font-size: 1.1rem; color: var(--brand); margin-bottom: 16px; }
.sum-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  font-size: 0.92rem;
}
.sum-muted { color: var(--muted); font-size: 0.86rem; }
.sum-save { color: var(--brand); }
.sum-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 1.05rem;
}
.sum-total strong { font-size: 1.4rem; color: var(--brand); }
.sum-note { margin: 8px 0 18px; font-size: 0.78rem; color: var(--muted); line-height: 1.45; }

.btn.disabled { opacity: 0.5; pointer-events: none; }

.sum-points {
  margin: 18px 0 0;
  padding: 16px 0 0;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
}
.sum-points li { padding-left: 18px; position: relative; }
.sum-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

/* ---------- Empty state ---------- */
.state-box {
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
}
.state-icon { color: var(--brand); margin-bottom: 12px; }
.state-box h2 { font-size: 1.3rem; color: var(--brand); margin-bottom: 8px; }
.state-box p { color: var(--muted); max-width: 420px; margin: 0 auto 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}

@media (max-width: 600px) {
  .page-banner { padding: 16px 0 22px; }
  .cart-item { grid-template-columns: 72px 1fr; gap: 12px; padding: 12px; }
  .item-img { width: 72px; height: 72px; }
  .item-side {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }
  .item-side .stock-note { width: 100%; text-align: left; order: 5; }
}