/* ==========================================================
   PIXELBRICK - SITE STYLESHEET

   Shared by index.html, purchase.html and privacy.html.
   Rule order matters: later rules intentionally override
   earlier ones, so do not reorder sections.
========================================================== */

:root {
  /* COLORS */
  --bg-main: #07101d;
  --text-primary: #ffffff;
  --text-secondary: #c8d2e2;
  --text-muted: #8ea3bf;
  --brick: #f88316;
  --accent: #f4b63a;
  --accent-hover: #ffc84e;
  --border: rgba(255, 255, 255, .08);
  /* MODAL */
  --modal-shadow: 0 35px 80px rgba(0, 0, 0, .55);
  /* EFFECTS */
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, .25);
  --shadow-large: 0 24px 70px rgba(0, 0, 0, .45);
  --transition: .28s;
  /* TYPOGRAPHY */
  --font-display: "Jersey 10", sans-serif;
  --font-body: "Inter", sans-serif;
}

/* ==========================================================
   DISPLAY FONT
========================================================== */

h1,
h2,
h3,
.takeBricksButton,
button,
.readyStatus,
.counterTitle {
  font-family: var(--font-display);
}

/* ==========================================================
   BODY FONT
========================================================== */

input,
textarea,
label,
p,
span,
strong,
select {
  font-family: var(--font-body);
}

/* ==========================================================
   RESET
========================================================== */

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

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg-main);
  overflow-x: hidden;
}

/* ==========================================================
   GLOBAL BACKGROUND
========================================================== */

.background-layer {
  position: fixed;
  inset: 0;
  z-index: -100;
  pointer-events: none;
  background: #07101d url("images/pixel-pattern.webp") no-repeat center top;
  background-size: min(1920px, 100vw) auto;
}

/* ==========================================================
   PAGE
========================================================== */

.page {
  width: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ==========================================================
   HEADER
========================================================== */

.topBar {
  width: min(1700px, 95vw);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-left: 40px;
  padding-right: 20px;
}

.brand {
  display: flex;
  align-items: center;
  margin-left: 50px;
}

.brandLogo {
  height: 72px;
  width: auto;
  display: block;
  user-select: none;
}

/* ==========================================================
   WALL
========================================================== */

.wallSection {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  overflow: hidden;
}

/* ==========================================================
   PIXELBRICK 3D BRICK FRAME
========================================================== */

.brickFrame {
  --frame-size: 16px;
  position: relative;
  width: min(96vw, 1800px);
  height: 100%;
  padding: var(--frame-size);
  box-sizing: border-box;
  background: #5b3504;
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.55);
  transition: filter 0.25s ease, box-shadow 0.25s ease;
}

/* ==========================================================
   WALL INSIDE FRAME
========================================================== */

.brickFrame .wallContainer {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* ==========================================================
   FOUR FRAME SIDES
========================================================== */

.brickFrameSide {
  position: absolute;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
  background-image: url("/images/bricks/gold-brick.png");
  background-repeat: repeat;
  background-position: center center;
  background-size: auto 100%;
}

/* ==========================================================
   FRAME SIDES

   Corner rule: horizontal rows own all four corners
========================================================== */

.brickFrameTop,
.brickFrameBottom {
  position: absolute;
  left: 0;
  right: 0;
  height: var(--frame-size);
  overflow: hidden;
  z-index: 6;
  /* Official gold texture. Both the PNG and the reinforced vertical joint use EXACTLY the same repetition size. */
  background-image: linear-gradient(to right, transparent 0, transparent calc(100% - 2px), rgba(48, 27, 5, 0.75) calc(100% - 2px), rgba(20, 11, 2, 0.96) calc(100% - 1px), rgba(12, 7, 1, 0.98) 100%), url("/images/bricks/gold-brick.png");
  /* 8:3 is the aspect ratio of the official image. With a 16px frame: 16 × 8 / 3 = 42.6667px */
  background-size: calc(var(--frame-size) * 8 / 3) 100%, calc(var(--frame-size) * 8 / 3) 100%;
  background-repeat: repeat-x, repeat-x;
  background-position: 0 0, 0 0;
}

/* TOP */

.brickFrameTop {
  top: 0;
}

/* BOTTOM */

.brickFrameBottom {
  bottom: 0;
}

/* ==========================================================
   FRAME - HORIZONTAL MORTAR

   Top and bottom only. Does not change brick size.
========================================================== */

.brickFrameTop::after,
.brickFrameBottom::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 0px;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(to bottom, rgba(82, 48, 7, 0.70) 0%, rgba(35, 20, 3, 0.95) 55%, rgba(18, 10, 2, 0.90) 100%);
}

/* On the TOP frame the horizontal joint is on its lower edge. */

.brickFrameTop::after {
  bottom: 0;
}

/* On the BOTTOM frame the horizontal joint is on its upper edge. */

.brickFrameBottom::after {
  top: 0;
}

/* LEFT / RIGHT */

.brickFrameLeft,
.brickFrameRight {
  position: absolute;
  top: var(--frame-size);
  bottom: var(--frame-size);
  width: var(--frame-size);
  overflow: hidden;
  z-index: 5;
  /* Official gold brick texture. Brick dimensions remain unchanged. */
  background-image: url("/images/bricks/gold-brick.png");
  background-repeat: repeat-y;
  background-size: auto 42px;
  background-position: center top;
}

/* ==========================================================
   VERTICAL FRAME SIDES - CLEAN BOTTOM END

   Covers only the final horizontal joint of Left / Right. Does not alter brick dimensions or the rest of the frame.
========================================================== */

.brickFrameLeft::after,
.brickFrameRight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0px;
  pointer-events: none;
  z-index: 3;
  /* Continue the gold surface over the unwanted final horizontal seam. */
  background-image: url("/images/bricks/gold-brick.png");
  background-repeat: no-repeat;
  background-size: auto 42px;
  background-position: center bottom;
}

/* LEFT */

.brickFrameLeft {
  left: 0;
}

/* RIGHT */

.brickFrameRight {
  right: 0;
}

/* ==========================================================
   FRAME DEPTH AGAINST WALL
========================================================== */

.brickFrame::after {
  content: "";
  position: absolute;
  top: var(--frame-size);
  right: var(--frame-size);
  bottom: var(--frame-size);
  left: var(--frame-size);
  z-index: 6;
  pointer-events: none;
  box-shadow: inset 4px 4px 5px rgba(0, 0, 0, 0.55), inset -2px -2px 3px rgba(255, 202, 62, 0.18);
  border: 1px solid rgba(64, 34, 0, 0.85);
}

/* ==========================================================
   HOVER
========================================================== */

