:root {
  --navy: #06244d;
  --navy-deep: #021938;
  --navy-soft: #123765;
  --gold: #b88900;
  --gold-soft: #d7b45a;
  --red: #c8102e;
  --paper: #fbfaf6;
  --ink: #0b2347;
  --muted: #556174;
  --line: #d9dde5;
  --panel: #ffffff;
  --panel-blue: #eef3f8;
  --shadow: 0 18px 40px rgba(3, 25, 56, 0.15);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top right, rgba(184, 137, 0, 0.12), transparent 32rem),
    linear-gradient(135deg, #edf2f8, #ffffff 42%, #f7f3e6);
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

.page-shell {
  position: relative;
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(176deg, transparent 0 91%, var(--gold) 91.1% 91.6%, var(--navy) 91.7% 100%),
    var(--paper);
  box-shadow: 0 0 55px rgba(1, 22, 48, 0.22);
}

.corner {
  position: absolute;
  top: 0;
  right: 0;
  pointer-events: none;
  z-index: 0;
}

.corner-gold {
  width: min(52vw, 560px);
  height: min(22vw, 210px);
  border-bottom-left-radius: 100% 84%;
  border-bottom: 8px solid var(--gold);
}

.corner-red {
  width: min(26vw, 260px);
  height: min(18vw, 170px);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08), transparent 42%),
    var(--red);
  clip-path: polygon(42% 0, 100% 0, 100% 100%, 69% 88%);
  opacity: 0.96;
}

.brand-header, .content-wrap, .site-footer { position: relative; z-index: 1; }

.brand-header { padding: 34px clamp(24px, 6vw, 78px) 0; }

.ukzn-brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--ink);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: clamp(0.68rem, 1.3vw, 0.88rem);
  line-height: 1.06;
}

.brand-mark { width: clamp(68px, 8vw, 96px); height: auto; }

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-weight: 850; }

.content-wrap {
  padding: 24px clamp(22px, 6vw, 78px) 156px;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.5rem, 5.8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0.015em;
  color: var(--navy-deep);
  font-weight: 700;
}

.hero h1 span { color: var(--gold); }

.hero p {
  max-width: 860px;
  margin: 16px 0 26px;
  font-size: clamp(1rem, 1.8vw, 1.24rem);
  line-height: 1.55;
  color: #263a5e;
  font-weight: 550;
}

.title-rule, .section-rule {
  display: flex;
  align-items: center;
  width: min(560px, 78%);
  margin-top: 10px;
  color: var(--gold);
}

.title-rule::before, .title-rule::after,
.section-rule::before, .section-rule::after {
  content: "";
  height: 2px;
  flex: 1;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
}

.title-rule span, .section-rule span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  margin: 0 16px;
}

.catalogue-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(300px, 0.74fr);
  gap: 32px;
  align-items: stretch;
}

.catalogue-card, .profile-card {
  border: 2px solid rgba(184, 137, 0, 0.55);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.catalogue-card { overflow: hidden; }

.catalogue-topbar {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  background: var(--navy);
  color: white;
}

.catalogue-topbar h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.12rem, 2vw, 1.45rem);
  letter-spacing: 0.015em;
  white-space: nowrap;
}

.catalogue-topbar h2 span { color: var(--gold-soft); }

.search-box {
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
  background: #f5f7fb;
  border: 1px solid #d5dbe5;
  overflow: hidden;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  background: transparent;
  color: var(--ink);
}

.search-box button {
  width: 42px;
  height: 40px;
  border: 0;
  color: #6a7383;
  background: transparent;
  font-size: 1.3rem;
}

.catalogue-controls {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 16px 18px 10px;
  background: #fafbfc;
}

.catalogue-controls select {
  min-width: 178px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: #374866;
  background: white;
  font-weight: 650;
}

.device-list {
  margin: 0 18px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: white;
}

