/* ------------------------------------------------------------------------
  Journal Designer – full CSS (no Tailwind)
  ------------------------------------------------------------------------ */

/* Smooth scrolling for anchor links */
html {
  scroll-behavior: smooth;
}

.designer{
  display:grid;
  grid-template-columns: 1fr 450px 100px;   /* stage | sidebar | progress */
  gap:24px; 
  padding:32px; 
  height:100vh; 
  align-items:start;
}

/* Progress column (rightmost) */
.designer__progress {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 12px;
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
}

/* ------ Checkout Progress Indicator (Compact) ----------------------------- */
.checkout-progress-compact {
  grid-column: 1 / -1;
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 1.5rem;
  margin-bottom: 0;
  position: relative;
}

.progress-track {
  position: absolute;
  top: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.progress-track__fill {
  height: 100%;
  background: #16a34a;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-steps-compact {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4rem;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.progress-step-compact {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.step-marker {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.25s;
}

.progress-step-compact.complete .step-marker {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

.progress-step-compact.active .step-marker {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.step-label {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-step-compact.complete .step-label,
.progress-step-compact.active .step-label {
  color: #16a34a;
  font-weight: 600;
}

/* ------ Vertical Progress Indicator (Desktop Sidebar) ----------------------------- */
.checkout-progress-vertical {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  position: relative;
}

.progress-track-vertical {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 12px;
  bottom: 12px;
  width: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.progress-track-vertical__fill {
  width: 100%;
  background: #16a34a;
  transition: height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-steps-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

.progress-step-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
}

.step-marker-vertical {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: white;
  border: 2px solid #e5e7eb;
  color: #9ca3af;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  transition: all 0.25s;
  flex-shrink: 0;
}

.progress-step-vertical.complete .step-marker-vertical {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
}

.progress-step-vertical.active .step-marker-vertical {
  background: #16a34a;
  border-color: #16a34a;
  color: white;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.step-label-vertical {
  font-size: 0.625rem;
  font-weight: 500;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  line-height: 1.2;
  text-align: center;
}

.progress-step-vertical.complete .step-label-vertical,
.progress-step-vertical.active .step-label-vertical {
  color: #16a34a;
  font-weight: 600;
}

/* Show/Hide Progress Based on Screen Size */
.progress-mobile-only {
  display: none;
}

.progress-desktop-only {
  display: block;
}

@media (max-width: 1100px) {
  .progress-mobile-only {
    display: block;
  }
  
  .progress-desktop-only {
    display: none;
  }
}

@media (max-width: 768px) {
  .checkout-progress-compact {
    padding: 0.5rem 1rem;
  }
  
  .progress-track {
    top: 1.25rem;
  }
  
  .progress-steps-compact {
    gap: 1.5rem;
  }
  
  .step-label {
    font-size: 0.625rem;
  }
  
  .step-marker {
    width: 24px;
    height: 24px;
    font-size: 0.75rem;
  }
}

/* ------ 2) Sidebar ------------------------------------------------------ */
.designer__sidebar{
  background:var(--panel);
  border:1px solid var(--soft-2);
  border-radius:var(--radius);
  padding:20px 20px 16px;
  position:sticky; top:24px;
  overflow:auto;
  box-shadow:0 2px 6px rgba(0,0,0,.05);
}

.designer__brand{ 
  display: flex; 
  align-items: center; 
  gap: 12px; 
  margin-bottom: 18px;
}

.brand__icon{
  width:36px; height:36px; border-radius:10px; display:grid; place-items:center;
  background:#fff; border:1px solid var(--soft-2);
}
.brand__title{ font-weight:800; letter-spacing:.2px }
.brand__sub{ color:var(--muted); font-size:12px; margin-top:2px }

.form .field{ margin:14px 0 16px }
.label{
  display:flex; align-items:center; font-size:12px; font-weight:700; color:var(--ink);
  letter-spacing:.12em; text-transform:uppercase; margin-bottom:8px;
}

.label svg {
  flex-shrink: 0;
  margin-right: 6px;
}

/* Disclosure summary alignment */
.disclosure-summary span {
  display: flex;
  align-items: center;
}

.disclosure-summary svg:first-child {
  margin-right: 6px;
  flex-shrink: 0;
}

.chips{ display:flex; gap:10px; flex-wrap:wrap }
.chip{
  display:inline-flex; align-items:center; gap:8px; cursor:pointer; user-select:none;
  padding:8px 12px; border-radius:999px;
  border:1px solid var(--soft-2); background:#fff; color:var(--ink);
}
.chip input{ display:none }
.chip input:checked + span{ position:relative }
.chip input:checked + span::before{
  content:""; width:8px; height:8px; border-radius:999px; background:var(--focus);
  display:inline-block; margin-right:8px; box-shadow:0 0 0 4px var(--ring);
}

.input,.select{
  width:100%; padding:12px 14px; border-radius:12px;
  border:1px solid var(--soft-2); background:#fff; color:var(--ink); outline:none;
}
.input:focus,.select:focus{ border-color:var(--focus); box-shadow:0 0 0 4px var(--ring) }

.hint{ color:var(--muted); font-size:12px; margin-top:6px }

.disclosure{
  margin:18px 0; border-radius:12px; border:1px solid var(--soft-2);
  background:var(--panel-2); padding:8px 10px;
}
.disclosure>summary{ cursor:pointer; list-style:none; user-select:none; color:var(--ink); font-weight:700 }
.disclosure[open]{ padding-bottom:12px }
.disclosure[open] .field{ margin:12px 0 0 }

.disclosure-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.disclosure-icon {
  transition: transform 0.2s ease;
  color: var(--muted);
}

.disclosure[open] .disclosure-icon {
  transform: rotate(90deg);
}

.actions{ display:flex; gap:10px; margin-top:16px; flex-direction: column }
.actions .btn:not(.btn--checkout) { 
  flex: 1;
  min-height: 42px;
}
.actions .btn--checkout {
  order: 3; /* Place checkout button last */
}
.actions .btn:not(.btn--checkout):first-child {
  order: 1;
}
.actions .btn:not(.btn--checkout):nth-child(2) {
  order: 2;
}

/* On larger screens, show buttons in a row except checkout */
@media (min-width: 480px) {
  .actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .actions .btn--checkout {
    flex-basis: 100%;
    order: 3;
  }
}
.btn{
  appearance:none;
  border:1px solid var(--soft-2);
  background:var(--panel);
  color:var(--ink);
  border-radius:8px;
  padding:10px 14px;
  cursor:pointer;
  font-weight:600;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn:hover{ background:rgba(0,0,0,.03) }
.btn:active{ background:rgba(0,0,0,.05) }
.btn:focus-visible{ outline:none; border-color:var(--focus); box-shadow:0 0 0 4px var(--ring) }
.btn--primary{
  background:#16a34a;
  color:#fff;
  border-color:transparent;
  box-shadow:none;
}
.btn--primary:hover{ filter:none; background:#15803d }
.btn--primary:active{ background:#166534 }

/* Cover options */
.covers-grid{ display:grid; grid-template-columns:repeat(auto-fill, minmax(84px,1fr)); gap:10px }
.cover-option{ 
  padding:0; 
  border:1px solid var(--soft-2); 
  background:#fff; 
  border-radius:10px; 
  overflow:hidden; 
  cursor:pointer;
  transition: all 0.2s ease;
}
.cover-option:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  border-color: var(--focus);
}
.cover-option[aria-selected="true"]{ outline:2px solid var(--focus); box-shadow:0 0 0 4px var(--ring) }
.cover-option img{ 
  display:block; 
  width:100%; 
  height:84px; 
  object-fit:cover;
  transition: transform 0.2s ease;
}
.cover-option:hover img {
  transform: scale(1.02);
}

/* Ghost button variant (toolbar link) */
.btn--ghost{
  background:transparent;
  border-color:var(--soft-2);
  color:var(--ink);
}
.btn--ghost:hover{ background:rgba(0,0,0,.04) }

.sidebar__footer{
  margin-top:16px; padding-top:10px; border-top:1px dashed var(--soft-2);
  color:var(--muted); font-size:12px;
}

/* File Upload Terms Acceptance */
.file-upload-terms {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--soft-2);
}

.terms-acceptance-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px;
  background: #f0f4ff;
  border: 1px solid #dde5ff;
  border-radius: 8px;
  font-size: 12px;
  color: #4c5aa0;
}

.terms-acceptance-note svg {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: #4c5aa0;
}

.terms-acceptance-note strong {
  display: block;
  font-size: 13px;
  margin-bottom: 4px;
  color: #2a2f7a;
}

.terms-acceptance-note p {
  margin: 0;
  font-size: 12px;
  line-height: 1.4;
}

.footer-terms-link {
  color: #667eea;
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.footer-terms-link:hover {
  border-bottom-color: #667eea;
  opacity: 0.8;
}

/* Journal Description */
.journal-description {
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.05) 0%, rgba(25, 156, 120, 0.02) 100%);
  border: 1px solid rgba(25, 156, 120, 0.15);
  border-radius: 10px;
  padding: 16px;
  margin: 16px 0 20px;
}

.journal-description p {
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink);
  margin: 0;
}

/* ------ 3) Stage / Preview --------------------------------------------- */
.designer__stage{
  display: flex;
  gap: 20px;
  padding: 0;
  align-items: flex-start;
}

/* Cover Selector (Left Column) */
.stage__cover-selector {
  order: 1;
}
.stage__cover-selector {
  flex-shrink: 0;
  width: 140px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

.cover-selector__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 16px;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid #e5e7eb;
}

.cover-selector__header svg {
  color: #16a34a;
  flex-shrink: 0;
}

.cover-selector__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-selector__option {
  width: 100%;
  aspect-ratio: 1;
  border: 3px solid #e5e7eb;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: white;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.cover-selector__option:hover {
  border-color: #16a34a;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(22, 163, 74, 0.2);
}

.cover-selector__option[aria-selected="true"] {
  border-color: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.15);
}

.cover-selector__option[aria-selected="true"]::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: #16a34a;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cover-selector__option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s ease;
}

.cover-selector__option:hover img {
  transform: scale(1.1);
}

/* Preview Area (Right Column) */
.stage__preview-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Mobile: Reorder to show preview first, then cover selector */
@media (max-width: 768px) {
  .designer__stage {
    flex-direction: column;
    padding: 12px;
  }
  
  .stage__cover-selector {
    order: 2; /* Move cover selector below preview */
    width: 100%;
    position: static;
    max-height: none;
    padding: 12px;
  }
  
  /* Hide Cover Design header on mobile to save space */
  .cover-selector__header {
    display: none;
  }
  
  .stage__preview-area {
    order: 1; /* Keep preview at top */
    padding: 0;
  }
  
  .cover-selector__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
  }
  
  .cover-selector__option {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
  
  .cover-selector__customize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    padding: 12px 20px;
    background: #16a34a;
    color: white;
    border: 2px solid #16a34a;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
    scroll-behavior: smooth;
  }
  
  .cover-selector__customize-btn:hover {
    background: #15803d;
    border-color: #15803d;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(22, 163, 74, 0.35);
  }
  
  .cover-selector__customize-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.25);
  }
  
  .cover-selector__customize-btn svg {
    flex-shrink: 0;
  }
  
  /* Make book preview full width on mobile */
  .book {
    width: 100%;
    padding: 0;
  }
  
  .book__device {
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .stage__toolbar {
    padding: 6px 0 14px;
  }
}