.brickFrame:hover {
  filter: brightness(1.025);
  box-shadow: 0 24px 46px rgba(0, 0, 0, 0.62);
}

/* ==========================================================
   WALL
========================================================== */

.wallContainer {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #d56a58, var(--brick), var(--brickDark));
  border: 2px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.45);
}

/* ==========================================================
   CANVAS
========================================================== */

#pixelCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  display: block;
}

/* ==========================================================
   FOOTER
========================================================== */

footer {
  position: relative;
  height: 70px;
  flex-shrink: 0;
  padding: 12px 30px;
  display: flex;
  align-items: center;
  background: transparent;
  backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, .15);
}

.footerContent {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.counter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}

.counterTitle {
  font-size: 30px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  opacity: .85;
}

#soldPixels {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  color: white;
}

.progressBar {
  flex: 1;
  height: 14px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .35);
  font-family: var(--font-display);
  font-size: 30px;
}

#progressFill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffd66b, #ffb11c, #ff8a00);
  transition: width .45s ease;
}

.copyright {
  position: absolute;
  bottom: 3px;
  right: 30px;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0.4px;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  pointer-events: none;
}

/* ==========================================================
   AREA SELECTION
========================================================== */

#selectionBox {
  position: absolute;
  display: none;
  pointer-events: none;
  border: 2px dashed #ffd64d;
  background: rgba(255, 214, 77, .18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35), 0 0 18px rgba(255, 214, 77, .35);
  z-index: 20;
}

/* ==========================================================
   INFO GRID
========================================================== */

.infoGrid {
  margin-bottom: 30px;
}

.infoCard {
  min-height: 95px;
}

/* ==========================================================
   FORM
========================================================== */

#purchaseForm {
  flex-direction: column;
}

#purchaseForm label {
  font-weight: 700;
}

#purchaseForm input,
#purchaseForm textarea {
  width: 100%;
  font-family: inherit;
  transition: .25s;
}

#purchaseForm input:focus,
#purchaseForm textarea:focus {
  outline: none;
  border-color: #b23a2e;
  box-shadow: 0 0 0 4px rgba(178, 58, 46, .12);
}

/* ==========================================================
   LOGO UPLOAD
========================================================== */

.uploadArea {
  max-height: 220px;
}

.uploadArea input {
  margin-top: 12px;
  border: none;
  padding: 0;
}

#logoPreview {
  display: none;
  max-width: 220px;
  max-height: 120px;
  object-fit: contain;
}

/* ==========================================================
   BUTTON
========================================================== */

.continueButton {
  margin-top: 10px;
  padding: 16px;
  border: none;
  border-radius: 12px;
  background: #b23a2e;
  color: white;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  transition: .25s;
}

.continueButton:hover {
  background: #92261d;
  transform: translateY(-2px);
}

/* ==========================================================
   CLOSE BUTTON
========================================================== */

.closeButton {
  position: absolute;
  top: 18px;
  right: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 50%;
  background: rgba(255, 255, 255, .95);
  color: #07101d;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: var(--transition);
  z-index: 100;
}

.closeButton:hover {
  background: #ffffff;
  transform: rotate(90deg) scale(1.05);
  box-shadow: 0 0 15px rgba(244, 182, 58, .35);
}

/* ==========================================================
   TEXT SELECTION
========================================================== */

::selection {
  background: #ffd76c;
  color: #111;
}

/* ==========================================================
   INPUT PLACEHOLDER
========================================================== */

::placeholder {
  color: #999;
}

/* ==========================================================
   INPUT AUTOFILL
========================================================== */

input:-webkit-autofill {
  -webkit-box-shadow: 0 0 0 100px white inset;
}

/* ==========================================================
   RESPONSIVE
========================================================== */

@media (max-width:1200px) {
  .infoGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:900px) {
  .wallContainer {
    height: calc(100vh - 180px);
  }
}

@media (max-width:700px) {
  .counter {
    flex-direction: column;
    align-items: flex-start;
  }

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

@media (max-width:520px) {
  footer {
    padding: 18px;
  }

  #soldPixels {
    font-size: 16px;
  }

  /* Let the footer links wrap so they never cover the counter text. */
  .copyright {
    right: 12px;
    max-width: 48%;
    text-align: right;
    white-space: normal;
  }

  .continueButton {
    padding: 14px;
  }
}

/* ==========================================================
   HELPERS
========================================================== */

.hidden {
  display: none !important;
}

/* Text for search engines and screen readers only (not visible). */
.srOnly {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.orderSummary {
  margin-top: 25px;
  padding: 20px;
  border-radius: 12px;
  background: #f7f7f7;
  border: 1px solid #ddd;
}

.orderSummary h3 {
  margin-bottom: 15px;
  font-size: 18px;
  font-weight: bold;
}

.takeBricksButton {
  margin-left: auto;
  margin-bottom: -50px;
  padding: 1px 12px;
  font-family: var(--font-display);
  font-size: 25px;
  letter-spacing: 2px;
  border: none;
  border-radius: 10px;
  background: #ffb400;
  color: #111;
  cursor: pointer;
  transition: .25s;
  white-space: nowrap;
}

.takeBricksButton:hover {
  background: #ffca3a;
  transform: translateY(-2px);
}

/* ==========================================================
   WIZARD PAGE
========================================================== */

.wizardPage {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 32px;
  overflow: hidden;
}

.wizardPage.hidden {
  display: none;
}

.uploadArea {
  min-height: 250px;
  border: 3px dashed #bfbfbf;
  border-radius: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: .25s;
  text-align: center;
  padding: 30px;
  background: #fafafa;
}

.uploadArea:hover {
  border-color: #ffb400;
  background: #fff8e6;
}

.uploadArea input {
  display: none;
}

.uploadArea span {
  font-size: 20px;
  font-weight: 600;
  color: #f1d3c8;
}

.previewContainer {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  max-height: 150px;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 220px;
  border: 2px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background-color: #8b1e1e;
  background-image: linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 10px 10px;
}

.previewContainer img {
  max-width: 100%;
  max-height: 180px;
}

.imagePreviewTitle {
  font-size: 30px;
  font-weight: 200;
  color: white;
  text-align: center;
  margin-top: -40px;
  margin-bottom: 5px;
}

.infoGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 5px;
}

.infoCard {
  flex: 1;
  background: rgba(0, 0, 0, .12);
  border: none;
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, .05), inset 0 -2px 4px rgba(0, 0, 0, .18);
  transition: .25s;
}

.infoCard span {
  display: block;
  color: white;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.infoCard strong {
  color: white;
  font-size: 26px;
  font-weight: 800;
}

.infoCard:hover {
  transform: translateY(-2px);
  box-shadow: inset 0 2px 6px rgba(255, 255, 255, .08), 0 10px 20px rgba(0, 0, 0, .18);
}

.wallSizeWarning {
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.70);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: background .2s ease, border-color .2s ease, color .2s ease;
}

