@font-face {
  font-family: 'DMSans';
  src: url('DMSans_18pt-Black.ttf') format('truetype');
}

/* ══════════════════════════════════════════════════════
   THEME VARIABLES
   ══════════════════════════════════════════════════════ */

:root,
[data-theme='light'] {
  --bg: #f4f4f4;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --bg-dropdown: #ffffff;
  --bg-dropdown-hover: #f0f4ff;
  --bg-join-btn: #1a1a1a;
  --bg-join-btn-hover: #333333;

  --text-primary: #1a1a1a;
  --text-secondary: #333333;
  --text-muted: #444444;
  --text-subtle: #888888;
  --text-link: #2a5bd7;

  --border-divider: #f0f0f0;
  --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.07);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.12);

  --bar-color: #1a1a1a;
  --toggle-bg: #e8e8e8;
  --toggle-color: #1a1a1a;
}

[data-theme='dark'] {
  --bg: #0f1117;
  --bg-card: #1c1f2a;
  --bg-header: #13161f;
  --bg-dropdown: #1c1f2a;
  --bg-dropdown-hover: #252a3a;
  --bg-join-btn: #e8e8e8;
  --bg-join-btn-hover: #cfcfcf;

  --text-primary: #f0f0f0;
  --text-secondary: #cccccc;
  --text-muted: #aaaaaa;
  --text-subtle: #666666;
  --text-link: #7eb3ff;

  --border-divider: #2a2d3a;
  --shadow-header: 0 2px 12px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-dropdown: 0 8px 30px rgba(0, 0, 0, 0.4);

  --bar-color: #f0f0f0;
  --toggle-bg: #2a2d3a;
  --toggle-color: #f0f0f0;
}

/* ══════════════════════════════════════════════════════
   RESET & BASE
   ══════════════════════════════════════════════════════ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'DMSans', Geneva, Verdana, sans-serif;
  font-size: medium;
  background: var(--bg);
  color: var(--text-primary);
  padding-top: 80px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ══════════════════════════════════════════════════════
   FIXED HEADER
   ══════════════════════════════════════════════════════ */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: var(--bg-header);
  box-shadow: var(--shadow-header);
  height: 70px;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

#header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
}

#logo {
  height: 48px;
  width: auto;
}

/* Groups the toggle + hamburger on the right */
#header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* ══════════════════════════════════════════════════════
   DARK / LIGHT TOGGLE BUTTON
   ══════════════════════════════════════════════════════ */

#theme-toggle {
  background: var(--toggle-bg);
  border: none;
  cursor: pointer;
  border-radius: 50%;
  /* Increased from 36×36 to meet 44×44px touch target minimum */
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: background 0.3s ease, transform 0.2s ease;
}

/* Only apply scale hover on real pointer devices */
@media (hover: hover) {
  #theme-toggle:hover {
    transform: scale(1.1);
  }
}

/* ══════════════════════════════════════════════════════
   NAV / HAMBURGER
   ══════════════════════════════════════════════════════ */

#nav-menu {
  position: relative;
}

#menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  /* Increased from 30×22 to meet 44×44px touch target minimum */
  width: 44px;
  height: 44px;
  padding: 0;
}

.bar {
  display: block;
  width: 30px;
  height: 3px;
  background: var(--bar-color);
  border-radius: 3px;
  transition: transform 0.3s ease, opacity 0.3s ease, background 0.3s ease;
}

#menu-btn.active .bar:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#menu-btn.active .bar:nth-child(2) {
  opacity: 0;
}
#menu-btn.active .bar:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Dropdown */
#dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 14px);
  right: 0;
  background: var(--bg-dropdown);
  border-radius: 10px;
  box-shadow: var(--shadow-dropdown);
  list-style: none;
  min-width: 200px;
  overflow: hidden;
  z-index: 999;
  transition: background 0.3s ease;
}

#dropdown.open {
  display: block;
  animation: fadeDown 0.2s ease;
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#dropdown li a {
  display: block;
  padding: 14px 20px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

#dropdown li a:hover {
  background: var(--bg-dropdown-hover);
  color: var(--text-link);
}

#dropdown li + li {
  border-top: 1px solid var(--border-divider);
}

/* ══════════════════════════════════════════════════════
   SLOGAN
   ══════════════════════════════════════════════════════ */

#slogan {
  text-align: center;
  padding: 48px 24px 24px;
}

#slogan h1 {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -0.5px;
}

/* ══════════════════════════════════════════════════════
   SECTION TITLES
   ══════════════════════════════════════════════════════ */

.section-title {
  text-align: center;
  margin: 24px 0 8px;
  font-size: 1.5rem;
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════════
   EXPLORE OUR GYM SECTION
   ══════════════════════════════════════════════════════ */

#explore-section {
  background: linear-gradient(135deg, #0a1628 0%, #0d2d5e 50%, #1a4a8a 100%);
  width: 100%;
  padding: 56px 24px;
  margin: 0;
}

#explore-section .section-title {
  color: #ffffff;
  font-size: 2rem;
  letter-spacing: 1px;
  margin: 0;
}

