/* ============================================================
   Still Beside Me – Customizer Layout & Components
   ============================================================ */

/* --- Split-Pane Layout --- */
.customizer {
  display: flex;
  min-height: calc(100vh - 57px);
}

.preview-pane {
  flex: 0 0 58%;
  background: #1a1714;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
  gap: var(--space-lg);
  /* Stick to viewport while form scrolls */
  position: sticky;
  top: 57px;
  height: calc(100vh - 57px);
  /* Subtle wall texture */
  background:
    radial-gradient(ellipse at 50% 40%, rgba(60, 50, 40, 0.3) 0%, transparent 70%),
    #1a1714;
}

.form-pane {
  flex: 0 0 42%;
  background: var(--color-surface);
  padding: var(--space-2xl) var(--space-xl);
  border-left: 1px solid var(--color-border);
}

/* ============================================================
   CSS FRAME RENDERING – Matted frame around canvas panels
   ============================================================ */

.frame-preview {
  --frame-width: 18px;
  --mat-padding: 22px;
  --panel-gap: 3px;
  max-width: 480px;
  width: 100%;
  border-radius: 2px;
  position: relative;
}

/* Glass reflection – subtle diagonal shine across the entire framed piece */
.frame-preview::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 20;
  border-radius: 2px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.02) 30%,
    transparent 55%,
    transparent 80%,
    rgba(255, 255, 255, 0.015) 100%
  );
}

.frame-preview .frame-border {
  padding: var(--frame-width);
  border-radius: 2px;
  position: relative;
}

.frame-preview .mat-board {
  padding: var(--mat-padding);
}

.preview-panels {
  display: grid;
  gap: var(--panel-gap);
  position: relative;
  /* Default 2-panel side-by-side (JS overrides via inline styles) */
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr;
  grid-template-areas: "photo tribute";
  aspect-ratio: 5 / 3.2;
}

.panel {
  overflow: hidden;
  position: relative;
  min-width: 0;
  min-height: 0;
}

.panel-photo { grid-area: photo; }
.panel-tribute { grid-area: tribute; }
.panel-panel2 { grid-area: panel2; }

/* Single mat-opening bevel – one continuous 45-degree cut around the entire print.
   Real WHCC mats have a single opening; the composite print shows through it. */
.preview-panels::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
  /* Top/left darker (shadow side), bottom/right lighter (mat core catching light) */
  border-top: 3px solid rgba(0, 0, 0, 0.45);
  border-left: 3px solid rgba(0, 0, 0, 0.3);
  border-bottom: 3px solid rgba(200, 185, 155, 0.35);
  border-right: 3px solid rgba(200, 185, 155, 0.25);
  box-shadow:
    inset 0 6px 14px -4px rgba(0, 0, 0, 0.35),
    inset 5px 0 10px -4px rgba(0, 0, 0, 0.18),
    inset 0 -5px 10px -4px rgba(200, 185, 155, 0.12),
    inset -4px 0 8px -4px rgba(200, 185, 155, 0.06);
}

.panel canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* ============================================================
   DIVIDER HANDLES – Draggable resize between panels
   ============================================================ */

.divider-handle {
  position: absolute;
  z-index: 10;
  background: transparent;
}

.divider-handle.col {
  cursor: col-resize;
  width: 12px;
  top: 0;
  bottom: 0;
  margin-left: -6px;
}

.divider-handle.row {
  cursor: row-resize;
  height: 12px;
  left: 0;
  right: 0;
  margin-top: -6px;
}

/* Gold line on hover */
.divider-handle::after {
  content: '';
  position: absolute;
  background: rgba(200, 160, 80, 0);
  transition: background 0.15s;
  border-radius: 1px;
}

.divider-handle.col::after {
  width: 2px;
  top: 10%;
  bottom: 10%;
  left: 50%;
  margin-left: -1px;
}

.divider-handle.row::after {
  height: 2px;
  left: 10%;
  right: 10%;
  top: 50%;
  margin-top: -1px;
}

.divider-handle:hover::after {
  background: rgba(200, 160, 80, 0.6);
}

.divider-handle.dragging::after {
  background: rgba(200, 160, 80, 0.9);
}