/* Hide customize button on desktop by default */
.cover-selector__customize-btn {
  display: none;
}

/* Show customize button and view preview link only on mobile */
@media (max-width: 768px) {
  .cover-selector__customize-btn {
    display: flex !important;
  }
  
  .view-preview-link {
    display: flex !important;
  }
}

/* ------ 3) Stage / Preview (continued) --------------------------------- */
.designer__stage{
  background:var(--panel-2);
  border:1px solid var(--soft-2);
  border-radius:var(--radius);
  padding:18px; 
  position:relative;
  box-shadow:0 4px 16px rgba(0,0,0,.08);
  min-width: 45vw;;
}

.stage__toolbar{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:6px 8px 14px }
.stage__title{ display:flex; align-items:center; gap:10px }
.pill{
  display:inline-block; padding:.25rem .6rem; border-radius:999px;
  background:var(--soft); border:1px solid var(--soft-2); font-weight:700; margin-right:.5rem;
}
.muted{ color:var(--muted); font-size:12px }
.zoom{ display:flex; align-items:center; gap:.4rem }
.zoom__range{ width:160px; accent-color:#198c78 }
.zoom__btn{
  width:28px; height:28px; border-radius:8px; border:1px solid var(--soft-2);
  background:#fff; color:var(--ink); cursor:pointer;
}

/* ------ 4) Book preview device ----------------------------------------- */
.book{
  --ratio:calc(15 / 10.25);  /* width / height; default to hardcover */
  --journal-ratio:calc(14 / 9); /* slightly wider aspect ratio for journal spreads */
  --spine:32px;                 /* spine thickness; default to hardcover */
  --shadow:0 8px 24px rgba(0,0,0,.08);
  position:relative; display:grid; place-items:center;
  transform-origin:center top;
}

.book__device{
  position:relative;
  width:min(92%,920px);
  aspect-ratio: var(--ratio);
  background:#fff;
  border:1px solid var(--soft-2);
  border-radius:12px;
  overflow:hidden;
  transition: all 0.3s ease;
}

/* Use wider aspect ratio for journal spread viewing */
.book__device--journal {
  aspect-ratio: var(--journal-ratio);
}
.book__media{ 
  display:block; 
  width:100%; 
  height:100%; 
  border:0; 
  background:#fff; 
  object-fit: fill;
  transition: opacity 0.4s ease, transform 0.3s ease;
}
.book__glass{ pointer-events:none; position:absolute; inset:0; }
.book__device iframe.book__media{ 
  border:0;
  transition: opacity 0.4s ease;
}

/* Journal viewing mode (two-page spread on desktop) */
.book__device--journal{ background:var(--panel); transition: background-color 0.3s ease; }
.journal__spread{
  position:absolute; inset:0;
  padding:clamp(12px, 3vw, 20px);
  background:var(--panel);
  transition: opacity 0.4s ease;
  box-sizing: border-box; /* Ensure padding doesn't affect sizing */
}
.journal__spread iframe{
  width:100%; height:100%; border:0; display:block;
  background:#fff; border-radius:10px; box-shadow:inset 0 1px 0 rgba(0,0,0,.03);
  transition: opacity 0.4s ease, transform 0.2s ease;
  object-fit: cover; /* Ensure iframe content fills the container properly */
  overflow: hidden; /* Prevent content overflow */
  box-sizing: border-box; /* Consistent box model */
  margin: 0; /* Remove any default margins */
  padding: 0; /* Remove any default padding */
}

/* (Optional faux spine/pages visuals—hidden by default on light UI) */
.book__spine, .book__pages{ display:none }

/* ---- Bottom labels ----------------------------------------------------- */
.book__labels{
  width:min(92%,920px);
  margin:12px auto 0;
  padding-top:10px;
  border-top:1px dashed var(--soft-2);
  display:grid; grid-template-columns:1fr 1fr; align-items:start; column-gap:8px;
  min-height: 22px; /* reserve height so stage doesn't jump */
}
.book__label{
  font-size:12px; font-weight:500; letter-spacing:.18em; text-transform:uppercase;
  color:var(--muted); white-space:nowrap;
}
.book__label--back{ justify-self:start }
.book__label--front{ justify-self:end }

/* Hide labels visually but preserve space when not on the cover */
.book__labels.is-hidden{ visibility:hidden; border-top-color: transparent }

/* ---- Book navigation --------------------------------------------------- */
.book__nav{
  width:min(92%,920px);
  margin: 0 auto;
  display:flex; align-items:center; justify-content:center; gap:12px;
}
.book__nav__status{ font-size:12px; color:var(--muted); min-width:80px; text-align:center }

/* ------ Loader & Error -------------------------------------------------- */

.book__loader,
.book__error{
  position:absolute; inset:0;
  padding:clamp(16px, 4vw, 24px);
  background:#fff; z-index:2;
  opacity: 1;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.book__loader[hidden], .book__error[hidden]{ 
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.book__loader{
  display:grid;
  grid-template-rows:minmax(1fr, 420px) auto;
  align-content:space-between;
  justify-items:center;
  gap:18px;
}

.book__error{
  display:flex;
  flex-direction:column;
  justify-content:center;
  align-items:center;
  gap:14px;
}


.book__skeleton{
  width:100%; height:100%;
  border-radius:12px; border:1px solid var(--soft-2);
  background:var(--panel-2);
  padding:clamp(18px, 4vw, 28px);
  display:grid;
  align-content:stretch;
  position:relative; overflow:hidden;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.6);
}
.book__skeleton__spread{
  width:100%; height:100%;
  display:grid;
  grid-template-columns:minmax(0,1fr) clamp(18px, var(--spine, 28px), 36px) minmax(0,1fr);
  gap:clamp(10px, 3vw, 18px);
  align-items:stretch;
}
.book__skeleton__cover{
  position:relative;
  border-radius:10px;
  border:1px solid rgba(0,0,0,.05);
  background:linear-gradient(180deg,#f6f6f7,#eceff1);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.75);
  padding:18px 16px;
  display:flex;
  flex-direction:column;
  gap:12px;
  overflow:hidden;
  height:100%;
}
.book__skeleton__cover--front{ background:linear-gradient(180deg,#fdfefe,#e9ecef) }
.book__skeleton__cover--back{
  justify-content:flex-end; align-items:flex-end; gap:10px;
}
.book__skeleton__spine{
  border-radius:8px; border:1px solid rgba(0,0,0,.06);
  background:linear-gradient(180deg,rgba(0,0,0,.08),rgba(0,0,0,.02));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45);
}
.book__skeleton__badge{
  width:56px; height:56px;
  border-radius:16px; background:rgba(0,0,0,.07);
}
.book__skeleton__line{
  height:12px; border-radius:999px;
  background:rgba(0,0,0,.08); width:80%;
}
.book__skeleton__line--title{ height:16px; width:70%; background:rgba(0,0,0,.1) }
.book__skeleton__line--subtitle{ width:55%; opacity:.65 }
.book__skeleton__line--muted{ width:42%; opacity:.45 }
.book__skeleton__pill{
  margin-top:auto; height:10px; width:50%;
  border-radius:999px; background:rgba(0,0,0,.07);
}
.book__skeleton__shimmer{
  position:absolute; inset:0; transform:translateX(-100%);
  background:linear-gradient(90deg,rgba(255,255,255,0) 0%,rgba(255,255,255,.65) 50%,rgba(255,255,255,0) 100%);
  animation:bookShimmer 1.6s infinite; pointer-events:none;
}
@keyframes bookShimmer{ 100%{ transform:translateX(100%) } }

.book__loader__row{
  width:100%; display:flex; align-items:center; gap:10px;
  max-width:540px;
}
.book__loader__bar{
  flex:1 1 auto; height:6px; border-radius:999px; background:#e9ecef; position:relative; overflow:hidden;
}
.book__loader__bar::after{
  content:""; position:absolute; inset:0; width:40%; border-radius:inherit; background:#cdeee3;
  animation:bookIndeterminate 1.1s ease-in-out infinite;
}
@keyframes bookIndeterminate{
  0%{ left:-40% } 50%{ left:30%; width:50% } 100%{ left:100% }
}
.book__loader__text{ font-size:12px; color:#666; white-space:nowrap }

.book__error__title{ font-weight:800; color:#222 }
.book__error__sub{ font-size:12px; color:#666; margin-bottom:6px }

/* Enhanced styling for order prompt */
.book__error__sub ul {
  list-style: none;
  padding: 0;
}

.book__error__sub ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid #f0f0f0;
}

.book__error__sub ul li:last-child {
  border-bottom: none;
}

.book__error .btn--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 0.875rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.book__error .btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* ------ Responsive ------------------------------------------------------ */
@media (max-width:1100px){
  .designer{ grid-template-columns:1fr }             /* stack: stage then sidebar, hide progress */
  .designer__sidebar{ position:relative; top:auto }
  .designer__progress{ display: none; }              /* hide progress column on tablet/mobile */
}

/* Mobile: Full width book preview and layout adjustments */
@media (max-width: 768px) {
  .designer {
    padding: 0 !important;
    gap: 0 !important;
    height: auto !important;
  }
  
  .designer__stage {
    margin: 0 !important;
    padding: 12px !important;
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }
  
  .stage__preview-area {
    width: 100% !important;
  }
  
  .book {
    width: 100% !important;
    padding: 0 !important;
  }
  
  .book__device {
    width: 100% !important;
    max-width: none !important;
    border-radius: 8px !important;
  }
}

/* Accessibility: reduce motion */
@media (prefers-reduced-motion: reduce){
  .book__skeleton__shimmer,
  .book__loader__bar::after{ animation: none }
}

/* ------ Checkout Styles ------------------------------------------------ */

/* Binding List Layout (Row-based) */
.binding-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.binding-option {
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.binding-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.binding-card {
  border: 2px solid var(--soft-2);
  border-radius: 12px;
  background: #fff;
  padding: 12px 16px;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  min-height: 90px;
  position: relative;
  overflow: hidden;
}

.binding-option:hover .binding-card {
  border-color: var(--focus);
  background: rgba(25, 156, 120, 0.02);
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Selected state for the binding option */
.binding-option:has(input[type="radio"]:checked) .binding-card {
  border-color: var(--focus);
  background: rgba(25, 156, 120, 0.05);
  box-shadow: 0 0 0 3px rgba(25, 156, 120, 0.1);
  transform: translateX(4px);
}

.binding-option:has(input[type="radio"]:checked) .binding-name {
  color: var(--focus);
}

.binding-option:has(input[type="radio"]:checked) .binding-type-image {
  transform: scale(1.1);
  filter: brightness(1.1) saturate(1.2);
}

/* Fallback for browsers that don't support :has() */
.binding-option input[type="radio"]:checked + .binding-card {
  border-color: var(--focus);
  background: rgba(25, 156, 120, 0.05);
  box-shadow: 0 0 0 3px rgba(25, 156, 120, 0.1);
}

.binding-image {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 80px;
  height: 80px;
  flex-shrink: 0;
}

.binding-type-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.binding-option:hover .binding-type-image {
  transform: scale(1.05);
}

.binding-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  flex: 1;
  min-width: 0; /* Allow text to wrap */
}

.binding-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.binding-header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.binding-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--ink);
  text-transform: capitalize;
  transition: color 0.2s ease;
  white-space: nowrap;
}

.binding-description {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
}

.binding-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.binding-badge--premium {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #fff;
}

.binding-badge--popular {
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: #fff;
}

.binding-price-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  padding-left: 12px;
}

.binding-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--focus);
  white-space: nowrap;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .binding-card {
    padding: 10px 12px;
    gap: 10px;
  }

  .binding-image {
    width: 60px;
    height: 60px;
  }

  .binding-name {
    font-size: 14px;
  }

  .binding-description {
    font-size: 11px;
  }

  .binding-badge {
    font-size: 9px;
    padding: 2px 6px;
  }

  .binding-price {
    font-size: 16px;
  }

  .binding-price-wrapper {
    padding-left: 8px;
  }
}

/* Price Summary */
.price-summary {
  background: var(--panel-2);
  border: 1px solid var(--soft-2);
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
}

.price-line span:first-child {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.price-amount {
  color: var(--focus);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.price-note {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  text-align: center;
  opacity: 0.8;
}

/* Legacy price row styles (keep for compatibility) */
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0;
}

.price-row.total {
  border-top: 1px solid var(--soft-2);
  padding-top: 12px;
  margin-top: 12px;
  font-weight: 700;
  font-size: 16px;
}

.price-label {
  color: var(--ink);
  font-size: 14px;
}

.price-value {
  color: var(--focus);
  font-weight: 600;
}

/* Checkout Section */
.checkout-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-2);
}

/* Checkout Button States */
.btn--checkout {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  margin-top: 16px;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.btn--checkout:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn--checkout:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(25, 156, 120, 0.3);
}

.checkout-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: checkoutSpin 1s linear infinite;
}