/* Size not available */

.wallSizeWarning.invalid {
  border-color: #ffb400;
  background: rgba(255, 180, 0, 0.10);
  color: #f1d3c8;
  font-weight: 600;
}

/* ==========================================================
   SUGGESTED WALL SIZE
========================================================== */

.suggestedSizeBox {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 182, 58, 0.35);
  border-radius: 10px;
  background: rgba(244, 182, 58, 0.08);
}

.suggestedSizeBox.hidden {
  display: none !important;
}

.suggestedSizeText {
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.useSuggestedSizeButton {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #111111;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: var(--transition);
}

.useSuggestedSizeButton:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.useSuggestedSizeButton:active {
  transform: translateY(0);
}

/* ==========================================================
   WIZARD BUTTONS
========================================================== */

.wizardButtons {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding-top: 14px;
  padding-bottom: 14px;
  box-sizing: border-box;
}

.wizardButtons button {
  min-width: 180px;
  height: 58px;
  padding: 0 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  border-radius: 16px;
  background: var(--accent);
  color: #111111;
  font-family: var(--font-display);
  font-size: 26px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-soft);
}

.wizardButtons button:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-large);
}

.wizardButtons button:active {
  transform: translateY(0);
}

/* ==========================================================
   WIZARD SCROLL
========================================================== */

.wizardScroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 10px;
}

/* ==========================================================
   PIXELBRICK SCROLLBAR
========================================================== */

.wizardScroll::-webkit-scrollbar {
  width: 12px;
}

.wizardScroll::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .06);
  border-radius: 10px;
}

.wizardScroll::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), #c68a00);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 0 0 1px rgba(0, 0, 0, .35);
}

.wizardScroll::-webkit-scrollbar-thumb:hover {
  background: #ffd34d;
}

#orderSummary::-webkit-scrollbar {
  width: 12px;
}

#orderSummary::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, .06);
  border-radius: 10px;
}

#orderSummary::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--accent), #c68a00);
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15), 0 0 0 1px rgba(0, 0, 0, .35);
}

#orderSummary::-webkit-scrollbar-thumb:hover {
  background: #ffd34d;
}

/* ==========================================================
   SCROLLBAR - STEP 3 / STEP 4
========================================================== */

#wizardStep3,
#wizardStep4 {
  scrollbar-width: thin;
  scrollbar-color: #f4b936 transparent;
}

/* Chrome / Edge / Safari */

#wizardStep3::-webkit-scrollbar,
#wizardStep4::-webkit-scrollbar {
  width: 12px;
}

#wizardStep3::-webkit-scrollbar-track,
#wizardStep4::-webkit-scrollbar-track {
  background: transparent;
  margin-top: 18px;
  margin-bottom: 18px;
}

#wizardStep3::-webkit-scrollbar-thumb,
#wizardStep4::-webkit-scrollbar-thumb {
  background: #f4b936;
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

#wizardStep3::-webkit-scrollbar-thumb:hover,
#wizardStep4::-webkit-scrollbar-thumb:hover {
  background: var(--orange);
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* Remove the scrollbar arrow buttons completely */

#wizardStep3::-webkit-scrollbar-button,
#wizardStep4::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

/* ==========================================================
   PRIMARY BUTTON
========================================================== */

#proceedPayment {
  min-width: 260px;
}

/* ==========================================================
   BACK BUTTON
========================================================== */

#backToStep1,
#backToStep2,
#backToStep3 {
  background: rgba(255, 255, 255, .10);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, .15);
}

#backToStep1:hover,
#backToStep2:hover,
#backToStep3:hover {
  background: rgba(255, 255, 255, .18);
}

#step2Continue,
#step3Continue,
#proceedPayment {
  background: #ffb400;
  color: #000;
}

#step2Continue:hover,
#step3Continue:hover,
#proceedPayment:hover {
  background: #ffc933;
}

#purchaseForm {
  display: grid;
  gap: 18px;
}

#purchaseForm label {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#purchaseForm input,
#purchaseForm textarea {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid #d9d9d9;
  font-size: 15px;
}

#purchaseForm textarea {
  resize: vertical;
}

#orderSummary {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 25px;
  border: 2px solid #ececec;
  border-radius: 18px;
  background: #fafafa;
}

@media (max-width:900px) {
  .infoGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width:650px) {
  .wizard {
    padding: 20px;
  }

  .wizardHeader {
    flex-direction: column;
    gap: 20px;
  }

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

  .wizardButtons {
    flex-direction: column;
    gap: 15px;
  }
}

.summaryPreview {
  display: flex;
  justify-content: center;
  margin-bottom: 30px;
}

.summaryPreview img {
  max-width: 250px;
  max-height: 180px;
}

.summaryGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}

.summaryGrid div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px;
  border-radius: 10px;
  background: #f7f7f7;
}

.summaryGrid span {
  color: #666;
}

.summaryGrid strong {
  font-weight: 700;
}

#wizardStep1 {
  justify-content: center;
  align-items: center;
  min-height: 500px;
  text-align: center;
}

#wizardStep1 h3 {
  font-size: 34px;
  margin-bottom: 10px;
}

#wizardStep1 p {
  max-width: 550px;
  color: #666;
  margin-bottom: 25px;
}

/* ==========================================================
   WIZARD PROGRESS BAR
========================================================== */

.progressFill {
  width: 25%;
  height: 100%;
  background: #ffb400;
  transition: .35s;
}

.summaryGrid strong {
  color: #222;
}

#statusReady.readyStatus {
  color: #2ea043;
  font-weight: 700;
}

#statusReady.readyStatus.notReady {
  color: #e53935;
}

@media (max-width:900px) {
  .topBar {
    padding: 18px;
  }

  .takeBricksButton {
    padding: 8px 18px;
    font-size: 13px;
  }
}

/* ==========================================================
   PAYMENT STEP
========================================================== */

.paymentStep {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================
   DIMENSION EDITOR
========================================================== */

.dimensionEditor {
  margin-top: 10px;
}

.dimensionInput {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 12px;
  background: rgba(255, 255, 255, .08);
  color: var(--text-primary);
  font-family: var(--font-display);
  font-size: 28px;
  text-align: center;
  outline: none;
}

.dimensionInput:focus {
  border-color: var(--accent);
}

.dimensionInput::-webkit-inner-spin-button {
  opacity: 1;
  transform: scale(1.35);
  cursor: pointer;
}

.dimensionInput::-webkit-outer-spin-button {
  opacity: 1;
  transform: scale(1.35);
}

.keepRatio {
  display: flex;
  justify-content: center;
  margin-top: 5px;
}

.keepRatio label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-family: var(--font-body);
  cursor: pointer;
}