/* ============================================================
   THIRD PANEL CONTROLS
   ============================================================ */

.add-panel-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  font-size: 0.75rem;
  font-family: var(--font-body);
  font-weight: 600;
  color: #9B9590;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.add-panel-btn:hover {
  color: var(--color-warm);
  border-color: rgba(200, 160, 80, 0.3);
  background: rgba(200, 160, 80, 0.08);
}

.add-panel-btn .icon {
  font-size: 0.9rem;
}

/* ============================================================
   LAYOUT ICON THUMBNAILS – CSS Grid mini-layouts
   ============================================================ */

/* 3-panel layout icons use CSS Grid */
.layout-option-grid {
  display: grid;
  gap: 1px;
  padding: 4px;
}

.layout-option-grid .layout-icon-block {
  border-radius: 1px;
  min-height: 0;
  min-width: 0;
}

/* Photo blocks */
.layout-option-grid .layout-icon-photo {
  background: rgba(255, 255, 255, 0.25);
}

/* Tribute blocks */
.layout-option-grid .layout-icon-tribute {
  background: rgba(196, 168, 130, 0.35);
}

/* Panel2 blocks */
.layout-option-grid .layout-icon-panel2 {
  background: rgba(255, 255, 255, 0.15);
}

/* --- Classic Dark Theme --- */
.frame-preview.theme-classic-dark .frame-border {
  background: linear-gradient(145deg, #2c2018, #3a2a1c 15%, #1e1610 40%, #2a1e14 70%, #1a120c);
  box-shadow:
    /* Wall-mount depth – frame floats on the wall */
    0 10px 45px rgba(0, 0, 0, 0.55),
    0 3px 15px rgba(0, 0, 0, 0.35),
    /* Top/left edge catching light */
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    inset 1px 0 0 rgba(255, 255, 255, 0.05),
    /* Bottom/right inner depth */
    inset 0 -1px 0 rgba(0, 0, 0, 0.4),
    inset -1px 0 0 rgba(0, 0, 0, 0.2);
}
.frame-preview.theme-classic-dark .mat-board {
  background: #0a0908;
  border: 1px solid #181410;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.5),
    inset 0 -1px 0 rgba(255, 255, 255, 0.03);
}
.frame-preview.theme-classic-dark .preview-panels {
  background: #0a0908;
}

/* --- Warm Natural Theme --- */
.frame-preview.theme-warm-natural .frame-border {
  background: linear-gradient(145deg, #b8956a, #c9a87c 15%, #a0804f 40%, #c4a06d 70%, #96783f);
  box-shadow:
    0 10px 45px rgba(0, 0, 0, 0.3),
    0 3px 15px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 1px 0 0 rgba(255, 255, 255, 0.1),
    inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    inset -1px 0 0 rgba(0, 0, 0, 0.1);
}
.frame-preview.theme-warm-natural .mat-board {
  background: #F5EDE0;
  border: 1px solid #E0D8CC;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.12),
    inset 0 -1px 0 rgba(255, 255, 255, 0.5);
}
.frame-preview.theme-warm-natural .preview-panels {
  background: #E8DDD0;
}
/* Warm mat-opening bevel – cream mat with white core */
.frame-preview.theme-warm-natural .preview-panels::before {
  border-top-color: rgba(0, 0, 0, 0.12);
  border-left-color: rgba(0, 0, 0, 0.08);
  border-bottom-color: rgba(255, 255, 255, 0.55);
  border-right-color: rgba(255, 255, 255, 0.4);
  box-shadow:
    inset 0 6px 12px -4px rgba(0, 0, 0, 0.1),
    inset 5px 0 10px -4px rgba(0, 0, 0, 0.05),
    inset 0 -5px 10px -4px rgba(255, 255, 255, 0.35),
    inset -4px 0 8px -4px rgba(255, 255, 255, 0.18);
}

/* --- Soft Light Theme --- */
.frame-preview.theme-soft-light .frame-border {
  background: linear-gradient(145deg, #e8e4e0, #f0ece8 15%, #d8d4d0 40%, #ece8e4 70%, #d0ccc8);
  box-shadow:
    0 10px 45px rgba(0, 0, 0, 0.14),
    0 3px 15px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 1px 0 0 rgba(255, 255, 255, 0.3),
    inset 0 -1px 0 rgba(0, 0, 0, 0.1),
    inset -1px 0 0 rgba(0, 0, 0, 0.04);
}
.frame-preview.theme-soft-light .mat-board {
  background: #FFFFFF;
  border: 1px solid #ebe8e4;
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.05),
    inset 0 -1px 0 rgba(255, 255, 255, 0.8);
}
.frame-preview.theme-soft-light .preview-panels {
  background: #EDEBE8;
}
/* Light mat-opening bevel – white mat, ultra-subtle */
.frame-preview.theme-soft-light .preview-panels::before {
  border-top-color: rgba(0, 0, 0, 0.07);
  border-left-color: rgba(0, 0, 0, 0.04);
  border-bottom-color: rgba(255, 255, 255, 0.7);
  border-right-color: rgba(255, 255, 255, 0.5);
  box-shadow:
    inset 0 6px 12px -4px rgba(0, 0, 0, 0.05),
    inset 5px 0 10px -4px rgba(0, 0, 0, 0.025),
    inset 0 -5px 10px -4px rgba(255, 255, 255, 0.4),
    inset -4px 0 8px -4px rgba(255, 255, 255, 0.2);
}

/* ============================================================
   STYLE VARIANT SELECTOR – 3 clickable frame thumbnails
   ============================================================ */

/* ============================================================
   LAYOUT SELECTOR – Horizontal vs Vertical toggle
   ============================================================ */

.layout-selector {
  display: flex;
  gap: var(--space-sm);
  justify-content: center;
  margin-bottom: var(--space-md);
}

.layout-option {
  width: 48px;
  height: 38px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
  gap: 2px;
}

.layout-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.layout-option.active {
  border-color: var(--color-warm);
}

/* Horizontal icon – two side-by-side boxes */
.layout-option-horizontal .layout-icon-block {
  flex: 1;
  height: 100%;
  border-radius: 2px;
}

.layout-option-horizontal .layout-icon-block:first-child {
  background: rgba(255, 255, 255, 0.25);
}

.layout-option-horizontal .layout-icon-block:last-child {
  background: rgba(196, 168, 130, 0.35);
}

/* Vertical icon – two stacked boxes */
.layout-option-vertical {
  flex-direction: column;
}

.layout-option-vertical .layout-icon-block {
  width: 100%;
  flex: 1;
  border-radius: 2px;
}

.layout-option-vertical .layout-icon-block:first-child {
  background: rgba(255, 255, 255, 0.25);
}

.layout-option-vertical .layout-icon-block:last-child {
  background: rgba(196, 168, 130, 0.35);
}

.layout-label {
  font-size: 0.6rem;
  color: #9B9590;
  text-align: center;
  margin-top: 2px;
}

/* ============================================================
   STYLE VARIANT SELECTOR
   ============================================================ */

.style-selector {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
}

.style-thumb {
  width: 64px;
  height: 50px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.style-thumb:hover {
  transform: scale(1.05);
}

.style-thumb.active {
  border-color: var(--color-warm);
}

.style-thumb-inner {
  width: 52px;
  height: 38px;
  border-radius: 2px;
  overflow: hidden;
}

/* Thumb: Classic Dark */
.style-thumb-dark .style-thumb-inner {
  background: linear-gradient(145deg, #2c2018, #1a120c);
  display: flex;
  padding: 3px;
}
.style-thumb-dark .style-thumb-inner::before {
  content: '';
  flex: 1;
  background: #1a1a1a;
  margin: 2px;
}

/* Thumb: Warm Natural */
.style-thumb-warm .style-thumb-inner {
  background: linear-gradient(145deg, #b8956a, #96783f);
  display: flex;
  padding: 3px;
}
.style-thumb-warm .style-thumb-inner::before {
  content: '';
  flex: 1;
  background: #F5EDE0;
  margin: 2px;
}

/* Thumb: Soft Light */
.style-thumb-light .style-thumb-inner {
  background: linear-gradient(145deg, #e8e4e0, #d0ccc8);
  display: flex;
  padding: 3px;
}
.style-thumb-light .style-thumb-inner::before {
  content: '';
  flex: 1;
  background: #FFFFFF;
  margin: 2px;
}

.style-thumb-label {
  position: absolute;
  bottom: -16px;
  font-size: 0.6rem;
  color: #9B9590;
  white-space: nowrap;
  letter-spacing: 0.02em;
}

/* ============================================================
   UPLOAD ZONE
   ============================================================ */

.upload-zone {
  border: 2px dashed var(--color-border);
  border-radius: var(--radius);
  padding: var(--space-2xl) var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--color-bg);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--color-warm);
  background: rgba(196, 168, 130, 0.04);
}

.upload-zone-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.upload-zone-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.upload-zone-hint {
  font-size: 0.85rem;
  color: var(--color-muted);
}

.upload-zone input[type="file"] {
  display: none;
}

/* Uploaded photo preview */
.upload-preview {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.upload-preview img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.upload-preview-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-sm) var(--space-md);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.upload-replace-btn {
  font-size: 0.8rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.quality-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 600;
}
.quality-badge.excellent { background: var(--color-success); color: #fff; }
.quality-badge.good { background: var(--color-secondary); color: #fff; }
.quality-badge.usable { background: var(--color-warm); color: #fff; }
.quality-badge.low { background: var(--color-error); color: #fff; }

.quality-message {
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-top: var(--space-sm);
  font-style: italic;
}

.photo-assurance {
  font-size: 0.8rem;
  color: var(--color-warm);
  margin-top: var(--space-sm);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.crop-hint {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: var(--space-sm);
  text-align: center;
  font-style: italic;
}

/* ============================================================
   FORM FIELDS – Guided emotional flow
   ============================================================ */

.form-section {
  margin-bottom: var(--space-2xl);
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

.form-intro {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  text-align: center;
  padding: var(--space-md) 0 var(--space-lg);
  line-height: 1.4;
}

.form-intro span {
  color: var(--color-muted);
  font-size: 1rem;
  display: block;
  margin-top: var(--space-sm);
}

/* --- Gift / Self toggle --- */
.order-type-toggle {
  display: flex;
  gap: 0;
  margin-bottom: var(--space-2xl);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.order-type-option {
  flex: 1;
  padding: 0.75rem 1rem;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-muted);
  background: var(--color-bg);
  border: none;
  transition: all 0.2s;
}

.order-type-option:first-child {
  border-right: 1px solid var(--color-border);
}

.order-type-option.active {
  background: var(--color-warm);
  color: #fff;
}

.order-type-option:not(.active):hover {
  background: rgba(196, 168, 130, 0.08);
  color: var(--color-primary);
}

.order-type-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: calc(-1 * var(--space-lg));
  margin-bottom: var(--space-xl);
  font-style: italic;
}

.field-group {
  margin-bottom: var(--space-xl);
}

.field-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: var(--space-xs);
  color: var(--color-primary);
}

.field-group .sublabel {
  display: block;
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--color-muted);
  margin-bottom: var(--space-sm);
}

.field-group input[type="text"],
.field-group textarea,
.field-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-primary);
  background: var(--color-bg);
  transition: border-color 0.2s;
}

.field-group input:focus,
.field-group textarea:focus,
.field-group select:focus {
  outline: none;
  border-color: var(--color-warm);
  box-shadow: 0 0 0 3px rgba(196, 168, 130, 0.15);
}

.field-group textarea {
  resize: vertical;
  min-height: 80px;
}

.char-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  text-align: right;
  margin-top: var(--space-xs);
}

.field-error {
  font-size: 0.85rem;
  color: var(--color-error);
  margin-top: var(--space-xs);
}

/* ============================================================
   POEM GENERATION – The climax moment
   ============================================================ */

.poem-climax {
  text-align: center;
  padding: var(--space-xl) 0;
}

.poem-climax h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-primary);
  margin-bottom: var(--space-lg);
}

.poem-generate-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  background: var(--color-warm);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.poem-generate-btn:hover {
  background: #b89a74;
}

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

.poem-result {
  margin-top: var(--space-xl);
  padding: var(--space-xl);
  background: var(--color-bg);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
}

.poem-result-text {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-primary);
  white-space: pre-line;
  text-align: center;
  margin-bottom: var(--space-lg);
}

.poem-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.poem-actions button {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 600;
  transition: all 0.2s;
}

.poem-regenerate-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}
.poem-regenerate-btn:hover {
  border-color: var(--color-warm);
  color: var(--color-warm);
}