@keyframes checkoutSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.checkout-status {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
}

.checkout-status.success {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.2);
  color: #059669;
}

.checkout-status.error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #dc2626;
}

.checkout-status.processing {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #2563eb;
}

/* Hidden state for checkout elements */
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------------------
  UI Enhancement Styles - Added for better UX
  ------------------------------------------------------------------------ */

/* Welcome Section */
.welcome-section {
  margin-bottom: 32px;
  padding: 24px;
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.05) 0%, rgba(25, 156, 120, 0.02) 100%);
  border-radius: 12px;
  border: 1px solid var(--soft-2);
}

.welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.welcome-description {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* Field Descriptions */
.field-description {
  font-size: 13px;
  color: var(--muted);
  margin: 6px 0 12px 0;
  line-height: 1.5;
}

/* Tooltips */
.tooltip-trigger {
  display: inline-flex;
  align-items: center;
  margin-left: 4px;
  color: var(--muted);
  cursor: help;
  transition: color 0.2s ease;
  vertical-align: middle;
}

.tooltip-trigger:hover {
  color: var(--focus);
}

.tooltip-trigger svg {
  width: 14px;
  height: 14px;
}

/* Binding Badges */
.binding-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.binding-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  line-height: 1.4;
}

.binding-badge--premium {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  color: #663300;
  box-shadow: 0 1px 3px rgba(255, 215, 0, 0.3);
}

