/**
 * Booking modal — a port of fixkart_brand_site's BookingModal to plain CSS.
 *
 * Every class is prefixed `fkbm-` on purpose. This page already loads
 * Bootstrap plus the legacy site stylesheet, and both own generic names like
 * .modal, .input and .container — an unprefixed rule here would be silently
 * restyled by whichever loaded last.
 *
 * Tokens mirror the brand site's globals.css so the two properties look like
 * one company. The landing page around this modal stays dark; the card itself
 * is the brand's warm parchment, exactly as in the reference screenshot.
 */

.fkbm-root {
  --fkbm-surface: #ffffff;
  --fkbm-elevated: #f5f2ec;
  --fkbm-hover: #e8e3d9;
  --fkbm-gold: #c69214;
  --fkbm-gold-hover: #a9780d;
  --fkbm-gold-tint: rgba(198, 146, 20, 0.10);
  --fkbm-ink: #111827;
  --fkbm-ink-2: #4b5563;
  --fkbm-ink-3: #9ca3af;
  --fkbm-line: #e5e7eb;
  --fkbm-line-2: #d1d5db;
  --fkbm-success: #1e7a45;
  --fkbm-error: #b02a2a;

  font-family: "Poppins", ui-sans-serif, system-ui, -apple-system, sans-serif;
}

/* ── Backdrop ───────────────────────────────────────────────────────── */
.fkbm-backdrop {
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;      /* inset fallback for old Android */
  background: rgba(17, 24, 39, 0.40);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.2s ease;
  /* Stops a drag on the dimmed area from scrolling the page behind. */
  touch-action: none;
}
.fkbm-root.is-open .fkbm-backdrop { opacity: 1; }

/* ── Card ───────────────────────────────────────────────────────────── */
.fkbm-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: calc(100% - 1.5rem);
  max-width: 32rem;
  /* dvh, not vh: on mobile the browser chrome is excluded, so the sticky
     footer button can never end up under the address bar. vh is the fallback
     for browsers that don't know dvh. */
  max-height: 88vh;
  max-height: 88dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: var(--fkbm-surface);
  border: 1px solid var(--fkbm-line);
  border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(17, 24, 39, 0.25);
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
.fkbm-root.is-open .fkbm-card {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
@media (min-width: 1024px) { .fkbm-card { max-width: 36rem; } }

/* ── Header ─────────────────────────────────────────────────────────── */
.fkbm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--fkbm-line);
  flex-shrink: 0;
}
.fkbm-head-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fkbm-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--fkbm-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fkbm-iconbtn {
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: var(--fkbm-ink-2);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.fkbm-iconbtn:hover { background: var(--fkbm-hover); color: var(--fkbm-ink); }
.fkbm-iconbtn:active { transform: scale(0.94); }
.fkbm-iconbtn svg { width: 20px; height: 20px; }

/* ── Progress ───────────────────────────────────────────────────────── */
.fkbm-progress {
  padding: 12px 16px;
  border-bottom: 1px solid var(--fkbm-line);
  flex-shrink: 0;
}
.fkbm-dots { display: flex; align-items: center; gap: 4px; }
.fkbm-dot-wrap { display: flex; align-items: center; gap: 4px; flex: 1; }
.fkbm-dot-wrap:last-child { flex: 0 0 auto; }
.fkbm-dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  background: var(--fkbm-elevated);
  border: 1px solid var(--fkbm-line);
  color: var(--fkbm-ink-3);
  transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}
.fkbm-dot.is-active {
  background: var(--fkbm-gold-tint);
  border-color: var(--fkbm-gold);
  color: var(--fkbm-gold);
  animation: fkbm-pop 0.4s ease;
}
.fkbm-dot.is-done {
  background: var(--fkbm-gold);
  border-color: var(--fkbm-gold);
  color: #fff;
}
.fkbm-dot svg { width: 12px; height: 12px; }
@keyframes fkbm-pop {
  0% { transform: scale(1); } 50% { transform: scale(1.12); } 100% { transform: scale(1); }
}
.fkbm-bar {
  flex: 1;
  height: 2px;
  border-radius: 2px;
  background: var(--fkbm-line);
  overflow: hidden;
}
.fkbm-bar > i {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--fkbm-gold);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s ease-out;
}
.fkbm-bar.is-done > i { transform: scaleX(1); }
.fkbm-steptext {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}
.fkbm-steptext b { font-size: 12px; font-weight: 600; color: var(--fkbm-ink); }
.fkbm-steptext b span { font-weight: 400; color: var(--fkbm-ink-3); }
.fkbm-steptext i { font-size: 11px; font-style: normal; color: var(--fkbm-ink-3); }

