main.builder-main {
  padding: 80px 24px 120px;
  display: grid;
  gap: 32px;
}

.builder-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
  text-align: center;
}

.builder-hero p { color: var(--muted); margin: 12px auto 0; max-width: 760px; }

.builder {
  display: flex;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.inputs { width: 320px; flex: 0 0 320px; display: grid; gap: 6px; }
.inputs label { display: block; margin-top: 6px; }
.inputs input, .inputs select { margin-top: 6px; }
.inputs h3 { margin: 12px 0 8px; }
.inputs .btn { width: 100%; }

.preview { flex: 1; display: flex; align-items: flex-start; justify-content: center; }
.preview svg {
  width: 100%;
  height: auto;
  display: block;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.preview svg text { fill: var(--ink); font-weight: 600; font-family: "Manrope", system-ui, -apple-system, "SF Pro Text", "SF Pro Display", "Helvetica Neue", Helvetica, sans-serif; }

.material-preview { position: relative; display: inline-block; margin-top: 1rem; }
.preview-img { width: 100%; max-width: 300px; border-radius: 18px; display: block; }
.preview-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 600px;
  max-width: none;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
  transform: scale(.8) rotate(-2deg);
  opacity: 0;
  transform-origin: top left;
  transition: transform .45s cubic-bezier(.33,1,.68,1), opacity .45s ease;
  z-index: 20;
  pointer-events: none;
}
.material-preview:hover .preview-full { transform: scale(1) rotate(0); opacity: 1; }

.cart { text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); backdrop-filter: blur(6px); }
.cart-items { list-style: none; padding: 0; margin: 0; }
.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border-radius: 18px;
  padding: .75rem;
  margin-bottom: .75rem;
  box-shadow: 0 2px 4px rgba(0,0,0,.05);
  border: 1px solid #e0e0e0;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.cart-item:nth-child(even) { background: #faf7f4; }