.device-row {
  display: grid;
  grid-template-columns: 105px minmax(140px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 118px;
  padding: 16px 18px;
  border-bottom: 1px solid #e5e8ef;
  transition: background 180ms ease, transform 180ms ease;
}

.device-row:last-child { border-bottom: 0; }
.device-row:hover, .device-row:focus-within { background: #f8fafc; }
.device-row.active { background: linear-gradient(90deg, rgba(184, 137, 0, 0.13), rgba(255,255,255,0)); }

.device-visual {
  width: 90px;
  height: 74px;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px rgba(2, 25, 56, 0.16));
}

.device-copy h3 {
  margin: 0 0 8px;
  color: var(--navy);
  font-size: clamp(1rem, 2vw, 1.28rem);
  line-height: 1.12;
}

.device-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.device-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.stock {
  font-weight: 800;
  color: var(--navy);
  white-space: nowrap;
}

.stock.low { color: #945f00; }
.stock.none { color: #8f1f2c; }

.details-button, .booking-button, .secondary-button {
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  letter-spacing: 0.01em;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.details-button {
  padding: 10px 22px;
  color: white;
  background: linear-gradient(180deg, var(--navy-soft), var(--navy-deep));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 5px 12px rgba(2, 25, 56, 0.18);
}

.details-button:hover, .booking-button:hover, .secondary-button:hover { transform: translateY(-1px); }

.profile-card {
  padding: 26px 22px 22px;
  background: rgba(255,255,255,0.93);
}

.profile-intro {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 20px;
  align-items: start;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(184, 137, 0, 0.34);
}

.profile-icon {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-size: 2.2rem;
  box-shadow: inset 0 0 0 5px rgba(255,255,255,0.08);
}

.profile-card h2 {
  margin: 0 0 10px;
  color: var(--navy-deep);
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
}

.profile-card p {
  margin: 0;
  color: #334766;
  line-height: 1.45;
  font-weight: 550;
}

.profile-details { margin: 0; }

.profile-details div {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 18px;
  padding: 20px 0;
  border-bottom: 1px solid rgba(184, 137, 0, 0.34);
}

.profile-details dt {
  display: contents;
  color: var(--muted);
  font-weight: 650;
}

.profile-details dt span {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--gold);
  color: white;
  font-size: 1.7rem;
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.18);
}

.profile-details dd {
  margin: 0;
  align-self: end;
  color: var(--navy-deep);
  font-size: 1.45rem;
  line-height: 1.1;
  font-weight: 900;
}

.booking-button {
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px;
  color: white;
  background: linear-gradient(180deg, #d5a000, #aa7900);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 0 8px 16px rgba(141, 96, 0, 0.22);
  font-size: 1.08rem;
}

.booking-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.empty-state {
  margin: 18px;
  padding: 20px;
  border-radius: 10px;
  background: #fff6df;
  color: #6d4a00;
  font-weight: 700;
}

.journey {
  margin: 34px auto 0;
  text-align: center;
}

.journey .section-rule { width: 100%; margin: 0 auto 8px; }

.journey h2 {
  display: inline-block;
  margin: -34px 0 18px;
  padding: 0 28px;
  background: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy-deep);
  font-size: clamp(1.7rem, 3vw, 2.25rem);
}

.journey-steps {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin: 0;
  padding: 0;
  counter-reset: steps;
}

.journey-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  color: var(--navy);
}

.journey-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 26px;
  left: calc(50% + 36px);
  width: calc(100% - 52px);
  border-top: 3px dotted #97a1b2;
}

.journey-steps span {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-size: 1.42rem;
  font-weight: 900;
  box-shadow: 0 9px 18px rgba(2, 25, 56, 0.18);
  z-index: 1;
}

.journey-steps strong {
  max-width: 145px;
  font-size: 0.98rem;
  line-height: 1.25;
}

