:root {
  --ink: #191713;
  --muted: #746d63;
  --line: #d9d0bf;
  --paper: #fffaf0;
  --cream: #eee7d8;
  --charcoal: #24211d;
  --taupe: #6b6255;
  --accent: #b48a45;
  --rust: #3a1205;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--charcoal);
  color: var(--ink);
  font-family: "Helvetica Neue", Arial, sans-serif;
}

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

button {
  border-radius: 0;
}

[hidden] {
  display: none !important;
}

.classes-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0 16px 36px;
}

.classes-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 180px;
  padding: 30px 0 24px;
  color: #fffaf0;
}

.classes-hero p,
.package-section p,
.class-section p,
.class-modal header p {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.classes-hero h1 {
  margin: 0;
  font-size: clamp(2.8rem, 7vw, 6.4rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.classes-hero nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  border: 1px solid rgba(255, 250, 240, 0.42);
  padding: 10px 14px;
  color: #fffaf0;
  text-decoration: none;
  font-weight: 800;
}

.classes-hero nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.package-section,
.class-section {
  margin-bottom: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.package-section > header,
.class-section > header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--taupe);
  color: #fffaf0;
}

.package-section h2,
.class-section h2,
.class-modal h2 {
  margin: 0;
  font: 500 1.5rem/1.15 Georgia, serif;
}

.class-section label {
  display: grid;
  gap: 5px;
  color: #fffaf0;
  font-size: 0.78rem;
  font-weight: 800;
}

.class-section select {
  min-height: 40px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  padding: 8px 10px;
  background: #fffaf0;
  color: var(--ink);
}

.section-toggle {
  min-height: 40px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  padding: 8px 12px;
  background: transparent;
  color: #fffaf0;
  cursor: pointer;
  font-weight: 850;
}

.class-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: flex-end;
  gap: 10px;
}

.bookable-filter {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: 40px;
  border: 1px solid rgba(255, 250, 240, 0.5);
  padding: 8px 10px;
}

.bookable-filter input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.package-grid,
.class-grid {
  display: grid;
  gap: 12px;
  padding: 14px;
}

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

.package-card,
.class-card {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  padding: 16px;
  background: #fffdf8;
}

.package-card:nth-child(2),
.class-card.is-light {
  background: #e9e6df;
}

.package-card h3,
.class-card h3 {
  margin: 0;
  font-size: 1.1rem;
  text-decoration: underline;
}

.package-card strong {
  font-size: 1.35rem;
}

.package-card p,
.class-card p,
.loading-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.package-card button,
.class-card button,
.class-modal button[type="submit"] {
  min-height: 42px;
  border: 1px solid var(--charcoal);
  padding: 10px 14px;
  background: var(--charcoal);
  color: #fffaf0;
  cursor: pointer;
  font-weight: 900;
}

.class-card {
  grid-template-columns: minmax(140px, 0.8fr) minmax(0, 1.4fr) auto;
  align-items: center;
}

.class-time {
  display: grid;
  gap: 4px;
}

.class-time strong {
  font-size: 1rem;
}

.class-time span,
.class-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

.class-actions {
  display: grid;
  gap: 8px;
  min-width: 140px;
}

.class-availability-label {
  display: block;
  min-width: 140px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
}

.load-more-row {
  display: flex;
  justify-content: center;
  padding: 0 14px 18px;
}

.load-more-row button {
  min-height: 42px;
  border: 1px solid var(--charcoal);
  padding: 10px 18px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.class-card button.waitlist {
  border-color: var(--taupe);
  background: transparent;
  color: var(--ink);
}

.class-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(25, 23, 19, 0.72);
}

.class-modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--paper);
  border: 1px solid var(--accent);
}

.class-modal > header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  color: #fffaf0;
  background: var(--charcoal);
}

#closeClassModal {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 250, 240, 0.34);
  background: transparent;
  color: #fffaf0;
  cursor: pointer;
  font-size: 1.45rem;
}

.modal-body {
  padding: 20px;
}

.class-summary {
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f5eddd;
  color: var(--muted);
  line-height: 1.45;
}

.class-summary strong {
  display: block;
  color: var(--ink);
  font-size: 1.1rem;
}

.class-summary > span {
  display: block;
}

.class-summary-description {
  margin: 12px 0 !important;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink) !important;
  font-size: 0.95rem !important;
  line-height: 1.55 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: pre-line;
}

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

.class-modal label:not(.waiver-check),
.packageCodeLabel {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.class-modal input,
.class-modal textarea {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fffdf8;
  color: var(--ink);
}

.payment-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.payment-choice label {
  display: flex !important;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  background: #fffdf8;
  color: var(--ink) !important;
}

.payment-choice input {
  width: auto;
  min-height: auto;
}

.waiver-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #fffdf8;
}

.waiver-panel summary {
  cursor: pointer;
  font-weight: 850;
}

.waiver-copy {
  display: grid;
  gap: 10px;
  max-height: 170px;
  overflow: auto;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.waiver-copy p {
  margin: 0;
}

.waiver-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  margin: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.4;
}

.waiver-check input {
  width: 18px;
  min-height: 18px;
}

.modal-status {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.modal-status.is-error {
  color: #8b3428;
}

.modal-status.is-success {
  color: #496246;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions .secondary {
  min-height: 42px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

@media (max-width: 760px) {
  .classes-shell {
    padding: 0;
  }

  .classes-hero,
  .package-section > header,
  .class-section > header {
    display: grid;
    padding-right: 16px;
    padding-left: 16px;
  }

  .package-section,
  .class-section {
    border-right: 0;
    border-left: 0;
  }

  .package-grid {
    grid-template-columns: 1fr;
  }

  .class-card {
    grid-template-columns: 1fr;
  }

  .class-actions {
    min-width: 0;
  }

  .classes-hero nav,
  .class-filters {
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .classes-hero nav a,
  .section-toggle,
  .class-filters label,
  .class-filters select,
  .class-availability-label {
    width: 100%;
  }

  .class-modal-backdrop {
    align-items: stretch;
    padding: 0;
    background: var(--paper);
  }

  .class-modal {
    width: 100%;
    max-height: 100dvh;
    border: 0;
  }

  .form-grid,
  .payment-choice {
    grid-template-columns: 1fr;
  }

  .class-modal input,
  .class-modal textarea,
  .class-section select {
    font-size: 16px;
  }
}
