:root {
  --bg: #f6f8f7;
  --surface: #fffdf9;
  --surface-strong: #ffffff;
  --ink: #111827;
  --muted: #5e6775;
  --line: #dfe5e1;
  --gold: #d5a84d;
  --gold-dark: #8a641f;
  --green: #123f36;
  --green-soft: #e7f0ec;
  --clay: #8b4d3e;
  --blue: #1e516f;
  --shadow: 0 18px 48px rgba(20, 40, 35, .12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #ffffff 0, var(--bg) 520px);
  color: var(--ink);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 12px clamp(18px, 5vw, 72px);
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--green), #0b2722);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 26px rgba(18, 63, 54, .24);
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  line-height: 1.2;
  letter-spacing: .01em;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #33373d;
  font-size: 13px;
  font-weight: 600;
}

.nav a {
  position: relative;
  border-radius: 999px;
  padding: 8px 11px;
}

.nav a:hover {
  background: var(--green-soft);
  color: var(--green);
}

.nav a.active {
  background: var(--green);
  color: #fff;
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 99px;
  background: currentColor;
}

.hero,
.page-hero,
.section,
.admin-wrap {
  padding-left: clamp(18px, 7vw, 96px);
  padding-right: clamp(18px, 7vw, 96px);
}

.hero {
  position: relative;
  display: flex;
  min-height: min(760px, calc(100vh - 66px));
  align-items: center;
  padding-top: 92px;
  padding-bottom: 132px;
  background:
    linear-gradient(90deg, rgba(9, 22, 19, .92) 0%, rgba(11, 32, 28, .76) 48%, rgba(11, 32, 28, .34) 100%),
    url("../img/hero-ministry.png") center right / cover no-repeat;
  color: #fff;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  background: rgba(255, 255, 255, .25);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.hero h1,
.page-hero h1,
.section-title {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  line-height: 1.04;
}

.hero h1 {
  max-width: 850px;
  font-size: clamp(46px, 7vw, 86px);
  text-wrap: balance;
}

.hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(17px, 2vw, 20px);
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--gold-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #f0c979;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gold);
  border-radius: 8px;
  padding: 11px 20px;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn.gold {
  background: var(--gold);
  color: #18110a;
  box-shadow: 0 14px 30px rgba(213, 168, 77, .24);
}

.btn.secondary {
  background: #fff;
  color: var(--ink);
}

.btn.secondary.light {
  border-color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .08);
  color: #fff;
}

.btn:hover {
  transform: translateY(-1px);
}

.panel,
.card,
.book,
.content-box,
.form-box,
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, .86);
  box-shadow: var(--shadow);
}

.hero-strip {
  position: absolute;
  right: clamp(18px, 7vw, 96px);
  bottom: 34px;
  left: clamp(18px, 7vw, 96px);
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius);
  background: rgba(13, 22, 20, .64);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.hero-strip span {
  min-height: 66px;
  display: flex;
  align-items: center;
  border-right: 1px solid rgba(255, 255, 255, .18);
  padding: 16px 20px;
  color: rgba(255, 255, 255, .9);
  font-size: 14px;
  font-weight: 700;
}

.hero-strip span:last-child {
  border-right: 0;
}

.section {
  padding-top: clamp(56px, 7vw, 86px);
  padding-bottom: clamp(56px, 7vw, 86px);
}

.section.alt {
  background: var(--surface-strong);
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 30px;
}

.section-title,
.page-hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  text-wrap: balance;
}

.muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 18px;
}

.grid-5 {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.card,
.book,
.content-box,
.form-box,
.panel,
.metric {
  padding: 24px;
}

.card {
  min-height: 230px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .98), rgba(250, 252, 251, .95));
  transition: transform .18s ease, border-color .18s ease;
}

.card:hover {
  border-color: rgba(18, 63, 54, .32);
  transform: translateY(-4px);
}

.card-kicker,
.price {
  color: var(--gold-dark);
  font-weight: 800;
}

.card-kicker {
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.split,
.book-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, .9fr);
  gap: 36px;
  align-items: center;
}

.books {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.book {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface-strong);
}

.book img,
.book-cover {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--green-soft);
}

.book img {
  box-shadow: inset 0 0 0 1px rgba(20, 60, 52, .08);
}

.book h3,
.card h3 {
  margin: 8px 0 0;
  line-height: 1.2;
}

.book .btn {
  margin-top: auto;
}

.page-hero {
  padding-top: 72px;
  padding-bottom: 34px;
  background:
    linear-gradient(120deg, rgba(18, 63, 54, .96), rgba(30, 81, 111, .72)),
    url("../img/hero-ministry.png") center right / cover no-repeat;
  border-bottom: 1px solid var(--line);
  color: #fff;
}

.page-hero .muted {
  max-width: 720px;
  color: rgba(255, 255, 255, .76);
}

.page-hero.compact {
  padding-top: 54px;
  padding-bottom: 54px;
}

.feature-panel {
  position: relative;
  overflow: hidden;
  min-height: 290px;
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #fff;
}

.feature-panel .muted {
  color: rgba(255, 255, 255, .76);
}