/* ==========================================================
   STEP 2 - COMPLETE FIT INSIDE MODAL
========================================================== */

#wizardStep2 {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-top: 18px;
  padding-bottom: 14px;
}

#wizardStep2.hidden {
  display: none !important;
}

/* ==========================================================
   STEP 2 CONTENT
========================================================== */

#wizardStep2 .step2Content {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 42px;
}

/* ==========================================================
   IMAGE PREVIEW TITLE
========================================================== */

#wizardStep2 .imagePreviewTitle {
  flex: 0 0 auto;
  margin: 0 0 12px;
  text-align: center;
}

/* ==========================================================
   IMAGE PREVIEW
========================================================== */

#wizardStep2 .previewContainer {
  flex: 0 0 150px;
  height: 150px;
  min-height: 150px;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#wizardStep2 .previewContainer img {
  max-width: 100%;
  max-height: 130px;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ==========================================================
   WIDTH / HEIGHT / PIXELS / PRICE
========================================================== */

#wizardStep2 .infoGrid {
  flex: 0 0 auto;
  margin-top: 8px;
  margin-bottom: 4px;
  gap: 12px;
}

#wizardStep2 .infoCard {
  min-height: 112px;
  padding-top: 12px;
  padding-bottom: 12px;
}

#wizardStep2 .infoCard>span {
  margin-bottom: 8px;
}

/* ==========================================================
   KEEP IMAGE PROPORTIONS
========================================================== */

#wizardStep2 .keepRatio {
  flex: 0 0 auto;
  margin: 8px 0 7px;
  padding: 0;
  line-height: 1.2;
}

/* ==========================================================
   WALL MESSAGE
========================================================== */

#wizardStep2 .wallSizeWarning {
  flex: 0 0 auto;
  min-height: 48px;
  margin: 0;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.25;
}

/* ==========================================================
   SUGGESTED SIZE
========================================================== */

#wizardStep2 .suggestedSizeBox {
  flex: 0 0 auto;
  min-height: 42px;
  margin: 7px auto 0;
  padding: 5px 8px 5px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  border: 1px solid rgba(244, 182, 58, 0.45);
  border-radius: 9px;
  background: rgba(244, 182, 58, 0.07);
}

#wizardStep2 .suggestedSizeBox.hidden {
  display: none !important;
}

#wizardStep2 .suggestedSizeText {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

/* ==========================================================
   USE SUGGESTED SIZE BUTTON

   Deliberately different from Back / Continue.
========================================================== */

#wizardStep2 .useSuggestedSizeButton {
  min-width: auto;
  min-height: 32px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: transparent;
  color: var(--accent);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

#wizardStep2 .useSuggestedSizeButton:hover {
  background: var(--accent);
  color: #111;
  transform: none;
}

#wizardStep2 .useSuggestedSizeButton:active {
  transform: scale(0.98);
}

/* ==========================================================
   BACK / CONTINUE

   Always visible inside Step 2.
========================================================== */

#wizardStep2 .step2Buttons {
  flex: 0 0 74px;
  width: 100%;
  margin: 8px 0 0;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  background: transparent;
  z-index: 10;
}

#wizardStep2 .step2Buttons button {
  flex-shrink: 0;
  margin: 0;
}

/* ==========================================================
   PURCHASE PAGE
========================================================== */

.purchasePage {
  background: linear-gradient(rgba(7, 16, 29, .20), rgba(7, 16, 29, .20)), url("images/pixel-pattern-modal.png");
  background-position: center;
  background-repeat: repeat;
  background-size: cover;
}

/* ==========================================================
   PURCHASE WIZARD
========================================================== */

.wizard {
  position: relative;
  width: min(1200px, 96vw);
  min-height: calc(100vh - 64px);
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: 22px;
  background: linear-gradient(rgba(7, 16, 29, .18), rgba(7, 16, 29, .18)), url("images/pixel-pattern-modal.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, .10);
  box-shadow: 0 25px 70px rgba(0, 0, 0, .45), 0 0 20px rgba(70, 120, 255, .08);
}

/* ==========================================================
   STEP 2 SUGGESTED SIZE
========================================================== */

.purchasePage #wizardStep2 .suggestedSizeBox {
  width: auto;
  max-width: 100%;
  gap: 18px;
}

/* ==========================================================
   STEP 2 NAVIGATION BUTTONS
========================================================== */

.purchasePage #wizardStep2 .step2Buttons {
  margin-top: 24px;
}

/* ==========================================================
   PURCHASE PAGE CLOSE BUTTON
========================================================== */

.purchasePage .closeButton {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 100;
}

/* ==========================================================
   PURCHASE PAGE RESPONSIVE
========================================================== */

@media (max-width: 900px) {
  .purchasePage {
    padding: 18px 12px;
  }

  .wizard {
    width: 100%;
    min-height: calc(100vh - 36px);
  }

  .purchasePage #wizardStep2 .step2Content,
  .purchasePage #wizardStep2 .step2Buttons {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media (max-width: 650px) {
  .purchasePage #wizardStep2 .suggestedSizeBox {
    flex-direction: column;
    width: 100%;
  }

  .purchasePage #wizardStep2 .suggestedSizeText {
    white-space: normal;
  }
}

/* ==========================================================
   PURCHASE PAGE - MAIN TITLE
========================================================== */

.purchasePage .wizardHeader {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 26px 90px 20px;
  box-sizing: border-box;
  text-align: center;
}