#explore-section a:link,
#explore-section a:visited,
#explore-section a:hover {
  text-decoration: none;
  color: #f0f0f0;
}

#about-gym {
  text-align: center;
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════════
   FACTS SECTION
   ══════════════════════════════════════════════════════ */

#facts {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 40px;
  padding: 48px 24px;
  flex-wrap: wrap;
}

#facts > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

#facts img {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

/* Only apply image hover scale on real pointer devices */
@media (hover: hover) {
  #facts img:hover {
    transform: scale(1.12);
    box-shadow: var(--shadow-card-hover);
  }
}

#facts h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

/* ══════════════════════════════════════════════════════
   PLANS LAYOUT
   ══════════════════════════════════════════════════════ */

#plans-container {
  display: flex;
  gap: 24px;
  justify-content: center;
  align-items: stretch;
  padding: 32px 24px 64px;
  max-width: 1100px;
  margin: 0 auto;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   PLAN CARDS
   ══════════════════════════════════════════════════════ */

.plan-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 32px 28px;
  flex: 1 1 240px;
  max-width: 320px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

@media (hover: hover) {
  .plan-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
  }
}

.plan-card h2 {
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--text-primary);
}

.plan-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.per {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-subtle);
}

.plan-card ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.plan-card ul li {
  padding-left: 1.4em;
  position: relative;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.plan-card ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #2a5bd7;
  font-weight: 700;
}

.join-btn {
  margin-top: 16px;
  background: var(--bg-join-btn);
  color: var(--bg);
  text-align: center;
  padding: 12px 0;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
  transition: background 0.2s ease;
}

.join-btn a:link,
.join-btn a:hover,
.join-btn a:visited {
  text-decoration: none;
  color: inherit;
}

@media (hover: hover) {
  .join-btn:hover {
    background: var(--bg-join-btn-hover);
  }
}

/* ══════════════════════════════════════════════════════
   MIDDLE CARD – BLUE "BEST VALUE" THEME
   (always blue regardless of mode)
   ══════════════════════════════════════════════════════ */

#middle-text {
  background: linear-gradient(145deg, #1a3fd4, #2a5bd7);
  color: #ffffff;
  box-shadow: 0 8px 40px rgba(42, 91, 215, 0.4);
  transform: scale(1.04);
}

@media (hover: hover) {
  #middle-text:hover {
    transform: scale(1.04) translateY(-4px);
  }
}

#middle-text h2,
#middle-text h3 {
  color: #ffffff;
}

#middle-text .per {
  color: rgba(255, 255, 255, 0.65);
}

#middle-text ul li {
  color: rgba(255, 255, 255, 0.9);
}

#middle-text ul li::before {
  color: #7eb3ff;
}

#middle-text .join-btn {
  background: #ffffff;
  color: #1a3fd4;
}

@media (hover: hover) {
  #middle-text .join-btn:hover {
    background: #e8eeff;
  }
}

.includes-note {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.75);
  font-style: italic;
}

/* Best Value badge */
#best-value-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffd63a;
  color: #1a1a1a;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: 20px;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.original-price {
  text-decoration: line-through;
  color: #ccc;
}

footer {
  text-align: center;
  color: navy;
  font-size: 75%;
  padding: 32px 0px 10px 0px;
}

[data-theme='dark'] footer {
  color: #a4caff;
}

/* ══════════════════════════════════════════════════════
   MEMBERSHIP TABLE – HEADER ALIGNMENT FIX
   ══════════════════════════════════════════════════════ */

.comparison-table thead th.col-plan {
  padding-top: 2.5rem;
}

.best-value-badge {
  position: absolute;
  top: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   CLASSES PAGE
   ══════════════════════════════════════════════════════ */

#classes-hero {
  text-align: center;
  padding: 48px 24px 32px;
}

#classes-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #000000 0%, #0a1f6e 100%);
  color: #ffffff;
  padding: 12px 32px;
  border-radius: 12px;
  display: inline-block;
}

#classes-hero h2 {
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Grid of class cards */
#classes-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  padding: 16px 32px 64px;
  max-width: 1200px;
  margin: 0 auto;
}

.class-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  width: 200px;
  transition: transform 0.3s ease;
}

.class-card img {
  width: 200px;
  height: 200px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  transition: width 0.35s ease, height 0.35s ease, border-radius 0.35s ease,
    box-shadow 0.35s ease;
}

/* Only apply class card hover effects on real pointer devices */
@media (hover: hover) {
  .class-card:hover {
    transform: translateY(-6px);
  }

  .class-card:hover img {
    width: 230px;
    height: 230px;
    border-radius: 24px;
    box-shadow: var(--shadow-card-hover);
  }

  .class-card:hover h2 {
    color: var(--text-link);
  }
}