/* ── Search (kept outside the scroll area, Notion/Linear pattern) ────── */
.fkbm-searchwrap {
  padding: 12px 16px 0;
  flex-shrink: 0;
}
.fkbm-search { position: relative; }
.fkbm-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--fkbm-ink-3);
  pointer-events: none;
}
.fkbm-search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px 10px 36px;
  border: 1px solid var(--fkbm-line);
  border-radius: 12px;
  background: var(--fkbm-elevated);
  color: var(--fkbm-ink);
  /* 16px prevents iOS Safari zooming the page on focus. */
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease;
}
.fkbm-search input::placeholder { color: var(--fkbm-ink-3); }
.fkbm-search input:focus { border-color: var(--fkbm-gold); }

/* ── Body ───────────────────────────────────────────────────────────── */
.fkbm-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  /* Stops a scroll that reaches the end of this list from chaining out and
     moving the page behind the modal. */
  overscroll-behavior: contain;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
}
.fkbm-step { animation: fkbm-slide 0.18s ease-out; }
@keyframes fkbm-slide {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ── Social proof ───────────────────────────────────────────────────── */
.fkbm-proof {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(30, 122, 69, 0.05);
  border: 1px solid rgba(30, 122, 69, 0.15);
  animation: fkbm-fade 0.3s ease-out;
}
@keyframes fkbm-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fkbm-proof-ic { position: relative; flex-shrink: 0; display: flex; }
.fkbm-proof-ic svg { width: 16px; height: 16px; color: var(--fkbm-success); }
.fkbm-proof-ping {
  position: absolute;
  top: -2px; right: -2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--fkbm-success);
}
.fkbm-proof-ping::before {
  content: "";
  position: absolute;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  background: var(--fkbm-success);
  opacity: 0.6;
  animation: fkbm-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes fkbm-ping {
  75%, 100% { transform: scale(2.2); opacity: 0; }
}
.fkbm-proof p {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--fkbm-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fkbm-proof p b { color: var(--fkbm-ink); font-weight: 600; }
.fkbm-proof p i { font-style: normal; color: var(--fkbm-ink-3); }

/* ── Device grid ────────────────────────────────────────────────────── */
.fkbm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.fkbm-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 116px;
  padding: 18px 12px;
  background: var(--fkbm-elevated);
  border: 1px solid var(--fkbm-line);
  border-radius: 16px;
  color: var(--fkbm-ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
/* Product photo area — same treatment as the brand site's device grid:
   fixed-height media box, image contained at 75% width, multiply blend so
   the photo sits on the parchment tile without a white box around it. */
.fkbm-tile-media {
  height: 64px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (min-width: 640px) { .fkbm-tile-media { height: 80px; } }
.fkbm-tile-media img {
  max-height: 100%;
  max-width: 75%;
  object-fit: contain;
  mix-blend-mode: multiply;
  transition: transform 0.2s ease;
}
/* Icon is the fallback: hidden while the photo is healthy, shown when the
   device has no mapped image or the S3 load fails (.is-broken). */
.fkbm-tile-media svg {
  display: none;
  width: 34px;
  height: 34px;
  color: var(--fkbm-gold);
  transition: transform 0.2s ease;
}
.fkbm-tile-media.is-broken img { display: none; }
.fkbm-tile-media.is-broken svg { display: block; }
.fkbm-tile:hover {
  border-color: var(--fkbm-gold);
  box-shadow: 0 4px 16px rgba(198, 146, 20, 0.12);
}
.fkbm-tile:hover .fkbm-tile-media img,
.fkbm-tile:hover .fkbm-tile-media svg { transform: scale(1.1); }
.fkbm-tile:active { transform: scale(0.97); }

/* ── Option rows (brand / model / issue) ────────────────────────────── */
.fkbm-list { display: flex; flex-direction: column; gap: 8px; }
.fkbm-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 12px 16px;
  text-align: left;
  background: var(--fkbm-elevated);
  border: 1px solid var(--fkbm-line);
  border-radius: 12px;
  color: var(--fkbm-ink);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.fkbm-opt:hover { border-color: var(--fkbm-gold); background: var(--fkbm-hover); }
.fkbm-opt:active { transform: scale(0.99); }
.fkbm-opt-txt { flex: 1; min-width: 0; }
.fkbm-chev { width: 16px; height: 16px; color: var(--fkbm-ink-3); flex-shrink: 0; }

/* Checkbox for the multi-select issue step */
.fkbm-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 1px solid var(--fkbm-line-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--fkbm-surface);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fkbm-check svg { width: 13px; height: 13px; color: #fff; opacity: 0; }
.fkbm-opt.is-checked { border-color: var(--fkbm-gold); background: var(--fkbm-gold-tint); }
.fkbm-opt.is-checked .fkbm-check { background: var(--fkbm-gold); border-color: var(--fkbm-gold); }
.fkbm-opt.is-checked .fkbm-check svg { opacity: 1; }

.fkbm-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: var(--fkbm-ink-3);
}

/* ── Skeletons ──────────────────────────────────────────────────────── */
.fkbm-skel {
  background: var(--fkbm-elevated);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.fkbm-skel::after {
  content: "";
  position: absolute;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: fkbm-shimmer 1.4s infinite;
}
@keyframes fkbm-shimmer { 100% { transform: translateX(100%); } }
.fkbm-skel-tile { height: 116px; border-radius: 16px; }
.fkbm-skel-row { height: 52px; }

/* ── Details step ───────────────────────────────────────────────────── */
.fkbm-summary {
  background: var(--fkbm-elevated);
  border: 1px solid var(--fkbm-line);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}
.fkbm-summary-h {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(198, 146, 20, 0.05);
  border-bottom: 1px solid var(--fkbm-line);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fkbm-ink);
}
.fkbm-summary-h svg { width: 15px; height: 15px; color: var(--fkbm-gold); }
.fkbm-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
}
.fkbm-row:last-child { border-bottom: 0; }
.fkbm-row dt {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fkbm-ink-3);
  flex-shrink: 0;
  margin: 0;
}
.fkbm-row dd {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--fkbm-ink);
  text-align: right;
  min-width: 0;
}
.fkbm-pitch {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--fkbm-ink-2);
}
.fkbm-field { margin-bottom: 14px; }
.fkbm-field label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fkbm-ink-3);
}
.fkbm-field input {
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid var(--fkbm-line);
  border-radius: 12px;
  background: var(--fkbm-elevated);
  color: var(--fkbm-ink);
  font-size: 16px;                 /* iOS zoom guard */
  outline: none;
  transition: border-color 0.15s ease;
}
.fkbm-field input::placeholder { color: var(--fkbm-ink-3); }
.fkbm-field input:focus { border-color: var(--fkbm-gold); }
@media (min-width: 768px) {
  .fkbm-field input, .fkbm-search input { font-size: 14px; }
}
.fkbm-error {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 500;
  color: var(--fkbm-error);
}
.fkbm-error:empty { display: none; }