.purchasePage .wizardHeader h2 {
  margin: 0;
  font-family: "Jersey 10", sans-serif;
  font-size: 52px;
  font-weight: 400;
  line-height: 1;
  color: #f5b93f;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ==========================================================
   STEP 2 - SUGGESTED SIZE
========================================================== */

.purchasePage .suggestedSizeBox {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 14px auto 6px;
  box-sizing: border-box;
}

.purchasePage .suggestedSizeBox.hidden {
  display: none !important;
}

.purchasePage .suggestedSizeText {
  font-family: "Jersey 10", sans-serif;
  font-size: 26px;
  line-height: 1.15;
  text-align: center;
  color: #f5b93f;
}

.purchasePage .useSuggestedSizeButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 250px;
  min-height: 52px;
  padding: 12px 28px;
  border: 2px solid #f5b93f;
  border-radius: 14px;
  background: transparent;
  color: #f5b93f;
  font-family: "Jersey 10", sans-serif;
  font-size: 25px;
  font-weight: 400;
  letter-spacing: 1px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.purchasePage .useSuggestedSizeButton:hover {
  background: #f5b93f;
  color: #07101f;
  transform: translateY(-2px);
}

.purchasePage .useSuggestedSizeButton:active {
  transform: translateY(0);
}

/* ==========================================================
   PURCHASE PAGE - FIT COMPLETE WIZARD INSIDE VIEWPORT
========================================================== */

html,
body {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* ----------------------------------------------------------
   PURCHASE PAGE
   The complete Wizard must stay inside the visible viewport.
---------------------------------------------------------- */

.purchasePage {
  width: 100%;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 24px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   COMPLETE ROUNDED FRAME
---------------------------------------------------------- */

.purchasePage .wizard {
  position: relative;
  width: min(1200px, 96vw);
  height: calc(100dvh - 32px);
  min-height: 0;
  max-height: calc(100dvh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   HEADER
---------------------------------------------------------- */

.purchasePage .wizardHeader {
  flex: 0 0 auto;
  padding-top: 20px;
  padding-bottom: 12px;
}

/* ----------------------------------------------------------
   ALL WIZARD STEPS
---------------------------------------------------------- */

.purchasePage .wizardPage {
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
}

.purchasePage .wizardPage.hidden {
  display: none !important;
}

/* ==========================================================
   STEP 2 - FIT COMPLETELY INSIDE FRAME
========================================================== */

.purchasePage #wizardStep2 {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: 8px;
  padding-bottom: 8px;
  overflow: hidden;
}

/* Main Step 2 content */

.purchasePage #wizardStep2 .step2Content {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0 42px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   IMAGE PREVIEW TITLE
---------------------------------------------------------- */

.purchasePage #wizardStep2 .imagePreviewTitle {
  flex: 0 0 auto;
  margin: 0 0 8px;
  line-height: 1;
}

/* ----------------------------------------------------------
   IMAGE PREVIEW
   Responsive height instead of fixed 220px.
---------------------------------------------------------- */

.purchasePage #wizardStep2 .previewContainer {
  flex: 1 1 220px;
  width: 100%;
  height: auto;
  min-height: 120px;
  max-height: 220px;
  margin: 0;
  overflow: hidden;
}

.purchasePage #wizardStep2 .previewContainer img {
  display: block;
  max-width: 100%;
  max-height: calc(100% - 20px);
  width: auto;
  height: auto;
  object-fit: contain;
}

/* ----------------------------------------------------------
   INFORMATION CARDS
---------------------------------------------------------- */

.purchasePage #wizardStep2 .infoGrid {
  flex: 0 0 auto;
  margin-top: 8px;
  margin-bottom: 2px;
  gap: 12px;
}

.purchasePage #wizardStep2 .infoCard {
  min-height: 92px;
  padding-top: 8px;
  padding-bottom: 8px;
}

/* ----------------------------------------------------------
   KEEP IMAGE PROPORTIONS
---------------------------------------------------------- */

.purchasePage #wizardStep2 .keepRatio {
  flex: 0 0 auto;
  margin: 5px 0;
}

/* ----------------------------------------------------------
   WALL VALIDATION MESSAGE
---------------------------------------------------------- */

.purchasePage #wizardStep2 .wallSizeWarning {
  flex: 0 0 auto;
  min-height: 42px;
  margin: 0;
  padding: 6px 14px;
}

/* ----------------------------------------------------------
   SUGGESTED SIZE
---------------------------------------------------------- */

.purchasePage #wizardStep2 .suggestedSizeBox {
  flex: 0 0 auto;
  margin-top: 6px;
  padding: 7px 14px;
}

/* ----------------------------------------------------------
   BACK / CONTINUE
   Always contained inside the rounded frame.
---------------------------------------------------------- */

.purchasePage #wizardStep2 .step2Buttons {
  flex: 0 0 66px;
  width: 100%;
  margin: 4px 0 0;
  padding: 4px 42px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

/* ==========================================================
   SHORTER DESKTOP SCREENS
========================================================== */

@media (max-height: 850px) and (min-width: 651px) {
  .purchasePage {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .purchasePage .wizard {
    height: calc(100dvh - 20px);
    max-height: calc(100dvh - 20px);
  }

  .purchasePage .wizardHeader {
    padding-top: 14px;
    padding-bottom: 8px;
  }

  .purchasePage .wizardHeader h2 {
    font-size: 44px;
  }

  .purchasePage #wizardStep2 {
    padding-top: 4px;
    padding-bottom: 4px;
  }

  .purchasePage #wizardStep2 .imagePreviewTitle {
    margin-bottom: 6px;
  }

  .purchasePage #wizardStep2 .previewContainer {
    min-height: 105px;
    max-height: 190px;
  }

  .purchasePage #wizardStep2 .infoCard {
    min-height: 82px;
  }

  .purchasePage #wizardStep2 .keepRatio {
    margin: 3px 0;
  }

  .purchasePage #wizardStep2 .wallSizeWarning {
    min-height: 38px;
  }

  .purchasePage #wizardStep2 .step2Buttons {
    flex-basis: 60px;
    padding-bottom: 4px;
  }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 650px) {
  .purchasePage {
    height: 100dvh;
    min-height: 100dvh;
    padding: 8px;
  }

  .purchasePage .wizard {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    min-height: 0;
  }

  .purchasePage #wizardStep2 .step2Content,
  .purchasePage #wizardStep2 .step2Buttons {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ==========================================================
   STEP 3 - COMPANY INFORMATION COMPACT TWO-COLUMN LAYOUT
========================================================== */

.purchasePage #wizardStep3 {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ----------------------------------------------------------
   TITLE
---------------------------------------------------------- */

.purchasePage #wizardStep3 .imagePreviewTitle {
  flex: 0 0 auto;
  margin: 0 0 12px;
  line-height: 1;
}

/* ----------------------------------------------------------
   SCROLL AREA
---------------------------------------------------------- */

.purchasePage #wizardStep3 .wizardScroll {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 38px;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   FORM
---------------------------------------------------------- */

.purchasePage #wizardStep3 .companyForm {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   TWO-COLUMN ROWS
---------------------------------------------------------- */

.purchasePage #wizardStep3 .companyFormRow {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}

/* ----------------------------------------------------------
   LABELS
---------------------------------------------------------- */

.purchasePage #wizardStep3 .companyForm label {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   INPUTS
---------------------------------------------------------- */

.purchasePage #wizardStep3 .companyForm input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   DESCRIPTION
---------------------------------------------------------- */

.purchasePage #wizardStep3 .companyDescription {
  width: 100%;
}

.purchasePage #wizardStep3 .companyDescription textarea {
  width: 100%;
  /* Same initial height as the other fields */
  height: 52px;
  min-height: 52px;
  /* No maximum height: the user can enlarge the Description field when more writing space is required. */
  max-height: none;
  margin: 0;
  padding: 12px 16px;
  /* Allows resizing only vertically. Width always remains aligned with the form. */
  resize: vertical;
  overflow-y: auto;
  box-sizing: border-box;
}