.cart-item:hover { background: #fffdfb; box-shadow: 0 4px 12px rgba(0,0,0,.08); }

.thumb-container { position: relative; cursor: zoom-in; width: 120px; }
.cart-thumb { width: 120px; height: 120px; border: 1px solid #ddd; border-radius: 18px; object-fit: contain; }
.thumb-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px;
  height: 150px;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transform: scale(.5) translate(4px, 4px);
  opacity: 0;
  transform-origin: top left;
  transition: transform .2s ease, opacity .2s ease;
  z-index: 10;
  border-radius: 18px;
}
.thumb-container:hover .thumb-full {
  transform: scale(2.5) translate(6px, 6px);
  opacity: 1;
  box-shadow: 0 18px 45px rgba(0,0,0,0.28);
}

.material-container { position: absolute; bottom: 4px; right: 4px; cursor: zoom-in; }
.material-thumb { width: 40px; height: 40px; border: 1px solid #ddd; border-radius: 18px; object-fit: cover; transition: transform .2s ease; }
.material-thumb:hover { transform: scale(1.05); }
.material-full {
  position: absolute;
  top: 0;
  left: 0;
  width: 160px;
  max-width: 200px;
  height: auto;
  background: #fff;
  border: 1px solid #ddd;
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
  transform: scale(.8);
  opacity: 0;
  transform-origin: top left;
  transition: transform .3s ease, opacity .3s ease;
  z-index: 10;
  border-radius: 18px;
}
.material-container:hover .material-full { transform: scale(1); opacity: 1; }

.cart-info { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.cart-info .item-price { font-weight: 700; margin-top: .25rem; }

.remove-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; color: #999; transition: color .2s ease; }
.remove-btn:hover { color: #c00; }

.cart-total { font-weight: 700; margin-top: 1rem; }

.btn-clear {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  cursor: pointer;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.btn-clear svg { width: 1em; height: 1em; pointer-events: none; }
.btn-clear:hover { background: rgba(79, 122, 146, 0.08); border-color: rgba(79, 122, 146, 0.4); transform: translateY(-1px); }
.btn-clear:active { transform: translateY(0); }
.btn-clear.animate svg { animation: spinClear .6s ease; }

.fade-in { animation: popIn .4s ease both; }
.fade-out-up { animation: fadeOutUp .45s ease forwards; }

@keyframes fadeOutUp { to { opacity: 0; transform: translateY(-20px); } }
@keyframes spinClear { to { transform: rotate(360deg); } }
@keyframes popIn { from { opacity: 0; transform: scale(.95); } to { opacity: 1; transform: scale(1); } }

.spinner { display: inline-block; width: 1.2em; height: 1.2em; border: 3px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .6s linear infinite; margin-right: .5em; vertical-align: middle; }

.faq-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}

.faq-container h2 { text-align: center; margin-bottom: 16px; letter-spacing: -0.01em; }
.faq-item { padding: 1rem 0; border-top: 1px solid var(--border); cursor: pointer; }
.faq-item:first-child { border-top: none; }
.faq-question { font-size: 1.05rem; font-weight: 700; display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: none; padding: 0; color: var(--ink); text-align: left; }
.faq-icon { font-size: 1.5rem; transition: transform .4s ease; color: var(--accent); }
.faq-item.open .faq-icon { transform: rotate(45deg); }
.faq-answer { overflow: hidden; max-height: 0; opacity: 0; transform: translateY(-0.25rem); transition: max-height .4s ease, opacity .4s ease, transform .4s ease; }
.faq-answer p { font-size: 1rem; line-height: 1.7; color: var(--muted); padding-top: .5rem; margin: 0; }
.faq-item.open .faq-answer { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .builder { flex-direction: column; gap: 18px; padding: 18px; }
  .inputs { width: 100%; flex: none; }
}

@media (max-width: 640px) {
  .builder-hero { padding: 24px; }
  .faq-container { padding: 24px; }
}

/* ================================
   Premium Checkout Overlay (Build)
   ================================ */

.checkout-overlay{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;              /* hidden until active */
  place-items: center;
  background: rgba(10, 18, 24, 0.38);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow: hidden;
}

.checkout-overlay.active{
  display: grid;
}

/* Layer A: drifting light blooms (subtle, sexy) */
.checkout-overlay::before{
  content:"";
  position:absolute;
  inset:-25%;
  background:
    radial-gradient(circle at 30% 35%, rgba(79,122,146,0.26), rgba(79,122,146,0.00) 62%),
    radial-gradient(circle at 68% 62%, rgba(255,255,255,0.14), rgba(255,255,255,0.00) 58%),
    radial-gradient(circle at 55% 20%, rgba(79,122,146,0.14), rgba(79,122,146,0.00) 55%);
  opacity: 0.95;
  animation: overlayBlooms 10.5s ease-in-out infinite alternate;
  pointer-events:none;
  transform: translate3d(0,0,0);
}

/* Layer B: subtle grain (tiny movement) */
.checkout-overlay::after{
  content:"";
  position:absolute;
  inset:-10%;
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.035) 0 1px, rgba(0,0,0,0.035) 2px 3px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0 1px, rgba(0,0,0,0.02) 2px 3px);
  opacity: 0.085;
  mix-blend-mode: overlay;
  animation: overlayGrain 700ms steps(2) infinite;
  pointer-events:none;
  transform: translate3d(0,0,0);
}

/* Layer C: breathing vignette (adds depth) */
.checkout-overlay .overlay-vignette{
  position:absolute;
  inset:0;
  background: radial-gradient(ellipse at center,
    rgba(255,255,255,0.05) 0%,
    rgba(0,0,0,0.00) 55%,
    rgba(0,0,0,0.20) 100%);
  opacity: 0.92;
  animation: overlayVignette 3.6s ease-in-out infinite alternate;
  pointer-events:none;
}

/* The modal */
.overlay-card{
  position: relative;
  z-index: 2;
  width: min(540px, 92vw);
  border-radius: 22px;
  background: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.55);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 22px 60px rgba(0,0,0,0.22), 0 2px 10px rgba(0,0,0,0.10);
  padding: 26px 26px 20px;
  transform: translateY(8px) scale(0.98);
  opacity: 0;
  animation: overlayIn 220ms cubic-bezier(0.2,0.8,0.2,1) forwards;
}

@keyframes overlayIn{
  to{ transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes overlayBlooms{
  0%   { transform: translate3d(-3%, -2%, 0) rotate(-2deg) scale(1.03); }
  100% { transform: translate3d( 3%,  2%, 0) rotate( 2deg) scale(1.07); }
}

@keyframes overlayVignette{
  0%{ opacity: 0.88; }
  100%{ opacity: 1.0; }
}

@keyframes overlayGrain{
  0%{ transform: translate3d(0,0,0); }
  25%{ transform: translate3d(-1px, 1px,0); }
  50%{ transform: translate3d( 1px,-1px,0); }
  75%{ transform: translate3d(-2px, 0,0); }
  100%{ transform: translate3d(0,0,0); }
}

/* Modern ring spinner (not default) */
.overlay-spinner{
  width: 44px;
  height: 44px;
  margin: 2px auto 12px;
  border-radius: 50%;
  background: conic-gradient(from 90deg,
    rgba(79,122,146,0.15),
    rgba(79,122,146,1),
    rgba(79,122,146,0.15));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
          mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  animation: spin 1.1s linear infinite, spinnerBreathe 1.6s ease-in-out infinite alternate;
  filter: drop-shadow(0 10px 24px rgba(79,122,146,0.25));
}

@keyframes spin{ to { transform: rotate(360deg); } }
@keyframes spinnerBreathe{ from { opacity: 0.86; } to { opacity: 1; } }


/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .checkout-overlay::before,
  .checkout-overlay::after,
  .checkout-overlay .overlay-vignette,
  .overlay-card,
  .overlay-spinner{ animation: none !important; }
  .overlay-card{ opacity: 1 !important; transform: none !important; }
}

/* ===== Overlay text (FINAL: single-line status, centered) ===== */

.overlay-card{
  text-align: center;
  padding: 30px 32px 26px; /* intentional, premium */
}

.overlay-text{
  display: grid;
  gap: 6px;
  justify-items: center;
}

.overlay-heading{
  margin: 0;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

.overlay-subheading{
  margin: 0;
  font-weight: 500;
  font-size: 13px;
  color: rgba(18,32,42,0.70);
}

/* Single status line */
.overlay-status{
  margin: 10px 0 0;
  width: 100%;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgba(18,32,42,0.82);
  min-height: 22px; /* prevents jump */
  will-change: opacity, transform;
}

/* Dissolve */
.overlay-status.is-out{
  opacity: 0;
  transform: translateY(2px);
  transition: 160ms ease;
}
.overlay-status.is-in{
  opacity: 1;
  transform: translateY(0);
  transition: 220ms cubic-bezier(0.2,0.8,0.2,1);
}

/* On smaller screens, keep spacing tight */
@media (max-width: 520px){
  .overlay-card{ padding: 26px 22px 22px; }
  .overlay-heading{ font-size: 17px; }
}