.poem-edit-btn {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-primary);
}

.poem-edit-textarea {
  width: 100%;
  min-height: 180px;
  padding: 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-display);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--color-primary);
  resize: vertical;
  margin-bottom: var(--space-md);
}

.poem-library-link {
  color: var(--color-muted);
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  border: none;
  background: none;
  font-family: var(--font-body);
}

/* Poem library modal */
.poem-library-panel {
  margin-top: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.poem-library-panel select {
  width: 100%;
  padding: 0.75rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-body);
  font-size: 1rem;
}

.poem-library-preview {
  padding: var(--space-md);
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--color-muted);
  white-space: pre-line;
  max-height: 200px;
  overflow-y: auto;
}

.regen-count {
  font-size: 0.8rem;
  color: var(--color-muted);
  margin-top: var(--space-sm);
}

/* --- Poem version tabs --- */
.poem-version-tabs {
  display: flex;
  gap: var(--space-xs);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.poem-version-tab {
  padding: 0.35rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: 20px;
  background: transparent;
  color: var(--color-muted);
  cursor: pointer;
  transition: all 0.2s;
}

.poem-version-tab:hover {
  border-color: var(--color-warm);
  color: var(--color-warm);
}

.poem-version-tab.active {
  background: var(--color-warm);
  border-color: var(--color-warm);
  color: #fff;
}

/* --- Gift-mode detail note --- */
.gift-detail-note {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-style: italic;
  text-align: center;
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-lg);
  background: rgba(196, 168, 130, 0.06);
  border-radius: var(--radius);
  border: 1px solid rgba(196, 168, 130, 0.12);
}