/* ----------------------------------------------------------
   BACK / CONTINUE
---------------------------------------------------------- */

.purchasePage #wizardStep3>.wizardButtons {
  flex: 0 0 76px;
  width: 100%;
  margin: 8px 0 0;
  padding: 4px 38px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
}

.purchasePage input::placeholder,
.purchasePage textarea::placeholder {
  color: rgba(9, 15, 28, 0.42);
  opacity: 1;
  font-family: var(--font-body);
  font-weight: 400;
}

/* ==========================================================
   MOBILE - RETURN TO ONE COLUMN
========================================================== */

@media (max-width: 650px) {
  .purchasePage #wizardStep3 .wizardScroll {
    padding-left: 16px;
    padding-right: 16px;
  }

  .purchasePage #wizardStep3 .companyFormRow {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .purchasePage #wizardStep3>.wizardButtons {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ==========================================================
   STEP 4 - COMPACT ORDER SUMMARY
========================================================== */

.purchasePage #wizardStep4 {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

/* Hidden Step 4 must remain hidden */

.purchasePage #wizardStep4.hidden {
  display: none !important;
}

/* ----------------------------------------------------------
   TITLE
---------------------------------------------------------- */

.purchasePage #wizardStep4 .imagePreviewTitle {
  flex: 0 0 auto;
  margin: 0 0 18px;
  line-height: 1;
}

/* ==========================================================
   SUMMARY MAIN AREA

   Logo LEFT + information RIGHT
========================================================== */

.purchasePage #wizardStep4 .compactOrderSummary {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(180px, 0.28fr) minmax(0, 1fr);
  gap: 24px;
  padding: 0 38px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ==========================================================
   LOGO
========================================================== */

.purchasePage #wizardStep4 .summaryPreview {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 18px;
  border-radius: 18px;
  overflow: hidden;
  box-sizing: border-box;
}

.purchasePage #wizardStep4 .summaryPreview img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* ==========================================================
   INFORMATION GRID
========================================================== */

.purchasePage #wizardStep4 .summaryGrid {
  width: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(4, minmax(0, 1fr));
  gap: 10px 14px;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================================================
   EACH SUMMARY ITEM
========================================================== */

.purchasePage #wizardStep4 .summaryGrid>div {
  min-width: 0;
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  margin: 0;
  border-radius: 14px;
  box-sizing: border-box;
}

/* LABEL */

.purchasePage #wizardStep4 .summaryGrid>div>span {
  flex: 0 0 auto;
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
}

/* VALUE */

.purchasePage #wizardStep4 .summaryGrid>div>strong {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.2;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Keep Ready for Payment compact */

.purchasePage #wizardStep4 .readyStatus {
  white-space: nowrap;
}

/* ==========================================================
   BACK / PROCEED TO PAYMENT
========================================================== */

.purchasePage #wizardStep4>.wizardButtons {
  flex: 0 0 76px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0 0;
  padding: 4px 38px 10px;
  box-sizing: border-box;
}

/* ==========================================================
   SHORT DESKTOP SCREENS
========================================================== */

@media (max-height: 850px) and (min-width: 651px) {
  .purchasePage #wizardStep4 .imagePreviewTitle {
    margin-bottom: 12px;
  }

  .purchasePage #wizardStep4 .compactOrderSummary {
    gap: 18px;
  }

  .purchasePage #wizardStep4 .summaryGrid {
    gap: 8px 12px;
  }

  .purchasePage #wizardStep4 .summaryGrid>div {
    min-height: 50px;
    padding: 7px 14px;
  }

  .purchasePage #wizardStep4>.wizardButtons {
    flex-basis: 66px;
    margin-top: 8px;
  }
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 650px) {
  .purchasePage #wizardStep4 .compactOrderSummary {
    grid-template-columns: 1fr;
    padding-left: 16px;
    padding-right: 16px;
    overflow-y: auto;
  }

  .purchasePage #wizardStep4 .summaryPreview {
    height: 140px;
  }

  .purchasePage #wizardStep4 .summaryGrid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .purchasePage #wizardStep4>.wizardButtons {
    padding-left: 16px;
    padding-right: 16px;
  }
}

/* ==========================================================
   STEP 5 - FINAL PAYMENT SELECTION
========================================================== */

.purchasePage #wizardStep5 {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.purchasePage #wizardStep5.hidden {
  display: none !important;
}

/* ----------------------------------------------------------
   TITLE
---------------------------------------------------------- */

.purchasePage #wizardStep5 .imagePreviewTitle {
  flex: 0 0 auto;
  margin: 0 0 22px;
  line-height: 1;
}

/* ----------------------------------------------------------
   PAYMENT CONTENT
---------------------------------------------------------- */

.purchasePage #wizardStep5 .paymentStepFinal {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 0 38px;
  overflow: hidden;
  box-sizing: border-box;
}

/* ==========================================================
   FINAL ORDER SUMMARY
========================================================== */

.purchasePage #wizardStep5 .paymentOrderSummary {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.purchasePage #wizardStep5 .paymentSummaryItem {
  min-height: 82px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  box-sizing: border-box;
}

.purchasePage #wizardStep5 .paymentSummaryItem span {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0.72;
}

.purchasePage #wizardStep5 .paymentSummaryItem strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.purchasePage #wizardStep5 .paymentSummaryTotal strong {
  font-size: 26px;
}

/* GST breakdown under the total, e.g. "A$121.00 + A$12.10 GST". */
.purchasePage #wizardStep5 .paymentSummaryTotal small {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.72;
}

/* ==========================================================
   PAYMENT METHOD TITLE
========================================================== */

.purchasePage #wizardStep5 .paymentNote {
  width: 100%;
  margin: 8px 0 0;
  text-align: center;
  font-size: 16px;
  line-height: 1.4;
  opacity: 0.85;
}

.purchasePage #wizardStep5 .paymentLogos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin: 4px 0;
}

.purchasePage #wizardStep5 .paymentLogos img {
  height: 30px;
  width: auto;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  box-sizing: content-box;
}

.purchasePage #wizardStep5 .paymentStepFinal {
  overflow-y: auto;
}

.purchasePage #wizardStep5 .paymentDetails {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  box-sizing: border-box;
}

.purchasePage #wizardStep5 .paymentDetailsLogo {
  flex: 0 0 96px;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background-color: #8b1e1e;
}

.purchasePage #wizardStep5 .paymentDetailsLogo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.purchasePage #wizardStep5 .paymentDetailsRows {
  flex: 1 1 auto;
  min-width: 0;
}