.binding-badge--popular {
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.15) 0%, rgba(25, 156, 120, 0.25) 100%);
  color: var(--focus);
  border: 1px solid var(--focus);
}

/* Binding Description */
.binding-description {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 6px 0;
  line-height: 1.4;
}

/* Enhanced Binding Grid for Better Visual Hierarchy */
.binding-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin: 16px 0;
}

/* Responsive: Single column on mobile */
@media (max-width: 768px) {
  .binding-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

/* Enhanced hover effects for binding cards */
.binding-option:hover .binding-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.02) 0%, rgba(25, 156, 120, 0.05) 100%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.binding-option:hover .binding-card::before {
  opacity: 1;
}

/* Binding Info Layout */
.binding-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  transition: color 0.2s ease;
}

.binding-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-transform: capitalize;
  letter-spacing: -0.01em;
}

.binding-price {
  font-size: 18px;
  font-weight: 800;
  color: var(--focus);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

/* Disclosure Badge */
.disclosure-badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 4px;
  background: var(--soft);
  color: var(--muted);
  margin-left: 8px;
}

/* View Preview Link (Mobile) */
.view-preview-link {
  display: none; /* Hidden by default, shown on mobile */
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  margin: 16px 0;
  color: #16a34a;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.view-preview-link:hover {
  color: #15803d;
  gap: 8px;
}