.scan-panel {
  display: grid;
  grid-template-columns: 150px 82px 1fr;
  align-items: center;
  gap: 22px;
  width: min(820px, 92%);
  margin: 34px auto 20px;
  padding: 18px 28px;
  border: 2px dashed rgba(184, 137, 0, 0.52);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.qr-placeholder {
  display: grid;
  place-items: center;
  min-height: 112px;
  border: 2px dashed #7e8797;
  color: #293d5d;
  font-weight: 750;
  font-size: 1.25rem;
  line-height: 1.22;
  background: white;
}

.qr-code-img {
  width: min(100%, 118px);
  height: auto;
  display: block;
  object-fit: contain;
}

.scan-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  color: white;
  background: var(--navy);
  font-size: 2.2rem;
}

.scan-panel h2 {
  margin: 0 0 6px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-size: 1.7rem;
}

.scan-panel p { margin: 0; color: #334766; font-weight: 600; }

.staff-note {
  display: flex;
  align-items: center;
  gap: 22px;
  width: min(960px, 96%);
  margin: 0 auto;
  padding: 16px 22px;
  border: 1px solid #cdd7e4;
  border-radius: 12px;
  background: #f4f7fb;
  color: var(--navy-deep);
  box-shadow: 0 8px 18px rgba(2, 25, 56, 0.08);
}

.staff-note span {
  display: grid;
  place-items: center;
  flex: 0 0 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  font-size: 1.75rem;
}

.site-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(22px, 6vw, 78px) 26px;
  color: rgba(255,255,255,0.9);
  background: var(--navy);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.booking-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 28px 80px rgba(2, 25, 56, 0.35);
}

.booking-dialog::backdrop { background: rgba(2, 25, 56, 0.56); }

.booking-form {
  position: relative;
  padding: 30px;
  background: var(--paper);
  border: 2px solid rgba(184, 137, 0, 0.5);
}

.booking-form h2 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--navy);
  font-size: 2rem;
}

.booking-summary { margin: 0 0 20px; color: #435571; font-weight: 650; }

.close-dialog {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: #eef3f8;
  color: var(--navy);
  font-size: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid label {
  display: grid;
  gap: 7px;
  color: var(--navy-deep);
  font-weight: 800;
}

.form-grid input, .form-grid textarea {
  width: 100%;
  border: 1px solid #cbd4df;
  border-radius: 10px;
  padding: 12px 13px;
  background: white;
  color: var(--ink);
}

.full-width { grid-column: 1 / -1; }

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.secondary-button {
  width: auto;
  padding: 14px 20px;
  color: var(--navy);
  background: #e8eef6;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  max-width: 380px;
  padding: 16px 18px;
  border-radius: 12px;
  color: white;
  background: var(--navy);
  box-shadow: 0 18px 50px rgba(2, 25, 56, 0.28);
  font-weight: 760;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 920px) {
  .catalogue-grid { grid-template-columns: 1fr; }
  .journey-steps { grid-template-columns: 1fr; gap: 14px; text-align: left; }
  .journey-steps li { grid-template-columns: 58px 1fr; justify-items: start; align-items: center; }
  .journey-steps li:not(:last-child)::after { display: none; }
  .journey-steps strong { max-width: none; }
  .scan-panel { grid-template-columns: 130px 72px 1fr; width: 100%; }
}

@media (max-width: 680px) {
  .brand-header { padding-top: 22px; }
  .content-wrap { padding-inline: 16px; padding-bottom: 185px; }
  .catalogue-topbar { grid-template-columns: 1fr; }
  .catalogue-topbar h2 { white-space: normal; }
  .device-row { grid-template-columns: 78px 1fr; }
  .device-visual { width: 72px; height: 58px; }
  .device-actions { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: center; justify-items: stretch; }
  .details-button { width: 100%; }
  .profile-intro { grid-template-columns: 60px 1fr; }
  .profile-icon { width: 58px; height: 58px; font-size: 1.7rem; }
  .profile-details div { grid-template-columns: 58px 1fr; }
  .profile-details dt span { width: 48px; height: 48px; font-size: 1.35rem; }
  .scan-panel { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .qr-placeholder { width: 160px; }
  .staff-note { align-items: flex-start; }
  .site-footer { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .dialog-actions { flex-direction: column-reverse; }
}