.panel-number {
  display: block;
  margin-bottom: 42px;
  color: rgba(255, 255, 255, .34);
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(60px, 10vw, 112px);
  line-height: .8;
}

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

.page-shell {
  display: grid;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.side-panel {
  position: sticky;
  top: 104px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, var(--green), #0b2924);
  color: #fff;
  padding: 24px;
}

.side-panel .muted {
  color: rgba(255, 255, 255, .76);
}

.info-list {
  display: grid;
  gap: 12px;
  margin-top: 22px;
}

.info-list span {
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding-top: 12px;
  color: rgba(255, 255, 255, .82);
  font-weight: 700;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 24px;
}

.catalog-count,
.pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 7px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.book-detail {
  align-items: start;
}

.book-detail .book-cover {
  max-height: 720px;
  box-shadow: var(--shadow);
}

.book-summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}

.checkout-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: clamp(22px, 4vw, 36px);
  box-shadow: var(--shadow);
}

.checkout-summary {
  display: grid;
  gap: 12px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.summary-row strong {
  text-align: right;
}

.payment-card {
  background:
    linear-gradient(135deg, rgba(20, 60, 52, .97), rgba(10, 27, 24, .96));
  color: #fff;
}

.payment-card .muted {
  color: rgba(255, 255, 255, .74);
}

.admin-hero {
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(120deg, rgba(20, 60, 52, .08), rgba(196, 147, 62, .12)),
    var(--surface);
  padding: 38px clamp(18px, 7vw, 96px);
}

.admin-hero .admin-actions {
  margin-bottom: 0;
}

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

label {
  display: grid;
  gap: 7px;
  color: #30343a;
  font-size: 14px;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font: inherit;
  padding: 13px 14px;
}

textarea {
  resize: vertical;
}

.field-help {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
}

.cover-preview {
  width: min(180px, 100%);
  aspect-ratio: 4 / 5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  background: var(--green-soft);
}

.file-preview {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
  color: var(--gold-dark);
  font-size: 13px;
  font-weight: 800;
}

.book-thumb {
  width: 54px;
  aspect-ratio: 4 / 5;
  border-radius: 6px;
  object-fit: cover;
  background: var(--green-soft);
}

.admin-wrap {
  padding-top: 46px;
  padding-bottom: 72px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 24px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin: 22px 0;
}

.metric strong {
  display: block;
  font-size: 42px;
  line-height: 1;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.table th,
.table td {
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #fbf7ef;
  font-size: 13px;
  text-transform: uppercase;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--gold-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  padding: 0 0 0 10px;
}

.notice {
  border: 1px solid #eed294;
  border-radius: var(--radius);
  background: #fff8e6;
  padding: 12px 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  background: #eef0f3;
  color: #3b4047;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.paid {
  background: #dff4e8;
  color: #126436;
}

.status.pending_payment,
.status.new {
  background: #fff1cc;
  color: #7a5520;
}

.status.payment_failed {
  background: #ffe1df;
  color: #9b2119;
}

.status.delivered {
  background: #dceeff;
  color: #175b8f;
}

.status.cancelled {
  background: #eee8df;
  color: #6b4a2f;
}

.table-actions {
  display: flex;
  min-width: 230px;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-actions form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.table-actions select {
  min-width: 150px;
  padding: 7px 9px;
  font-size: 13px;
}

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  background: #0f201d;
  color: var(--muted);
  padding: 28px clamp(18px, 7vw, 96px);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer strong {
  color: #fff;
}

.footer p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, .68);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  color: rgba(255, 255, 255, .78);
  font-weight: 700;
}

.footer-links a:hover {
  color: #fff;
}

@media (max-width: 1080px) {
  .grid-5,
  .books {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav {
    gap: 12px;
    font-size: 13px;
  }
}

@media (max-width: 840px) {
  .menu-btn {
    display: inline-flex;
    flex-direction: column;
  }

  .nav {
    position: absolute;
    top: 72px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
    padding: 14px;
  }

  .nav.open {
    display: flex;
  }

  .hero,
  .split,
  .book-detail,
  .form-grid,
  .page-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }

  .catalog-toolbar {
    display: block;
  }

  .hero {
    min-height: auto;
    align-items: flex-start;
    padding-top: 70px;
    padding-bottom: 250px;
    background:
      linear-gradient(180deg, rgba(15, 25, 22, .92) 0%, rgba(15, 25, 22, .7) 58%, rgba(15, 25, 22, .45) 100%),
      url("../img/hero-ministry.png") center / cover no-repeat;
  }

  .hero-strip {
    grid-template-columns: 1fr;
  }

  .hero-strip span {
    min-height: 54px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .18);
  }

  .hero-strip span:last-child {
    border-bottom: 0;
  }

  .section-head,
  .footer {
    display: block;
  }

  .footer-brand {
    margin-bottom: 14px;
  }

  .footer-links {
    margin-top: 12px;
  }
}

@media (max-width: 620px) {
  .brand {
    min-width: 0;
  }

  .brand small {
    display: none;
  }

  .grid-5,
  .books,
  .metrics {
    grid-template-columns: 1fr;
  }

  .card,
  .book,
  .content-box,
  .form-box,
  .panel,
  .hero-panel,
  .metric {
    padding: 20px;
  }
}