.view-preview-link svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  transition: transform 0.2s ease;
}

.view-preview-link:hover svg {
  transform: translateY(-2px);
}

/* Completion Message */
.completion-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(25, 156, 120, 0.08) 0%, rgba(25, 156, 120, 0.04) 100%);
  border-radius: 10px;
  margin-bottom: 16px;
  border: 1px solid rgba(25, 156, 120, 0.2);
}

.completion-message svg {
  width: 20px;
  height: 20px;
  color: var(--focus);
  flex-shrink: 0;
}

.completion-message span {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

/* Enhanced Primary Button */
.btn--large {
  padding: 16px 24px;
  font-size: 16px;
  font-weight: 700;
  gap: 10px;
}

.btn--primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--focus) 0%, #148564 100%);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(25, 156, 120, 0.2);
  width: 100%;
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(25, 156, 120, 0.35);
  background: linear-gradient(135deg, #1aab8a 0%, #106d4f 100%);
}

.btn--primary:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(25, 156, 120, 0.2);
}

/* Enhanced Hints */
.hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

/* Input Field Enhancements */
.input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--soft-2);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.2s ease;
  background: #fff;
}

.input:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(25, 156, 120, 0.1);
  background: #fff;
}

.input:hover:not(:focus) {
  border-color: #c5c5c5;
}