.class-card h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
  transition: color 0.2s ease;
}

/* ══════════════════════════════════════════════════════
   CONTACT PAGE
   ══════════════════════════════════════════════════════ */

#contact-hero {
  text-align: center;
  padding: 48px 24px 16px;
  max-width: 600px;
  margin: 0 auto;
}

#contact-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #000000 0%, #0a1f6e 100%);
  color: #ffffff;
  padding: 12px 32px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 16px;
}

#contact-hero p {
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1.6;
}

#contact-wrapper {
  display: flex;
  gap: 40px;
  max-width: 1100px;
  margin: 40px auto 64px;
  padding: 0 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* Info cards column */
#contact-info {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1 1 280px;
}

.info-card {
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

@media (hover: hover) {
  .info-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
  }
}

.info-icon {
  font-size: 1.6rem;
  line-height: 1;
  margin-top: 2px;
}

.info-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.info-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0;
}

.info-sub {
  margin-top: 6px !important;
  color: var(--text-subtle) !important;
  font-size: 0.82rem !important;
}

/* Form column */
#contact-form-wrap {
  background: var(--bg-card);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  padding: 36px 32px;
  flex: 1 1 340px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#contact-form-wrap h2 {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--text-primary);
  margin: 0;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

.form-group input,
.form-group select,
.form-group textarea {
  background: var(--bg);
  color: var(--text-primary);
  border: 1.5px solid var(--border-divider);
  border-radius: 8px;
  padding: 10px 14px;
  /* Increased to 1rem (16px) to prevent iOS Safari auto-zoom */
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  resize: vertical;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: #2a5bd7;
}

.form-group select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

#send-btn {
  background: var(--bg-join-btn);
  color: var(--bg);
  border: none;
  border-radius: 8px;
  padding: 13px 0;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: background 0.2s ease;
}

@media (hover: hover) {
  #send-btn:hover {
    background: var(--bg-join-btn-hover);
  }
}

#form-confirm {
  text-align: center;
  color: #2a5bd7;
  font-size: 0.9rem;
  font-weight: 700;
  margin: 0;
}

/* ══════════════════════════════════════════════════════
   MEMBERSHIP PAGE
   ══════════════════════════════════════════════════════ */

/* Only fire select/join hover effects on real pointer devices */
@media (hover: hover) {
  .select-btn:hover {
    border-color: #1aaa7e;
    color: #1aaa7e;
  }

  .join-now-btn:hover {
    background: #148f68;
    transform: translateY(-1px);
  }
}

/* ══════════════════════════════════════════════════════
   MOBILE – RESPONSIVE BREAKPOINTS
   ══════════════════════════════════════════════════════ */

@media (max-width: 600px) {
  /* Stack facts section vertically */
  #facts {
    flex-direction: column;
    align-items: center;
    gap: 32px;
    padding: 32px 16px;
  }

  /* Stack plan cards and make them full width */
  #plans-container {
    flex-direction: column;
    align-items: center;
    padding: 16px 16px 48px;
  }

  .plan-card {
    max-width: 100%;
    width: 100%;
  }

  /* Remove desktop scale on the middle card so it sits flush */
  #middle-text {
    transform: scale(1);
  }

  /* Stack contact columns */
  #contact-wrapper {
    flex-direction: column;
    gap: 24px;
    padding: 0 16px;
  }

  #contact-info,
  #contact-form-wrap {
    width: 100%;
    flex: none;
  }

  /* Tighten form padding on small screens */
  #contact-form-wrap {
    padding: 24px 20px;
  }

  /* Tighten classes grid padding */
  #classes-grid {
    padding: 16px 16px 48px;
    gap: 16px;
  }

  /* Prevent dropdown from clipping on very narrow screens */
  #dropdown {
    right: -12px;
    min-width: 160px;
  }

  /* ── Membership page ── */

  /* Tighten perks banner spacing */
  .perks-banner {
    gap: 0.75rem 1.2rem;
    padding: 0.75rem 1rem 1.5rem;
    font-size: 0.85rem;
  }

  /* Give feature column more room; tighten plan columns */
  .comparison-table .col-feature {
    width: 40%;
  }
  .comparison-table .col-plan {
    width: 20%;
  }

  /* Reduce cell padding and font sizes so table fits */
  .comparison-table tbody td,
  .comparison-table thead th {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  tr.price-row td {
    font-size: 1.1rem;
  }

  .plan-header-name {
    font-size: 1.1rem;
  }

  /* Increase touch targets on membership buttons to 44px */
  .select-btn,
  .join-now-btn {
    min-height: 44px;
    padding: 0.7rem 1.4rem;
  }
}

#about-gym {
  padding: 0 16px 32px;
  font-size: 0.92rem;
  line-height: 1.7;
}

.class-card {
  width: 160px;
}

.class-card img {
  width: 160px;
  height: 160px;
}

#send-btn {
  min-height: 44px;
}