/* ── Sticky footer ──────────────────────────────────────────────────── */
.fkbm-foot {
  flex-shrink: 0;
  padding: 12px 16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--fkbm-line);
  background: var(--fkbm-surface);
}
.fkbm-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 48px;
  padding: 13px 24px;
  border: 0;
  border-radius: 12px;
  background: var(--fkbm-gold);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(198, 146, 20, 0.25);
  transition: background 0.2s ease, transform 0.15s ease;
}
.fkbm-cta:hover:not(:disabled) { background: var(--fkbm-gold-hover); }
.fkbm-cta:active:not(:disabled) { transform: scale(0.97); }
.fkbm-cta:disabled { background: var(--fkbm-line-2); color: #fff; cursor: not-allowed; box-shadow: none; }
.fkbm-cta svg { width: 18px; height: 18px; }
.fkbm-spin { animation: fkbm-rot 0.8s linear infinite; }
@keyframes fkbm-rot { to { transform: rotate(360deg); } }

/* Reduced motion — kill every decorative animation, keep the state changes. */
@media (prefers-reduced-motion: reduce) {
  .fkbm-card, .fkbm-backdrop, .fkbm-step, .fkbm-proof,
  .fkbm-dot, .fkbm-bar > i, .fkbm-skel::after, .fkbm-proof-ping::before {
    transition: none !important;
    animation: none !important;
  }
}

/* ── Inline mode — product.html: the wizard as a simple in-page flow. ──
   .fkbm-flat is defined from scratch and shares NOTHING with .fkbm-card,
   so no modal positioning (fixed/translate/max-height) can ever apply to
   it — not even from a stale cached stylesheet. */
.fkbm-root--inline { position: static; display: block; }
.fkbm-flat {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  background: var(--fkbm-surface);
  border: 1px solid var(--fkbm-line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.05), 0 12px 32px -14px rgba(17, 24, 39, 0.12);
}
.fkbm-flat .fkbm-body {
  overflow-y: visible;
  overscroll-behavior: auto;
}
/* Keep the Continue / Book button reachable while the list scrolls by. */
.fkbm-flat .fkbm-foot {
  position: sticky;
  bottom: 0;
  border-radius: 0 0 16px 16px;
}

/* ── Brand rows — model-list styling with a leading brand mark. Letter
     avatar covers unmapped brands and any S3 miss. ── */
.fkbm-row-logo {
  width: 44px;
  height: 28px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fkbm-row-logo img { max-height: 24px; max-width: 42px; object-fit: contain; }
.fkbm-row-logo i {
  display: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: var(--fkbm-gold-tint);
  border: 1px solid var(--fkbm-gold);
  color: var(--fkbm-gold);
  font-style: normal;
  font-weight: 700;
  font-size: 13px;
}
.fkbm-row-logo.is-broken img { display: none; }
.fkbm-row-logo.is-broken i { display: flex; }

/* Model / issue rows — white cards with depth, not flat grey bars. */
.fkbm-opt {
  background: var(--fkbm-surface);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.05);
}
.fkbm-chev { color: var(--fkbm-gold); }