.purchasePage #wizardStep5 .paymentDetailsRow {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
}

.purchasePage #wizardStep5 .paymentDetailsRow:last-child {
  border-bottom: 0;
}

.purchasePage #wizardStep5 .paymentDetailsRow span {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.purchasePage #wizardStep5 .paymentDetailsRow strong {
  min-width: 0;
  text-align: right;
  font-weight: 600;
  overflow-wrap: anywhere;
}

@media (max-width: 650px) {
  .purchasePage #wizardStep5 .paymentDetails {
    flex-direction: column;
  }
}

/* ==========================================================
   NAVIGATION
========================================================== */

.purchasePage #wizardStep5>.paymentNavigation {
  flex: 0 0 76px;
  width: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin: 10px 0 0;
  padding: 4px 38px 10px;
  box-sizing: border-box;
}

/* ==========================================================
   MOBILE
========================================================== */

@media (max-width: 650px) {
  .purchasePage #wizardStep5 .paymentStepFinal {
    padding-left: 16px;
    padding-right: 16px;
    overflow-y: auto;
  }

  .purchasePage #wizardStep5 .paymentOrderSummary {
    grid-template-columns: 1fr;
  }

  .purchasePage #wizardStep5>.paymentNavigation {
    padding-left: 16px;
    padding-right: 16px;
  }
}

.paymentNotice {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(4, 9, 18, 0.78);
}

.paymentNoticeCard {
  width: min(480px, 100%);
  padding: 32px 28px 26px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  background: #0a1224;
  box-shadow: var(--modal-shadow);
}

.paymentNoticeCard h3 {
  margin-bottom: 12px;
  color: #f5b93f;
  font-size: 36px;
  font-weight: 400;
}

.paymentNoticeCard p {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.5;
}

.paymentNoticeOrder {
  margin: 18px 0 4px;
  padding: 10px 14px;
  border: 1px solid rgba(244, 182, 58, 0.45);
  border-radius: 10px;
  background: rgba(244, 182, 58, 0.08);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.paymentNoticeCard .paymentNoticeHelp {
  margin: 14px 0 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
}

.paymentNoticeCard .paymentNoticeHelp a {
  color: var(--accent);
}

.paymentNoticeCard button {
  margin-top: 22px;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
  font-size: 24px;
  cursor: pointer;
}

.fieldError {
  display: block;
  margin-top: 4px;
  color: #ff5c5c;
  font-size: 13px;
}

.fieldInvalid {
  border-color: #ff5c5c !important;
}

/* ==========================================================
   SCROLLBAR - SAME STYLE AS STEP 3 (Step 4 and Step 5)
========================================================== */

#wizardStep5,
.purchasePage #wizardStep4 .compactOrderSummary,
.purchasePage #wizardStep5 .paymentStepFinal {
  scrollbar-color: #f4b936 transparent;
}

.privacyNotice {
  margin-top: 14px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
}

.privacyNotice a {
  color: var(--accent);
}

.copyright a {
  pointer-events: auto;
  cursor: pointer;
  padding: 4px 0;
  color: inherit;
  text-decoration: underline;
}

.purchasePage #wizardStep3 > .privacyNotice {
  flex: 0 0 auto;
  margin: 10px 0 0;
}

/* ==========================================================
   STEP 3 - COMPACT FOUR-COLUMN LAYOUT (NO SCROLLING)

   Row 1: [Company | Website | Description x2]
   Row 2: [First | Last | Email | Phone]
========================================================== */

@media (min-width: 900px) {
  .purchasePage #wizardStep3 .companyForm {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-items: start;
    gap: 14px 20px;
  }

  .purchasePage #wizardStep3 .companyFormRow {
    display: contents;
  }

  .purchasePage #wizardStep3 .companyDescription {
    grid-column: span 2;
  }
}

/* ==========================================================
   STEP 3 - WIDER SPACING AND STABLE LAYOUT

   Rows share the available space and the error message uses space
   that is already reserved, so nothing moves when it appears.
========================================================== */

@media (min-width: 900px) {
  .purchasePage #wizardStep3 .wizardScroll {
    display: flex;
    flex-direction: column;
  }

  .purchasePage #wizardStep3 .companyForm {
    flex: 1 1 auto;
    align-content: center;
    row-gap: clamp(14px, 9vh, 80px);
  }

  .purchasePage #wizardStep3 .companyForm label {
    position: relative;
    padding-bottom: 22px;
  }

  .purchasePage #wizardStep3 .companyForm .fieldError {
    position: absolute;
    left: 0;
    bottom: 0;
    margin-top: 0;
  }
}

/* ==========================================================
   STEP 5 - FIXED LAYOUT (no scrolling) + FOOTER BUTTONS
========================================================== */

.purchasePage #wizardStep5 > .paymentNavigation {
  justify-content: space-between;
}

#backToStep4 {
  background: rgba(255, 255, 255, .10);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, .15);
}

#backToStep4:hover {
  background: rgba(255, 255, 255, .18);
}

#completePayment {
  min-width: 330px;
  background: #ffb400;
  color: #000;
}

#completePayment:hover {
  background: #ffc933;
}

@media (min-width: 900px) {
  .purchasePage #wizardStep5 .paymentStepFinal {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto;
    align-content: center;
    gap: clamp(10px, 2.5vh, 22px) 24px;
  }

  .purchasePage #wizardStep5 .paymentOrderSummary {
    grid-column: 1 / -1;
    grid-row: 1;
  }

  .purchasePage #wizardStep5 .paymentSummaryItem {
    min-height: 70px;
  }

  .purchasePage #wizardStep5 .paymentDetails {
    grid-column: 1;
    grid-row: 2 / span 3;
  }

  .purchasePage #wizardStep5 .paymentNote {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    align-self: end;
  }

  .purchasePage #wizardStep5 .paymentStepFinal .privacyNotice {
    grid-column: 2;
    grid-row: 3;
    margin: 0;
  }

  .purchasePage #wizardStep5 .paymentLogos {
    grid-column: 2;
    grid-row: 4;
    margin: 0;
    align-self: start;
  }
}

/* ==========================================================
   STEP 2 - SCROLLABLE CONTENT ON SMALL SCREENS

   On phones the preview, the size fields, the warning and the
   suggested size are taller than the space left inside the
   modal. The content scrolls while Back / Continue stay visible.
========================================================== */

.purchasePage #wizardStep2 .step2Content {
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #f4b936 transparent;
}

.purchasePage #wizardStep2 .step2Content::-webkit-scrollbar {
  width: 6px;
}

.purchasePage #wizardStep2 .step2Content::-webkit-scrollbar-track {
  background: transparent;
}

