/* =====================================================================
   Czar Floors — AI preview kit (scripts/czar-ai-preview.js)
   Shared by the product-page "See It in Your Room" window, the
   See It in Your Room page and the Floor Designer.

   Controls use stock Bootstrap 5.3 classes (btn-group/btn-check,
   accordion + the site's cz-accordion, form-select, form-check,
   btn-outline-*, alert, spinner). This file holds ONLY what Bootstrap
   has no class for. Maroon is reserved for the primary action (.btn-cz).
   ===================================================================== */

/* Primary action (Create Preview, Download, Use this color) — the site's
   brand maroon as a Bootstrap button variant. */
.btn-cz {
  --bs-btn-color: #fff;
  --bs-btn-bg: #8b1a1a;
  --bs-btn-border-color: #8b1a1a;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #731414;
  --bs-btn-hover-border-color: #731414;
  --bs-btn-focus-shadow-rgb: 139, 26, 26;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #5e1010;
  --bs-btn-active-border-color: #5e1010;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #8b1a1a;
  --bs-btn-disabled-border-color: #8b1a1a;
  font-weight: 600;
}
.czStars { vertical-align: -2px; }

/* One-of choices (btn-group + btn-check): two-line labels wrap. Touch
   screens get Apple's 44px tap target (choices + the stain button). */
.czChoice > .btn { display: inline-flex; align-items: center; justify-content: center; white-space: normal; line-height: 1.2; }
@media (pointer: coarse) {
  .czChoice > .btn, .czTap { min-height: 44px; }
}

/* "Your room" OR "Our demo room" divider. */
.czOr { display: flex; align-items: center; gap: 14px; margin: 18px 0 16px; }
.czOr::before, .czOr::after { content: ""; flex: 1; border-top: 2px dashed #d5cebf; }
.czOr span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid #d5cebf; background: #fff;
  color: #6c757d; font-weight: 700; font-size: .9rem; letter-spacing: .06em;
}

/* Photo / sample drop zones + phone QR. */
.czDrop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 100%; min-height: 96px; padding: 14px 10px;
  border: 2px dashed #c4c4c4; border-radius: 8px; background: #fafafa; color: #555; cursor: pointer;
}
.czDrop.hot { border-color: #333; background: #f1efeb; }
.czQr { width: 150px; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.czQrBox { min-height: 110px; }
.czQrBox canvas, .czQrBox img { max-width: 118px; height: auto; }
.czThumb { max-width: 120px; max-height: 90px; object-fit: cover; border-radius: 6px; }

/* Stain button swatch + the stain window (drawn above the Bootstrap modal,
   which cannot stack a second modal). */
.czSw { width: 24px; height: 24px; border-radius: 4px; display: block; }
.czStainOv {
  position: fixed; inset: 0; z-index: 3000; padding: 14px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(20, 15, 10, .55);
}
.czStainBox {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 12px; padding: 16px 18px; box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
}
.czStainGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.czStainOpt {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 5px; border: 2px solid #d5cebf; border-radius: 10px; background: #fff; cursor: pointer;
}
.czStainOpt:hover { border-color: #6c757d; }
.czStainOpt.active { border-color: #333; box-shadow: 0 0 0 1px #333; }
.czStainOpt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; display: block; background: #f6f2ec; }
.czSampleImg { max-width: 100%; max-height: 44vh; border-radius: 8px; }
@media (max-width: 575px) {
  .czStainOv { align-items: flex-end; padding: 0; }
  .czStainBox { border-radius: 12px 12px 0 0; max-height: 85vh; }
  .czStainGrid { grid-template-columns: repeat(2, 1fr); }
}

/* Result picture with zoom (wheel / pinch / slider). */
.czZoomWrap { position: relative; overflow: hidden; border-radius: 8px; touch-action: pan-y; background: #222; }
.czResultImg {
  display: block; width: 100%; max-height: 68vh; object-fit: contain;
  transform-origin: center center; will-change: transform; user-select: none; -webkit-user-select: none;
}
.czZoomBar {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; align-items: center; gap: 8px; padding: 5px 12px;
  background: #fff; border-radius: 22px; box-shadow: 0 3px 12px rgba(0, 0, 0, .3);
}
.czZoomBar button { border: none; background: none; font-size: 1.2rem; line-height: 1; cursor: pointer; color: #444; min-width: 26px; }
.czZoomBar input[type=range] { width: 130px; accent-color: #333; }
