/* Gym Flooring Calculator page (components/gym-flooring-calculator.jinja).
   Loaded only on that page from templates/page.jinja top_links.
   Uses logical properties (inline-start/end) so RTL and LTR both work
   without a separate main.rtl.css override. */

.gfc {
  --gfc-ink: #111;
  --gfc-ink-2: #555;
  --gfc-line: #e5e5e5;
  --gfc-soft: #f5f5f5;
  --gfc-radius: 8px;
  --gfc-accent: #0047AB;      /* cobalt */
  --gfc-accent-dark: #003A8C;
  --gfc-accent-soft: #E8EFF9;
  --gfc-accent-light: #8FB3E8;
  color: var(--gfc-ink);
  padding-bottom: 0;
}

.gfc .container { max-width: 1200px; }

.gfc-h2 {
  font-size: 28px;
  line-height: 1.2;
  font-weight: 700;
  margin: 0 0 20px;
  color: var(--gfc-ink);
}

/* ---------- Buttons ---------- */
.gfc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 28px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none !important;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s, opacity .2s;
}
.gfc-btn--dark { background: var(--gfc-accent); color: #fff !important; box-shadow: 0 6px 18px rgba(0, 71, 171, .28); }
.gfc-btn--dark:hover:not(:disabled) { background: var(--gfc-accent-dark); }
.gfc-btn--accent { background: var(--gfc-accent); color: #fff !important; }
.gfc-btn--accent:hover { background: var(--gfc-accent-dark); }
.gfc-btn--light { background: #fff; color: var(--gfc-ink) !important; }
.gfc-btn--light:hover { background: #e9e9e9; }
.gfc-btn--outline { background: transparent; color: var(--gfc-ink) !important; border-color: var(--gfc-ink); }
.gfc-btn--outline:hover { background: var(--gfc-ink); color: #fff !important; border-color: var(--gfc-ink); }
.gfc-btn--block { display: flex; width: 100%; }
.gfc-btn:disabled { opacity: .45; cursor: not-allowed; }
.gfc-btn:focus-visible,
.gfc input:focus-visible,
.gfc select:focus-visible,
.gfc summary:focus-visible { outline: 2px solid var(--gfc-accent); outline-offset: 2px; }

/* ---------- Hero ---------- */
.gfc-hero {
  background: var(--gfc-ink);
  color: #fff;
  padding: 64px 0 56px;
  text-align: center;
  background-image: radial-gradient(ellipse at 50% 120%, rgba(0, 71, 171, .6), transparent 60%);
}
.gfc-eyebrow {
  display: inline-block;
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gfc-accent-light);
  font-weight: 600;
  margin-bottom: 12px;
}
.gfc-hero__title {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 16px;
  color: #fff;
}
.gfc-hero__sub {
  max-width: 640px;
  margin: 0 auto 28px;
  font-size: 17px;
  line-height: 1.6;
  opacity: .85;
}

/* ---------- Intro / formula ---------- */
.gfc-intro {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 56px;
  padding-bottom: 24px;
}
.gfc-intro__text p { color: var(--gfc-ink-2); font-size: 16px; line-height: 1.7; margin: 0; }
.gfc-formula { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gfc-formula li {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--gfc-soft);
  border-radius: var(--gfc-radius);
  font-weight: 600;
}
.gfc-formula__n {
  flex: 0 0 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gfc-accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

/* ---------- Calculator ---------- */
.gfc-tool { padding-top: 40px; padding-bottom: 56px; scroll-margin-top: 100px; }
.gfc-tool__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.gfc-form {
  border: 1px solid var(--gfc-line);
  border-radius: var(--gfc-radius);
  padding: 24px;
  display: grid;
  gap: 18px;
}
.gfc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* Grid items default to min-width:auto, so a long <select> option would
   widen the column past the viewport on mobile. */
.gfc-intro > *, .gfc-tool__grid > *, .gfc-row > *, .gfc-field, .gfc-tips > * { min-width: 0; }
.gfc-tool__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.gfc-field { display: grid; gap: 6px; }
.gfc-field label { font-size: 14px; font-weight: 600; margin: 0; }
.gfc-field input,
.gfc-field select,
.gfc-product__variant {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #cfcfcf;
  border-radius: var(--gfc-radius);
  background: #fff;
  font-size: 16px; /* >=16px stops iOS zoom on focus */
  color: var(--gfc-ink);
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
}
.gfc-field input:focus,
.gfc-field select:focus,
.gfc-product__variant:focus { border-color: var(--gfc-accent); box-shadow: 0 0 0 3px rgba(0, 71, 171, .18); outline: none; }
.gfc-field input[type="number"] { direction: ltr; text-align: start; }
[dir="rtl"] .gfc-field input[type="number"] { text-align: right; }
.gfc-error { color: #b42318; font-size: 14px; margin: -6px 0 0; }

.gfc-product {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--gfc-line);
  border-radius: var(--gfc-radius);
  background: var(--gfc-soft);
}
.gfc-product[hidden] { display: none; }
.gfc-product__img {
  flex: 0 0 72px;
  height: 72px;
  border-radius: 6px;
  background: #e9e9e9;
  overflow: hidden;
}
.gfc-product__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gfc-product__body { display: grid; gap: 4px; min-width: 0; flex: 1; }
.gfc-product__name { font-weight: 700; color: var(--gfc-ink) !important; line-height: 1.3; }
.gfc-product__meta { font-size: 13px; color: var(--gfc-ink-2); }
.gfc-product__price { font-weight: 600; }
.gfc-product__variant { min-height: 40px; padding: 6px 10px; font-size: 14px; margin-top: 4px; }
.gfc-product__variant[hidden] { display: none; }

.gfc-result {
  background: var(--gfc-soft);
  border-radius: var(--gfc-radius);
  padding: 24px;
  display: grid;
  gap: 14px;
  position: sticky;
  top: 100px;
  border-top: 4px solid var(--gfc-accent);
}
.gfc-result__label { font-size: 14px; font-weight: 600; color: var(--gfc-ink-2); }
.gfc-result__total { font-size: 52px; line-height: 1; font-weight: 800; color: var(--gfc-accent); }
.gfc-result__total small { font-size: 22px; font-weight: 600; }
.gfc-result__list { margin: 0; display: grid; gap: 0; }
.gfc-result__list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--gfc-line);
}
.gfc-result__list > div[hidden] { display: none; }
.gfc-result__list dt { font-weight: 400; color: var(--gfc-ink-2); }
.gfc-result__list dd { margin: 0; font-weight: 700; text-align: end; }
.gfc-result__price dd { font-size: 18px; color: var(--gfc-accent); }
.gfc-result__note {
  margin: 0;
  font-size: 13px;
  padding: 10px 12px;
  border-radius: 6px;
  background: #fff4e5;
  color: #7a4b00;
}
.gfc-result__note[hidden], .gfc-result__msg[hidden], .gfc-btn[hidden] { display: none; }
.gfc-result__msg { margin: 0; font-size: 14px; font-weight: 600; }
.gfc-result__msg.is-ok { color: #067647; }
.gfc-result__msg.is-err { color: #b42318; }
.gfc-result__msg a { color: inherit; text-decoration: underline; }
.gfc-result__disclaimer { margin: 0; font-size: 12px; color: var(--gfc-ink-2); line-height: 1.5; }

.gfc-plan { margin: 4px 0 0; background: #fff; border-radius: var(--gfc-radius); padding: 8px; }
.gfc-plan[hidden] { display: none; }
.gfc-plan svg { width: 100%; height: auto; display: block; }
.gfc-plan figcaption { font-size: 13px; color: var(--gfc-ink-2); text-align: center; padding: 4px 4px 2px; }
.gfc-plan__room { fill: none; stroke: var(--gfc-ink); stroke-width: 2; }
.gfc-plan__tile { fill: var(--gfc-accent); stroke: #fff; stroke-width: .75; }
.gfc-plan__tile--cut { fill: var(--gfc-accent-light); }
.gfc-plan__dim { font-size: 12px; fill: var(--gfc-ink-2); font-family: inherit; }

/* ---------- Content sections ---------- */
.gfc-section { padding-top: 40px; padding-bottom: 40px; border-top: 1px solid var(--gfc-line); }

.gfc-table-wrap { overflow-x: auto; border: 1px solid var(--gfc-line); border-radius: var(--gfc-radius); }
.gfc-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.gfc-table th, .gfc-table td { padding: 14px 16px; text-align: start; border-bottom: 1px solid var(--gfc-line); vertical-align: top; }
.gfc-table thead th { background: var(--gfc-ink); color: #fff; font-weight: 600; }
.gfc-table tbody tr:last-child td { border-bottom: 0; }
.gfc-table td:first-child { font-weight: 700; white-space: nowrap; }
.gfc-table__rec td { background: var(--gfc-accent-soft); }
.gfc-table__rec td:first-child { color: var(--gfc-accent); box-shadow: inset 4px 0 0 var(--gfc-accent); }
[dir="rtl"] .gfc-table__rec td:first-child { box-shadow: inset -4px 0 0 var(--gfc-accent); }
.gfc-badge {
  display: inline-block;
  margin-inline-start: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--gfc-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

.gfc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.gfc-card {
  display: grid;
  gap: 6px;
  color: var(--gfc-ink) !important;
  text-decoration: none !important;
}
.gfc-card__img { display: block; aspect-ratio: 4 / 3; border-radius: var(--gfc-radius); overflow: hidden; background: var(--gfc-soft); }
.gfc-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.gfc-card:hover .gfc-card__img img { transform: scale(1.04); }
.gfc-card:hover .gfc-card__title { color: var(--gfc-accent); }
.gfc-card__title { font-weight: 700; font-size: 17px; margin-top: 6px; }
.gfc-card__text { font-size: 14px; color: var(--gfc-ink-2); }

.gfc-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.gfc-tip { padding: 24px; background: var(--gfc-soft); border-radius: var(--gfc-radius); border-top: 3px solid var(--gfc-accent); }
.gfc-tip__n { font-size: 13px; font-weight: 700; color: var(--gfc-accent); }
.gfc-tip h3 { font-size: 18px; font-weight: 700; margin: 8px 0; }
.gfc-tip p { margin: 0; color: var(--gfc-ink-2); line-height: 1.6; }

.gfc-faq { border-top: 1px solid var(--gfc-line); }
.gfc-faq__item { border-bottom: 1px solid var(--gfc-line); }
.gfc-faq__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  font-weight: 600;
  font-size: 17px;
}
.gfc-faq__item summary::-webkit-details-marker { display: none; }
.gfc-faq__item summary::after { content: '+'; font-size: 24px; font-weight: 400; line-height: 1; flex: 0 0 auto; color: var(--gfc-accent); }
.gfc-faq__item summary:hover { color: var(--gfc-accent); }
.gfc-faq__item[open] summary::after { content: '−'; }
.gfc-faq__item p { margin: 0 0 18px; color: var(--gfc-ink-2); line-height: 1.7; max-width: 820px; }

.gfc-cms { line-height: 1.7; }

.gfc-cta { background: var(--gfc-accent); color: #fff; text-align: center; padding: 56px 0; margin-top: 16px; }
.gfc-cta h2 { color: #fff; font-size: 30px; font-weight: 700; margin: 0 0 20px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .gfc-intro { grid-template-columns: 1fr; gap: 24px; padding-top: 40px; }
  .gfc-tool__grid { grid-template-columns: 1fr; }
  .gfc-result { position: static; }
  .gfc-tips { grid-template-columns: 1fr; }
}
@media (max-width: 575px) {
  .gfc-hero { padding: 44px 0 40px; }
  .gfc-hero__title { font-size: 32px; }
  .gfc-hero__sub { font-size: 15px; }
  .gfc-h2 { font-size: 23px; }
  .gfc-form, .gfc-result { padding: 18px; }
  .gfc-result__total { font-size: 44px; }
  .gfc-cta h2 { font-size: 24px; }
}