/* Label Enhancements */
.label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 8px;
}

.label svg {
  color: var(--focus);
  flex-shrink: 0;
}

/* Field Spacing */
.field {
  margin-bottom: 28px;
}

.field:last-child {
  margin-bottom: 0;
}

/* Cover Options Grid Enhancement */
.covers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.cover-option {
  position: relative;
  aspect-ratio: 1;
  border: 3px solid var(--soft-2);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: var(--soft);
}

.cover-option:hover {
  border-color: var(--focus);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.cover-option[aria-selected="true"] {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(25, 156, 120, 0.2), 0 4px 12px rgba(0,0,0,0.1);
  transform: translateY(-2px);
}

.cover-option[aria-selected="true"]::after {
  content: '✓';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  background: var(--focus);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cover-option img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.cover-option:hover img {
  transform: scale(1.1);
}

/* ------------------------------------------------------------------------
  Pricing Summary Section
  ------------------------------------------------------------------------ */
.pricing-summary-section {
  margin: 32px 0 16px;
  padding: 24px 0 16px;
  border-top: 2px solid var(--soft-2);
}

.price-breakdown {
  background: var(--panel);
  border: 1px solid var(--soft-2);
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  color: var(--ink);
}

.price-row:not(:last-child) {
  border-bottom: 1px solid var(--soft-2);
}

.price-row--total {
  padding-top: 12px;
  margin-top: 4px;
  font-size: 16px;
}

.price-row span:first-child {
  color: var(--muted);
}

.price-row--total span:first-child {
  color: var(--ink);
}

.price-row span:last-child {
  font-weight: 600;
  color: var(--ink);
}

/* (product listing styles moved to catalog.css) */