/* --- Animated poem reveal --- */
.poem-generating {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.poem-generating-text {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--color-muted);
  margin-bottom: var(--space-lg);
}

.poem-generating-dots {
  display: inline-flex;
  gap: 6px;
}

.poem-generating-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-warm);
  animation: poemDotPulse 1.4s ease-in-out infinite;
}

.poem-generating-dots span:nth-child(2) { animation-delay: 0.2s; }
.poem-generating-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes poemDotPulse {
  0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}

.poem-result-text .poem-line {
  display: block;
  opacity: 0;
  transform: translateY(8px);
  animation: poemLineReveal 0.6s ease forwards;
}

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

/* ============================================================
   PRODUCT SELECTOR
   ============================================================ */

.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.product-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.product-option:hover {
  border-color: var(--color-warm);
}

.product-option.selected {
  border-color: var(--color-warm);
  background: rgba(196, 168, 130, 0.05);
}

.product-option-label {
  font-weight: 600;
}

.product-option-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  background: var(--color-warm);
  color: #fff;
  border-radius: 4px;
  margin-left: var(--space-sm);
}

.product-option-price {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary);
}

/* ============================================================
   CART ACTION
   ============================================================ */

.cart-action {
  padding: var(--space-xl) 0;
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-xl);
}

.cart-action .btn {
  width: 100%;
}

/* ============================================================
   MOBILE: Stacked layout with sticky preview
   ============================================================ */

@media (max-width: 1024px) {
  .customizer {
    flex-direction: column;
  }

  .preview-pane {
    flex: none;
    position: sticky;
    top: 0;
    height: auto;
    z-index: 10;
    padding: var(--space-md);
    max-height: 50vh;
  }

  .frame-preview {
    --frame-width: 12px;
    --mat-padding: 14px;
    max-width: 360px;
  }

  .form-pane {
    flex: 1;
    border-left: none;
    border-top: 1px solid var(--color-border);
    padding: var(--space-xl) var(--space-md);
  }

  .style-selector {
    gap: var(--space-sm);
  }

  .style-thumb {
    width: 48px;
    height: 38px;
  }

  .style-thumb-inner {
    width: 40px;
    height: 30px;
  }

  .style-thumb-label {
    display: none;
  }
}