.purchasePage #wizardStep2 .step2Content::-webkit-scrollbar-thumb {
  background: #f4b936;
  border-radius: 999px;
}

/* ==========================================================
   HOME PAGE ON PHONES

   - The page now follows the visible height of the phone
     (100dvh), so the footer is no longer hidden behind the
     browser's address bar.
   - The header fits the screen: smaller logo and a TAKE BRICKS
     button that is always visible.
   - The footer grows to fit the counter and the links.
========================================================== */

@media (max-width: 650px) {
  body:not(.purchasePage) .page {
    height: 100vh;
    height: 100dvh;
  }

  body:not(.purchasePage) .topBar {
    width: 100%;
    padding: 8px 12px 0;
    gap: 8px;
  }

  body:not(.purchasePage) .brand {
    margin-left: 0;
    min-width: 0;
    flex: 1 1 auto;
  }

  body:not(.purchasePage) .brandLogo {
    height: auto;
    width: auto;
    max-width: 100%;
    max-height: 44px;
  }

  body:not(.purchasePage) .takeBricksButton {
    flex: 0 0 auto;
    margin: 0;
    padding: 8px 12px;
    font-size: 15px;
    letter-spacing: 1px;
  }

  body:not(.purchasePage) .wallSection {
    padding: 8px;
    min-height: 0;
  }

  body:not(.purchasePage) .brickFrame {
    width: 100%;
  }

  body:not(.purchasePage) footer {
    height: auto;
    min-height: 70px;
    padding: 8px 14px 10px;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  body:not(.purchasePage) .footerContent {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  body:not(.purchasePage) .counter {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0;
    gap: 6px;
  }

  body:not(.purchasePage) .counterTitle {
    font-size: 16px;
    letter-spacing: 1px;
  }

  body:not(.purchasePage) #soldPixels {
    font-size: 15px;
  }

  body:not(.purchasePage) .progressBar {
    flex: 0 0 auto;
    height: 10px;
  }

  body:not(.purchasePage) .copyright {
    position: static;
    max-width: none;
    text-align: center;
    font-size: 11px;
    line-height: 1.5;
    white-space: normal;
  }
}

/* ==========================================================
   PURCHASE WIZARD ON PHONES AND SMALL TABLETS

   - One-line title, so the content gets the room.
   - Back / Continue sit side by side at the bottom and stay
     visible (also above the phone's gesture bar).
   - Every step scrolls inside its own area when the content
     is taller than the screen (small phones, landscape).
   - Works from 320 px wide phones up to tablets.
========================================================== */

@media (max-width: 650px) {
  .purchasePage {
    padding: 8px;
    align-items: stretch;
  }

  .purchasePage .wizard {
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    padding: 0;
    border-radius: 18px;
  }

  .purchasePage .wizardHeader {
    flex-direction: row;
    gap: 0;
    padding: 14px 56px 6px;
  }

  .purchasePage .wizardHeader h2 {
    font-size: 30px;
    letter-spacing: 1px;
    white-space: nowrap;
  }

  .purchasePage .closeButton {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  .purchasePage .wizardPage {
    padding: 0;
  }

  .purchasePage .wizardPage > h3,
  .purchasePage .imagePreviewTitle {
    margin: 4px 16px 8px;
    font-size: 20px;
    line-height: 1.15;
    text-align: center;
  }

  .purchasePage #wizardStep1 {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .purchasePage #wizardStep1 > p {
    margin: 0 20px 12px;
    font-size: 14px;
    line-height: 1.35;
    text-align: center;
  }

  .purchasePage #wizardStep1 .uploadArea {
    flex: 1 1 auto;
    width: calc(100% - 32px);
    max-width: 420px;
    min-height: 180px;
    margin: 0 auto 12px;
  }

  /* Scrolling content area of each step. */

  .purchasePage #wizardStep2 .step2Content,
  .purchasePage #wizardStep3 .wizardScroll,
  .purchasePage #wizardStep4 .compactOrderSummary,
  .purchasePage #wizardStep5 .paymentStepFinal {
    flex: 1 1 auto;
    min-height: 0;
    padding-left: 16px;
    padding-right: 16px;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .purchasePage #wizardStep2 .previewContainer {
    max-height: 30vh;
  }

  .purchasePage #wizardStep2 .infoGrid {
    gap: 8px;
  }

  /* Buttons: side by side, always visible. */

  .purchasePage .wizardButtons,
  .purchasePage #wizardStep2 .step2Buttons,
  .purchasePage #wizardStep3 > .wizardButtons,
  .purchasePage #wizardStep4 > .wizardButtons,
  .purchasePage #wizardStep5 > .paymentNavigation {
    flex: 0 0 auto;
    width: 100%;
    flex-direction: row;
    justify-content: stretch;
    align-items: stretch;
    gap: 10px;
    margin: 0;
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
  }

  .purchasePage .wizardButtons:empty {
    display: none;
  }

  .purchasePage .wizardButtons button,
  .purchasePage #wizardStep5 > .paymentNavigation button {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    height: auto;
    min-height: 46px;
    padding: 6px 10px;
    font-size: 18px;
    line-height: 1.1;
    letter-spacing: 0.5px;
    border-radius: 14px;
    text-align: center;
  }

  .purchasePage .wizardButtons button:last-child {
    flex: 1.4 1 0;
  }

  .purchasePage #wizardStep4 .summaryPreview {
    height: 110px;
    margin-bottom: 12px;
  }
}

/* Very small or short phones (and phones held sideways). */

@media (max-width: 650px) and (max-height: 560px) {
  .purchasePage .wizardHeader {
    padding-top: 8px;
    padding-bottom: 2px;
  }

  .purchasePage .wizardHeader h2 {
    font-size: 24px;
  }

  .purchasePage .wizardButtons button {
    min-height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 360px) {
  .purchasePage .wizardHeader h2 {
    font-size: 26px;
  }

  .purchasePage .wizardButtons button {
    font-size: 16px;
  }
}

/* Tablets, portrait and landscape. */

@media (min-width: 651px) and (max-width: 1100px) {
  .purchasePage {
    padding: 12px;
  }

  .purchasePage .wizard {
    width: min(760px, 100%);
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .purchasePage .wizardHeader {
    padding: 22px 80px 10px;
  }

  .purchasePage .wizardHeader h2 {
    font-size: 44px;
    white-space: nowrap;
  }

  .purchasePage #wizardStep2 .step2Content,
  .purchasePage #wizardStep3 .wizardScroll,
  .purchasePage #wizardStep4 .compactOrderSummary,
  .purchasePage #wizardStep5 .paymentStepFinal {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .purchasePage .wizardButtons button {
    min-width: 150px;
    height: 52px;
    font-size: 22px;
  }
}
