/** Shopify CDN: Minification failed

Line 219:0 All "@import" rules must come first
Line 3574:1 Expected "}" to go with "{"

**/
/* ==========================================
   📱 LETTER BUILDER MOBILE CSS - ORGANIZED
   Version: 2.0 - Cleaned & Optimized
   Last Updated: January 2025
   Note: This file only loads on screens 700px and below
   ========================================== */

/* ==========================================
   1. CORE VARIABLES & RESETS
   ========================================== */

:root {
  --heritage-forest: #14302A;
  --heritage-gold: #d4af37;
  --heritage-cream: #faf7f2;
  --heritage-sage: #f0f7f4;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.2s ease;
  
  /* Letter Sizing Defaults - Mobile */
  --letter-h3-size: 1.35rem;
  --letter-p-size: 0.92rem;
  --letter-line-height: 1.2;
  --letter-ps-size: 1.05rem;
  --letter-date-size: 1.1rem;
}

/* ==========================================
   MOBILE FONT SIZING SYSTEM (700px and below)
   ========================================== */

/* Individual Letter Mobile Sizing */
[data-letter-type="individual"] .letter-text-overlay.Block {
  --letter-h3-size: 1.35rem;
  --letter-p-size: 0.92rem;
  --letter-line-height: 1.2;
}

/* Individual Letter Fancy - INCREASED for most templates */
[data-letter-type="individual"] .letter-text-overlay.Fancy {
  --letter-h3-size: 28px;      /* Increased from 24px */
  --letter-p-size: 22px;       /* Increased from 18px */
  --letter-line-height: 1.0;   /* Tighter line spacing for more text */
  --letter-date-size: 1.3rem;
}

/* The Brave One Fancy - Keep smaller */
[data-letter-type="individual"][data-template="The Brave One"] .letter-text-overlay.Fancy {
  --letter-h3-size: 20px;      /* Smaller than others */
  --letter-p-size: 18px;       /* Original size for Brave One */
  --letter-line-height: 0.95;  /* Very tight spacing */
}

/* The Brave One - SMALLER on mobile Block */
[data-letter-type="individual"][data-template="The Brave One"] .letter-text-overlay.Block {
  --letter-p-size: 0.55rem;  /* Reduced from 0.65rem */
  --letter-h3-size: 1.1rem;   /* Reduced from 1.2rem */
  --letter-line-height: 1.1;  /* Tighter line spacing */
}

/* First Christmas Mobile */
[data-letter-type="first-christmas"] .letter-text-overlay.Block {
  --letter-h3-size: 0.65rem;
  --letter-p-size: 7px;
  --letter-line-height: 1.1;
}

[data-letter-type="first-christmas"] .letter-text-overlay.Fancy {
  --letter-h3-size: 1.25rem;  /* Updated to king size */
  --letter-p-size: 1.25rem;   /* Updated to king size */
  --letter-line-height: 1.0;
  --letter-date-size: 1.3rem;
}

/* Family Letter Mobile */
[data-letter-type="family"] .letter-text-overlay.Block {
  --letter-h3-size: 1.2rem;
  --letter-p-size: 0.85rem;
  --letter-line-height: 1.2;
}

[data-letter-type="family"] .letter-text-overlay.Fancy {
  --letter-h3-size: 1.3rem;
  --letter-p-size: 0.95rem;
  --letter-line-height: 1.05; /* Tight for Fancy */
}

/* Non-Believer Mobile */
[data-letter-type="non-believer"] .letter-text-overlay.Block {
  --letter-h3-size: 1.3rem;
  --letter-p-size: 0.9rem;
  --letter-line-height: 1.2;
}

/* Non-Believer Mobile */
[data-letter-type="non-believer"] .letter-text-overlay.Fancy {
  --letter-h3-size: 0.6rem; /* Reduced from 0.7rem */
  --letter-p-size: 0.55rem; /* Reduced from 0.65rem */
  --letter-line-height: 1.0; /* Tight for Fancy */
}

/* Family Backdated Mobile */
[data-letter-type="family-backdated"] .letter-text-overlay.Block {
  --letter-h3-size: 1.4rem;
  --letter-p-size: 1.0rem;
  --letter-line-height: 1.2;
}

[data-letter-type="family-backdated"] .letter-text-overlay.Fancy {
  --letter-h3-size: 1.3rem;
  --letter-p-size: 1.0rem;
  --letter-line-height: 1.05; /* Tight for Fancy */
}

/* Individual Backdated Mobile - Same as regular individual */
[data-letter-type="individual-backdated"] .letter-text-overlay.Block {
  --letter-h3-size: 1.35rem;
  --letter-p-size: 0.92rem;
  --letter-line-height: 1.2;
}

[data-letter-type="individual-backdated"] .letter-text-overlay.Fancy {
  --letter-h3-size: 22px;
  --letter-p-size: 16px;
  --letter-line-height: 1.05; /* Tight for Fancy */
  --letter-date-size: 1.3rem;
}

/* Write Your Own Mobile */
[data-letter-type="write-your-own"] .letter-text-overlay.Block {
  --letter-h3-size: 1.25rem;
  --letter-p-size: 0.9rem;
  --letter-line-height: 1.25;
}

[data-letter-type="write-your-own"] .letter-text-overlay.Fancy {
  --letter-h3-size: 1.2rem;
  --letter-p-size: 0.85rem;
  --letter-line-height: 1.15;
}

/* Write Your Own - Center content vertically on mobile too */
[data-letter-type="write-your-own"] .letter-content-inner {
  justify-content: center !important; /* Center instead of space-between */
  text-align: left;
}

[data-letter-type="write-your-own"] .dynamic-letter-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
}

/* ==========================================
   End Font sizing
   ========================================== */

/* Vertically center ALL letter content on mobile */
.letter-content-inner {
  display: flex;
  flex-direction: column;
  justify-content: center !important; /* Center vertically */
  align-items: stretch;
  height: 100%;
}

.dynamic-letter-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0; /* Don't grow, just center */
}


/* Global Reset */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--heritage-forest);
}

/* Body Lock States */
body.modal-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
}

/* Only lock body when canva-style-test is active AND modal is open */
body.modal-open:has(.canva-style-test) {
  height: 100vh !important;
}

/* ==========================================
   2. FONT IMPORTS & DEFINITIONS
   ========================================== */

@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600&family=Inter:wght@400;500;600&display=swap');

@font-face {
  font-family: 'FancyFont';
  src: url('/cdn/shop/files/FancyFont.woff?v=1746761729') format('woff');
  font-display: swap;
}

@font-face {
  font-family: 'BlockFont';
  src: url('/cdn/shop/files/BlockFont.woff?v=1746762239') format('woff');
  font-display: swap;
}

/* Fancy Font Letter Spacing Reset */
.envelope-name-preview,
.envelope-address-preview,
.letter-text-overlay.Fancy,
.letter-text-overlay.Fancy *,
.font-preview-text.Fancy {
  letter-spacing: normal !important;
}

/* ==========================================
   3. CONTAINER & LAYOUT
   ========================================== */

.letter-builder-container {
  background: var(--heritage-cream);
  padding: var(--space-lg) 0;
}

.canva-style-test {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
  padding: 0;
}

.container {
  padding: 0 var(--space-md);
}

.builder-layout {
  display: block;
}

/* Hide Desktop Elements */
.desktop-only,
.step-progress-bar,
.builder-subtitle,
.preview-column {
  display: none !important;
}

/* ==========================================
   4. MOBILE HEADER
   ========================================== */

.builder-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.builder-title {
  font-family: 'Crimson Text', serif;
  font-size: 22px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-sm);
  color: var(--heritage-forest);
  line-height: 1.2;
}

.mobile-header {
  text-align: center;
  margin-bottom: var(--space-md);
  margin-top: -12px;
  order: 2;
  position: relative;
  top: -8px;
}

.mobile-header h3 {
  font-family: 'Crimson Text', serif;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
  color: var(--heritage-forest);
}

.mobile-header p {
  font-size: 12px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================
   5. STEP NAVIGATION & ICON NAV
   ========================================== */

/* Hide old step dots */
.mobile-step-dots {
  display: none !important;
}

/* ==========================================
   5. STEP NAVIGATION & ICON NAV
   ========================================== */

/* Hide old step dots */
.mobile-step-dots {
  display: none !important;
}

/* Icon Step Navigation */
.icon-step-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 70px; /* Restored to 70px from 60px */
  background: white;
  border-top: 1px solid #e5e7eb;
  display: flex !important;
  justify-content: space-around;
  align-items: center;
  padding: 0 16px;
  z-index: 103;
}

/* Icon Step Container */
.icon-step {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  cursor: pointer !important;
  color: #6b7280;
  transition: all 0.2s ease;
  font-size: 10px;
  gap: 6px; /* Restored from 4px */
  padding: 6px 4px; /* Restored increased vertical padding */
  z-index: 2;
  opacity: 1 !important;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: transparent;
}

/* Icon Circle */
.icon-circle {
  width: 40px;
  height: 40px;
  border-radius: 50% !important;
  background: white;
  border: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  font-size: 0 !important;
  color: transparent !important;
}

.icon-circle::before {
  display: none !important;
  content: none !important;
}

/* SVG Icons */
.icon-circle svg {
  width: 18px !important;
  height: 18px !important;
  stroke: var(--heritage-forest) !important;
  stroke-width: 2 !important;
  fill: none !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Hide checkmarks by default, show step icons */
.icon-circle svg.check-icon {
  display: none !important;
}

.icon-circle svg.step-icon {
  display: block !important;
}

/* Active State - Green background immediately when on this step */
.icon-step.active .icon-circle {
  background: var(--heritage-forest) !important;
  border-color: var(--heritage-gold) !important;
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(14, 40, 20, 0.3);
}

.icon-step.active .icon-circle svg {
  stroke: white !important;
}

.icon-step.active .label {
  color: var(--heritage-forest);
  font-weight: 600;
}

/* Completed State - Previous steps that are done */
.icon-step.completed .icon-circle {
  background: var(--heritage-forest) !important;
  color: white;
  border-color: var(--heritage-forest);
  font-size: 18px;
  font-weight: 700;
}

.icon-step.completed .icon-circle svg.step-icon {
  display: none !important;
}

.icon-step.completed .icon-circle svg.check-icon {
  display: block !important;
  stroke: white !important;
}

.icon-step.completed .label {
  color: var(--heritage-forest);
  font-weight: 600;
}

/* Hover State (non-active) */
.icon-step:not(.active):hover .icon-circle {
  background: var(--heritage-cream);
  border-color: var(--heritage-gold);
  transform: scale(1.05);
}

/* Label */
.icon-step .label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: 500;
  color: #6b7280;
}

/* Error Indicator - Previous steps with missing fields */
.icon-step.has-errors::after {
  content: '';
  position: absolute;
  top: 8px;
  right: calc(50% - 22px);
  width: 8px;
  height: 8px;
  background: #dc2626;
  border-radius: 50%;
  border: 2px solid white;
  z-index: 10;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Step Management */
.builder-step {
  display: none;
  order: 3;
  animation: fadeIn 0.3s ease-out;
}

.builder-step.active {
  display: block;
}

/* ==========================================
   6. FORM ELEMENTS
   ========================================== */

.form-column {
  background: white;
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  padding-bottom: 10px !important;
}

.form-section {
  background: #f9fafb;
  border-radius: var(--radius-md);
  padding: 12px var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid #e5e7eb;
  order: 3;
  text-align: center;
}

.field-label {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
  display: block;
  color: var(--heritage-forest);
  text-align: center;
}

.form-section .field-label:first-child {
  margin-top: 0;
}

/* Form Controls */
.form-control {
  width: 100%;
  padding: 12px;
  font-size: 16px !important;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  background: white;
  color: var(--heritage-forest);
  font-family: 'Inter', sans-serif;
  -webkit-text-size-adjust: 100%;
  text-align: left;
  position: relative;
  z-index: 10;
  pointer-events: auto !important;
}

.form-control:focus {
  border-color: var(--heritage-gold);
  outline: none;
}

/* Textareas */
textarea.form-control {
  resize: vertical;
  min-height: 88px;
  text-align: left;
}

/* Fixed Height Textareas */
#childName.form-control,
#familyNames.form-control {
  resize: none;
  overflow: hidden;
  height: 80px !important;
  min-height: 80px !important;
  max-height: 80px !important;
  line-height: 1.4;
  overflow-y: auto;
  white-space: pre-wrap;
  padding: 12px;
  display: block;
  transition: none !important;
  text-align: left;
}

#childName.form-control:focus,
#familyNames.form-control:focus,
#childName[style*="height"],
#familyNames[style*="height"] {
  height: 80px !important;
  min-height: 80px !important;
  max-height: 80px !important;
}

/* Helper Text & Counters */
.helper-text {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
  text-align: center;
}

.char-counter {
  font-size: 10px;
  text-align: right;
  margin-top: 4px;
  color: var(--heritage-forest);
}

.char-counter.warning {
  color: #d97706;
}

.char-counter.error {
  color: #dc2626;
  font-weight: 600;
}

/* ==========================================
   7. COLOR & FONT SELECTION
   ========================================== */

/* Color Swatches */
.colour-swatches {
  display: flex;
  gap: var(--space-xl);
  margin-bottom: var(--space-sm);
  margin-top: calc(var(--space-lg) + 5px);
  padding-bottom: 30px;
  justify-content: center;
  position: relative;
}

.colour-swatch {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  margin-bottom: 0;
  box-shadow: 
    inset 0 2px 4px rgba(0,0,0,0.1),
    0 2px 8px rgba(0,0,0,0.1);
  z-index: 10;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.colour-swatch.selected {
  border-color: var(--heritage-gold);
  box-shadow: 
    0 0 0 4px rgba(212, 175, 55, 0.2),
    inset 0 2px 4px rgba(0,0,0,0.1);
}

.colour-swatch:hover:not(.selected) {
  box-shadow: 
    0 0 0 2px rgba(212, 175, 55, 0.1),
    0 4px 12px rgba(0,0,0,0.15);
}

/* Swatch Labels */
.colour-swatch::after {
  content: attr(title);
  position: absolute;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
  color: var(--heritage-forest);
  min-width: 120px;
  text-align: center;
  display: block;
  pointer-events: none;
}

/* Popular Badge */
.colour-swatch-badge {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--heritage-gold);
  color: var(--heritage-forest);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

/* Swatch Colors */
#redSwatch {
  background: linear-gradient(135deg, #7D2323, #5a1a1a);
}

#greenSwatch {
  background: linear-gradient(135deg, #3C5551, #2a3e3a);
}

/* Selection Cards & Font Cards */
.selection-grid,
.font-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
}

.selection-card,
.font-card {
  background: white;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 12px var(--space-md);
  text-align: center;
  cursor: pointer;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  transition: all var(--transition-normal);
}

.selection-card.active,
.font-card.active {
  border-color: var(--heritage-gold);
  background: rgba(212, 175, 55, 0.05);
}

.selection-preview {
  height: 40px;
  background: #f9fafb;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-xs);
  font-size: 0.95rem;  /* Increased from 0.8rem */
  font-weight: 700;     /* Increased from 600 */
  border: 1px solid #e5e7eb;
}

.selection-description {
  font-size: 11px;
  line-height: 1.2;
  color: #6b7280;
}

.font-card .selection-description {
  display: none;
}

/* Font Preview */
.font-preview-text {
  font-size: 1.8rem;
  color: var(--heritage-forest);
  font-weight: 600;
  line-height: .05;
  margin: 0;
}

.font-preview-text.Block {
  font-family: 'BlockFont', 'Times New Roman', serif;
  -webkit-text-stroke: 0.15px var(--heritage-forest);
}

.font-preview-text.Fancy {
  font-family: 'FancyFont', 'Brush Script MT', cursive;
  -webkit-text-stroke: 0.08px var(--heritage-forest);
  letter-spacing: normal !important;
}

/* Template Badge */
.template-badge {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--heritage-gold);
  color: var(--heritage-forest);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

/* ==========================================
   8. PREVIEW AREAS
   ========================================== */

.preview-column {
  background: var(--heritage-cream);
  padding: 0.25rem;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: auto;
}

.preview-area {
  width: 100%;
  min-height: 400px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

#letterPreview.preview-area {
  min-height: 600px;
  background: var(--heritage-cream);
  position: relative;
  overflow: hidden;
}

#envelopePreview.preview-area {
  min-height: 400px;
}

.preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm);
}

.envelope-bg-wrapper,
.letter-bg-wrapper {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 100%;
}

.preview-img {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
  object-fit: contain;
}

/* ==========================================
   9. TEXT OVERLAYS - ENVELOPE
   ========================================== */

.envelope-text-overlay {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  pointer-events: none;
  padding-top: 55%; /* Keep percentage for mobile responsiveness */
  z-index: 3;
}

.envelope-name-preview {
  font-family: 'FancyFont', 'Brush Script MT', cursive;
  color: #fff;
  font-size: 1.7rem !important; /* Scaled proportionally for mobile */
  text-align: center;
  line-height: 1.2;
  margin-bottom: .5rem; /* Changed to match desktop 16px */
  max-width: 70%; /* Match desktop width constraint */
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  white-space: pre-wrap;
  -webkit-text-stroke: 0.08px rgba(255,255,255,0.2);
}

.envelope-name-preview.has-two-lines {
  font-size: 1.7rem;
  line-height: 1.2;
}

.envelope-address-preview {
  font-family: 'FancyFont', 'Brush Script MT', cursive;
  color: #fff;
  font-size: 1.3rem !important; /* Scaled proportionally for mobile */
  text-align: center;
  line-height: 1.4; /* Match desktop line-height */
  width: 88%; /* Match desktop width constraint */
  white-space: pre-wrap;
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
  -webkit-text-stroke: 0.08px rgba(255,255,255,0.2);
}

/* Add this new rule for summary-specific positioning */
.canva-style-test #summaryPreview .preview-wrapper {
  margin-top: 20px; /* Adjust this - lower number = higher position */
}

/* ==========================================
   10. TEXT OVERLAYS - LETTER
   ========================================== */

.canva-style-test #letterPreview .preview-wrapper {
  margin-top: 40px;
}

/* Desktop Letter Text Layout */
.letter-text-overlay {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  height: 64%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  padding: 0;
  z-index: 3;
}

.letter-text-overlay.Block {
  font-family: 'BlockFont', 'Times New Roman', serif;
  -webkit-text-stroke: 0.15px #2d3748;
}

.letter-text-overlay.Fancy {
  font-family: 'FancyFont', 'Brush Script MT', cursive;
  -webkit-text-stroke: 0.08px #2d3748;
}

/* Letter Content Container */
.letter-content {
  position: relative;
  width: 86%; /* Reduced from 90% for more padding */
  max-width: 100%;
  text-align: left;
  padding-left: 0.25rem; /* Reduced from 0.5rem */
  padding-top: 0;
  height: 100%;
  overflow: hidden; /* Back to hidden - no scroll */
  display: flex;
  flex-direction: column;
}

.letter-content-inner {
  text-align: left;
  font-family: inherit;
  padding: 0 var(--space-xs);
  padding-bottom: 1rem; /* Increased from 0.5rem */
  max-width: 100%;
  height: 87%;
  display: flex;
  flex-direction: column;
  justify-content: center; /* CHANGED: Center content vertically */
  gap: var(--space-xs); /* Restored gap */
  overflow-y: auto;
  overflow-x: hidden;
  margin-top: 0;
  max-height: 100%;
  -webkit-overflow-scrolling: touch;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.letter-content-inner::-webkit-scrollbar {
  display: none;
}

/* Letter Typography Base - Now using CSS Variables */
.letter-content-inner h3 {
  font-family: inherit;
  font-size: var(--letter-h3-size, 1.35rem) !important;
  line-height: 1.15;
  margin-bottom: var(--space-sm);
  margin-top: 0;
  color: var(--heritage-forest);
  flex-shrink: 0;
}

.letter-content-inner p {
  font-family: inherit;
  font-size: var(--letter-p-size); /* Removed !important and fallback */
  line-height: var(--letter-line-height, 1.2);
  margin-bottom: var(--space-xs);
  color: #2d3748;
  text-align: left;
  text-shadow: none; /* Match desktop - no shadow */
}


/* Last paragraph should have no bottom margin */
.letter-content-inner p:last-child {
  margin-bottom: 0;
}

/* Make sure inline styles can override */
.letter-content-inner p[style] {
  /* Inline styles will now take precedence */
}

/* Add last paragraph padding */
.letter-content-inner p:last-child {
  padding-bottom: 0.25rem; /* Reduced from 0.5rem */
}



.letter-text-overlay.Fancy .letter-content-inner h3 {
  font-size: 1.18rem !important; /* Slightly reduced from original 1.2rem */
  line-height: 1.1;
}




/* Dynamic Font Sizing Classes - Balanced for mobile */
/* Dynamic Font Sizing Classes - REMOVED to let JavaScript handle sizing */
/* JavaScript will now handle all dynamic text sizing */

/* Add a helper class for very compressed text */
.letter-content-inner.text-compressed {
  /* Visual indicator that text has been heavily compressed */
  opacity: 0.95;
}

/* Personalized Text Highlight */
.personalized-text {
  display: inline;
  background: rgba(212, 175, 55, 0.18);
  padding: 0px;
  border-radius: 2px;
}

/* Date Display */
.letter-date-display {
  position: absolute;
  top: -1%;
  right: 10%; /* Matched desktop positioning */
  z-index: 20;
  pointer-events: none;
}

.letter-date-display span {
  font-size: 1.1rem !important;
  color: #2d3748; /* Updated to match desktop */
  text-shadow: none; /* Match desktop - no shadow */
}

.letter-text-overlay.Block .letter-date-display span {
  font-family: 'BlockFont', 'Times New Roman', serif !important;
  font-weight: normal;
  color: #2d3748;
  -webkit-text-stroke: 0.15px #2d3748;
  font-size: 1.1rem !important; /* Keep Block font at original size */
}

.letter-text-overlay.Fancy .letter-date-display span {
  font-family: 'FancyFont', 'Brush Script MT', cursive !important;
  font-weight: normal;
  color: #2d3748;
  -webkit-text-stroke: 0.08px #2d3748;
  font-size: 1.3rem !important; /* Increased size for Fancy font */
}

/* P.S. Display */
/* P.S. Display */
.letter-ps-display {
  position: absolute;
  top: 75%; /* Changed from bottom to top positioning */
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  z-index: 20;
  pointer-events: none;
  text-align: left;
}


/* Font-specific P.S. positioning adjustments */
.letter-text-overlay.Block ~ .letter-ps-display {
  bottom: 10%; /* Move Block font P.S. down more (was 15%) */
}

.letter-text-overlay.Fancy ~ .letter-ps-display {
  bottom: 13%; /* Move Fancy font P.S. down slightly (was 15%) */
}

.letter-ps-display p {
  margin: 0;
  font-size: 1.05rem !important; /* Slightly increased from 1.0rem */
  color: #2d3748; /* Updated to match desktop */
  line-height: 1.15; /* Slightly increased from 1.1 */
  text-shadow: none; /* Match desktop - no shadow */
}

.letter-ps-display.Block p {
  font-family: 'BlockFont', 'Times New Roman', serif !important;
  font-weight: normal;
  -webkit-text-stroke: 0.15px #2d3748;
}

.letter-ps-display.Fancy p {
  font-family: 'FancyFont', 'Brush Script MT', cursive !important;
  font-weight: normal;
  -webkit-text-stroke: 0.08px #2d3748;
  font-size: 1.15rem !important; /* Match your main Fancy font size */
  line-height: 1.05 !important; /* Match your tight line spacing */
  letter-spacing: -0.02em !important; /* Match your condensing */
}

/* ==========================================
   11. BUTTONS & NAVIGATION
   ========================================== */

/* Base Button Styles */

.btn {
  flex: 1;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  border: none;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: 'Inter', sans-serif;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  white-space: nowrap;
  transform-origin: center;
  will-change: transform;
  position: relative;
  z-index: 1001;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: rgba(0,0,0,0.1);
}

.navigation-buttons .btn {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navigation-buttons .btn:active {
  transform: scale(0.98);
}

/* Button Types */
.btn-primary,
.next-btn,
#nextBtn,
#addToCartBtn {
  background: var(--heritage-forest);
  color: white;
  order: 1;
}

.btn-outline,
.back-btn,
#backToDetails {
  background: white;
  border: 2px solid var(--heritage-forest);
  color: var(--heritage-forest);
  order: 2;
}

.btn-product-back {
  background: #f3f4f6;
  color: var(--heritage-forest);
  border: 1px solid #e5e7eb;
  max-width: 100px;
  flex: 0 0 auto;
}

.btn-product-back:hover {
  background: #e5e7eb;
}

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

/* Navigation Container */
.navigation-buttons {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-top: 1px solid #e5e7eb;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  padding: 12px 16px;
  display: flex;
  flex-direction: row;
  gap: 10px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navigation-buttons.step-1 .back-btn {
  display: none !important;
}

/* View Preview Button */
.view-preview-button {
  width: 100%;
  padding: 12px;
  margin-bottom: var(--space-md);
  background: transparent;
  border: 1px solid #e5e7eb;
  color: var(--heritage-forest);
  font-size: 10px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: var(--radius-md);
  transition: all var(--transition-normal);
  order: 98;
  display: block !important;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-align: center;
}

.view-preview-button:hover {
  background: #f9fafb;
  border-color: var(--heritage-forest);
}

/* Button States */
.btn.loading {
  position: relative;
  overflow: hidden;
  pointer-events: none;
}

.btn.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 20px;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  transform: translateY(-50%);
}

.btn.success {
  background: var(--heritage-gold);
  color: var(--heritage-forest);
}

.btn.edit-mode {
  background: #d97706;
}

/* ==========================================
   12. STEP 4 - SUMMARY & CONFIRMATION
   ========================================== */

   
/* Checkout Info Box - Mobile */
.checkout-info-box {
  background: linear-gradient(135deg, #f0f9f4 0%, #e8f5ee 100%);
  border: 1px solid rgba(15, 76, 58, 0.15);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.info-box-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.info-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.info-title {
  font-weight: 600;
  color: var(--heritage-forest);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.info-list li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: var(--space-sm);
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--heritage-forest);
  font-weight: 400;
}

.info-list li:last-child {
  margin-bottom: 0;
}

.info-list li:before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--heritage-gold);
  font-weight: 600;
  font-size: 0.875rem;
}

   
.summary-box {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  margin-bottom: var(--space-lg);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 1.25rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px dashed #e5e7eb;
  font-size: 14px;
}

.summary-label {
  font-size: 0.9375rem;
  font-weight: 500;
  flex-shrink: 0;
  max-width: 45%;
}

.summary-value {
  text-align: right;
  font-size: 0.9375rem;
  font-weight: 400;
  flex: 1;
  margin-left: 0.75rem;
}

/* Social Proof Section */
.social-proof-section {
  background: #fef7e5;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid #f4d078;
}

.social-proof-item {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-sm);
  font-size: 0.9375rem;
  gap: var(--space-sm);
}

.proof-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.proof-text {
  font-weight: 500;
  color: var(--heritage-forest);
}

.proof-value {
  font-weight: 700;
}

/* Confirmation Section */
.confirmation-section {
  background: white;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid #e5e7eb;
}

.confirmation-checkbox {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.confirmation-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: var(--heritage-forest);
  cursor: pointer;
  flex-shrink: 0;
}

.confirmation-checkbox label {
  font-family: 'Crimson Text', serif;
  font-size: 1.3rem;
  cursor: pointer;
  font-weight: 600;
  color: var(--heritage-forest);
}

/* Make "Use our example" link appear on new line */
.helper-text #useExampleAddress {
  display: block;
  margin-top: 6px;
  font-size: 12px;
}

/* Summary Preview */

/* Heritage Divider - Small Centered with Gradient */
.heritage-divider-small {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, 
    transparent, 
    var(--heritage-gold) 20%, 
    var(--heritage-gold) 80%, 
    transparent);
  margin: 10px auto 15px auto;
  opacity: 0.8;
  flex-shrink: 0;
}

/* Alternative style if you prefer dots */
.heritage-divider-small.dots {
  height: 4px;
  background: radial-gradient(circle, var(--heritage-gold) 2px, transparent 2px);
  background-size: 10px 4px;
  background-position: center;
  background-repeat: repeat-x;
}
#summaryPreview.preview-area {
  min-height: auto;
  background: var(--heritage-cream);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 15px;
  height: 100%;
  overflow: hidden;
}

.summary-preview-container {
  width: 90%;
  max-width: 320px;
  margin: 0 auto;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  border: 2px solid var(--heritage-gold);
  padding: 20px 15px;
  position: relative;
  height: calc(100% - 30px);
  max-height: calc(100% - 30px);
  overflow-y: scroll !important;
  -webkit-overflow-scrolling: auto !important;
  display: flex;
  flex-direction: column;
}

/* Force visible scrollbar */
.summary-preview-container {
  scrollbar-width: thin !important;
  scrollbar-color: var(--heritage-gold) #e5e7eb !important;
}

.summary-preview-container::-webkit-scrollbar {
  width: 14px !important;
  height: 14px !important;
  -webkit-appearance: none !important;
  background: transparent !important;
}

.summary-preview-container::-webkit-scrollbar-track {
  background: #e5e7eb !important;
  border-radius: 7px !important;
  margin: 10px 0 !important;
  border: 1px solid #d1d5db !important;
}

.summary-preview-container::-webkit-scrollbar-thumb {
  background: var(--heritage-gold) !important;
  border-radius: 7px !important;
  border: 2px solid white !important;
  box-shadow: inset 0 0 3px rgba(0,0,0,0.1) !important;
  min-height: 60px !important;
}

/* Visual scroll indicators */
.summary-preview-container {
  background-image: 
    linear-gradient(to bottom, white 20px, transparent 50px),
    linear-gradient(to top, white 20px, transparent 50px);
  background-position: top, bottom;
  background-size: 100% 50px, 100% 50px;
  background-repeat: no-repeat;
  background-attachment: local;
}

/* Inner content styling */
.summary-preview-container .summary-box {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
  overflow: visible;
  flex: 0 1 auto;
}

/* Receipt header */
.summary-preview-container .receipt-header {
  position: relative;
  background: white;
  z-index: 1;
  margin-bottom: 10px;
  padding-bottom: 10px;
  flex-shrink: 0;
}

/* Canva test specific positioning */
.canva-style-test #summaryPreview {
  height: calc(70vh - 40px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Summary Step Specific Constraints */
.canva-style-test .builder-step#step4 {
  max-height: calc(55vh - 60px); /* Account for form column padding */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 20px;
}

.summary-preview-container .summary-box {
  background: transparent;
  box-shadow: none;
  border: none;
  padding: 0;
}

.summary-preview-container .form-section {
  background: transparent;
  padding: 0;
  border: none;
  margin-bottom: 0;
}

.receipt-header {
  text-align: center;
  margin-bottom: 0;
  padding-bottom: 0;
}

.receipt-header h3 {
  font-family: 'Crimson Text', serif;
  color: var(--heritage-forest);
  font-size: 24px;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.receipt-header p {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}

/* ==========================================
   13. SPECIAL COMPONENTS
   ========================================== */

/* Example Chips */
.examples-section {
  margin-top: var(--space-md);
}

.examples-title {
  font-family: 'Crimson Text', serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--heritage-forest);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.example-chip {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  padding: var(--space-sm) var(--space-md);
  font-size: 0.90rem;
  font-weight: 400;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.example-chip:hover {
  background: rgba(212, 175, 55, 0.1);
  border-color: var(--heritage-gold);
}

/* Edit Mode Indicator */
.edit-mode-indicator {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.edit-mode-icon {
  width: 20px;
  height: 20px;
  background: #d97706;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 12px;
}

.edit-mode-content h3 {
  font-family: 'Crimson Text', serif;
  font-size: 14px;
  font-weight: 600;
  color: #92400e;
  margin-bottom: 0;
}

.edit-mode-content p {
  font-size: 11px;
  color: #a16207;
  line-height: 1.2;
  margin: 0;
}

.edit-mode-cancel {
  background: white;
  border: 1px solid #d97706;
  color: #d97706;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  margin: 4px auto 0;
}

/* ==========================================
   14. MAGIC ADDRESS HELPER
   ========================================== */

.smart-address-helper {
  margin: 20px -10px 24px -10px;
  display: none !important;
}

.magic-fill-btn {
  background: rgba(250, 247, 242, 0.5);
  border: 2px dashed var(--heritage-gold);
  color: var(--heritage-forest);
  padding: 18px 28px;
  border-radius: 35px;
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  width: 100%;
  transition: all var(--transition-normal);
  letter-spacing: 0.5px;
}

.magic-fill-btn:hover,
.magic-fill-btn:active {
  background: var(--heritage-cream);
  border-style: solid;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.quick-fill-form {
  display: grid;
  gap: 20px;
  margin-top: 20px;
  padding: 24px 20px;
  background: white;
  border: 2px solid var(--heritage-gold);
  border-radius: var(--radius-xl);
  animation: slideDown 0.3s ease-out;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  position: relative;
}

.quick-fill-form::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  height: 4px;
  background: linear-gradient(90deg, var(--heritage-gold), #f4e4bc, var(--heritage-gold));
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.helper-intro {
  background: var(--heritage-cream);
  padding: 16px;
  border-radius: 10px;
  margin: -8px -8px 20px -8px;
  border-bottom: 2px solid rgba(212, 175, 55, 0.3);
  text-align: center;
}

.helper-intro h4 {
  font-family: 'Crimson Text', serif;
  font-size: 22px;
  color: var(--heritage-forest);
  margin: 0 0 10px 0;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.helper-intro p {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  line-height: 1.6;
}

.input-group-helper {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--heritage-forest);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  opacity: 0.9;
  margin-left: 4px;
}

.quick-fill {
  padding: 16px 20px;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-md);
  font-family: 'Inter', sans-serif;
  font-size: 16px !important;
  background: var(--heritage-cream);
  transition: all var(--transition-normal);
  min-height: 56px;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

.quick-fill:focus {
  outline: none;
  border-color: var(--heritage-gold);
  background: white;
  box-shadow: 0 0 0 4px rgba(212, 175, 55, 0.15);
}

.quick-fill::placeholder {
  color: #8b7355;
  opacity: 0.5;
  font-size: 15px;
  font-style: italic;
}

.generate-magic-btn {
  background: var(--heritage-forest);
  color: white;
  border: 2px solid var(--heritage-gold);
  padding: 18px 32px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  border-radius: 30px;
  cursor: pointer;
  transition: all var(--transition-normal);
  margin-top: 16px;
  width: 100%;
  min-height: 60px;
  box-shadow: 0 4px 15px rgba(20, 48, 42, 0.2);
}

.generate-magic-btn:hover,
.generate-magic-btn:active {
  background: #1F3D37;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(20, 48, 42, 0.3);
}

.generating-message {
  text-align: center;
  padding: 24px;
  color: var(--heritage-forest);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-style: italic;
  background: var(--heritage-cream);
  border: 2px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.magic-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}

.input-example {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
  margin-top: 4px;
  margin-left: 4px;
  line-height: 1.4;
}

/* ==========================================
   15. MAGICAL ADDRESS PILL BADGE & MODAL
   ========================================== */

/* Magic Pill Wrapper */
.magic-pill-wrapper {
  position: fixed;
  top: 140px;
  right: 20px;
  z-index: 200;
}

.magic-pill-badge {
  background: var(--heritage-forest);
  border: 2px solid var(--heritage-gold);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  /* REMOVED: animation: gentleBounce 2s ease-in-out infinite; */
}

/* Gentle horizontal bounce animation */
@keyframes gentleBounce {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(3px);
    }
}

.magic-pill-badge::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  border-radius: 50%;
  border: 2px solid var(--heritage-gold);
  opacity: 0.3;
}

/* Animated Tooltip Box */
/* Animated Tooltip Box */
.magic-pill-wrapper::after {
  content: 'Magical Address Generator';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  margin-right: 18px;
  background: white;
  color: var(--heritage-forest);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  pointer-events: none;
  animation: tooltipFadeInStay 1s ease-out forwards, tooltipBounce 2s ease-in-out 1s infinite; /* This is the ONLY animation line */
  border: 1px solid var(--heritage-gold);
}

/* Arrow pointing to button */
.magic-pill-wrapper::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 100%;
  transform: translateY(-50%);
  margin-right: 12px; /* CHANGED from 2px - positions arrow between tooltip and button */
  width: 0;
  height: 0;
  border-left: 8px solid var(--heritage-gold);
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  opacity: 0;
  pointer-events: none;
animation: tooltipFadeInStay 1s ease-out forwards;
  z-index: 201;
  animation: tooltipFadeInStay 1s ease-out forwards, tooltipBounce 2s ease-in-out 1s infinite;
}

/* Add a border arrow behind the white arrow */
.magic-pill-wrapper {
  position: fixed;
  top: 140px;
  right: 20px;
  z-index: 200;
}

/* Hide tooltip when button has been clicked */
.magic-pill-wrapper.tooltip-hidden::after,
.magic-pill-wrapper.tooltip-hidden::before {
  display: none !important;
}

/* Tooltip Animation - Fade in and stay */
@keyframes tooltipFadeInStay {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
}

/* Gentle bounce animation for the tooltip */
@keyframes tooltipBounce {
  0%, 100% {
    transform: translateY(-50%) translateX(0);
  }
  50% {
    transform: translateY(-50%) translateX(-3px);
  }
}

.magic-pill-badge:hover {
  background: var(--heritage-cream);
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

.magic-pill-badge:active {
  transform: scale(0.95);
}

.pill-text,
.pill-arrow {
  display: none;
}

.pill-icon {
  font-size: 20px;
  color: var(--heritage-gold);
}

/* Modal Overlay */
.magic-modal-overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.7);
  z-index: 2147483647 !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior: contain !important;
  transform: none !important;
  will-change: auto !important;
  filter: none !important;
  isolation: isolate !important;
}

.magic-modal-overlay.active {
  display: flex !important;
  align-items: flex-start !important;
  justify-content: center;
  animation: fadeIn 0.3s ease;
  padding-top: 40px !important;
  padding-bottom: 40px !important;
}

/* Modal Content */
.magic-modal-content {
  background: white;
  border-radius: 20px;
  width: 90%;
  max-width: 340px;
  margin: 0 auto 40px auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: slideUp 0.3s ease;
  position: relative !important;
  z-index: 2147483648 !important;
  transform: none !important;
  display: inline-block !important;
  vertical-align: top !important;
  max-height: none !important;
  overflow: visible !important;
  min-height: 200px;
}

.magic-modal-content:has(.modal-preview[style*="block"]) {
  margin-bottom: 120px !important;
}

.modal-header {
  background: var(--heritage-forest);
  color: white;
  padding: 16px 40px;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: sticky;
  top: 0;
  z-index: 10;
}

.modal-header h3 {
  font-family: 'Crimson Text', serif;
  font-size: 16px;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: white;
  text-align: center;
  max-width: 80%;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s ease;
  position: absolute;
  right: 10px;
  top: 10px;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.1);
}

.modal-body {
  padding: 20px;
  overflow: visible !important;
  -webkit-overflow-scrolling: touch !important;
}

.modal-intro {
  font-size: 13px;
  color: #6b7280;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.4;
}

.magic-form-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.magic-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.magic-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--heritage-forest);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.magic-input {
  padding: 12px 14px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px !important;
  font-family: 'Inter', sans-serif;
  transition: all 0.2s ease;
  background: var(--heritage-cream);
  -webkit-text-size-adjust: 100%;
}

.magic-input:focus {
  outline: none;
  border-color: var(--heritage-gold);
  background: white;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

.magic-input::placeholder {
  color: #9ca3af;
  font-style: italic;
  font-size: 14px;
}

.modal-generate-btn {
  background: var(--heritage-forest);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 12px;
  width: 100%;
  box-shadow: 0 3px 10px rgba(20, 48, 42, 0.2);
}

.modal-generate-btn:hover:not(:disabled) {
  background: #1a3d36;
  transform: translateY(-1px);
  box-shadow: 0 5px 14px rgba(20, 48, 42, 0.3);
}

.modal-generate-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-generating {
  text-align: center;
  padding: 16px;
  color: var(--heritage-forest);
  font-style: italic;
  font-size: 13px;
}

.modal-preview {
  background: var(--heritage-cream);
  border: 2px solid var(--heritage-gold);
  border-radius: 10px;
  padding: 16px;
  margin-top: 16px;
}

.modal-preview h4 {
  font-family: 'Crimson Text', serif;
  font-size: 15px;
  color: var(--heritage-forest);
  margin: 0 0 10px 0;
  text-align: center;
}

.modal-preview .preview-text {
  background: white;
  padding: 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #4b5563;
  margin-bottom: 14px;
  text-align: center;
  font-style: italic;
  max-height: 100px;
  overflow-y: auto;
}

.preview-actions {
  display: flex;
  gap: 8px;
}

.use-btn,
.try-again-btn,
.copy-btn {
  flex: 1;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.use-btn {
  background: var(--heritage-gold);
  color: var(--heritage-forest);
  width: 100%;
}

.try-again-btn {
  background: white;
  color: var(--heritage-forest);
  border: 2px solid #e5e7eb;
}

.copy-btn {
  background: var(--heritage-forest);
  color: white;
  padding: 8px 12px;
  border-radius: 15px;
  font-size: 11px;
  margin-top: 8px;
  width: 100%;
}

/* Force elements behind modal */
body.gradient {
  transform: none !important;
  will-change: auto !important;
  perspective: none !important;
}

body.modal-open .announcement-bar,
body.modal-open #shopify-section-announcement-bar,
body.modal-open .site-header,
body.modal-open header,
body.modal-open [class*="header"] {
  z-index: 1 !important;
  position: relative !important;
  display: none !important;
  visibility: hidden !important;
}






/* ==========================================
   16. CANVA-STYLE MOBILE FEATURES
   ========================================== */

/* Canva Style Container */
.canva-style-test .builder-interface {
  padding: 0;
  height: 100vh;
  overflow: hidden;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

.canva-style-test .container {
  padding: 0;
  height: 100%;
  overflow: hidden;
}

.canva-style-test .builder-layout {
  display: block;
  height: 100%;
  overflow: hidden;
}

.canva-style-test .builder-header,
.canva-style-test .preview-accordion-wrapper,
.canva-style-test .mobile-step-dots {
  display: none !important;
}

/* Fixed Preview Background */
.canva-style-test .preview-column {
  display: flex !important;
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  bottom: 60px;
  z-index: 1;
  background: var(--heritage-cream);
  padding: 20px;
  align-items: center !important;
  justify-content: center !important;
  flex-direction: column;
}

.canva-style-test .preview-area {
  height: auto;
  min-height: unset;
}

/* Floating Form Panel */
.canva-style-test .form-column {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  height: 110px;
  background: white;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  z-index: 100;
  overflow: hidden;
  padding-top: 30px;
  opacity: 1;
  transition: all 0.3s ease;
  border: 1px solid var(--heritage-gold);
  border-bottom: none;
  box-shadow: 
    0 -4px 20px rgba(0,0,0,0.15),
    0 0 20px rgba(212, 175, 55, 0.15);
}

/* Drag Handle */
.canva-style-test .form-column::before {
  content: '';
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
}

/* Expanded State */
.canva-style-test.step-active .form-column {
  height: 55vh;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.canva-style-test.step-active .form-column::before {
  content: '';
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 5px;
  background: #9ca3af;
  border-radius: 3px;
  z-index: 10;
}

/* Collapsed State */
.canva-style-test.fully-collapsed .form-column {
  height: 0 !important;
  opacity: 0 !important;
  padding: 0 !important;
}

.canva-style-test.fully-collapsed #collapseFormBtn {
  position: fixed;
  bottom: 70px;
  top: auto;
  right: 16px;
}

/* Collapse Button */
#collapseFormBtn {
  position: absolute;
  top: 8px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: white;
  border: 2px solid var(--heritage-gold);
  border-radius: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 105;
  box-shadow: 0 2px 12px rgba(212, 175, 55, 0.3);
  transition: all 0.2s ease;
  pointer-events: auto;
  touch-action: manipulation !important;
}

#collapseFormBtn:hover,
#collapseFormBtn:active {
  background: var(--heritage-cream);
  transform: scale(0.95);
}

#collapseFormBtn svg {
  width: 20px;
  height: 20px;
  color: var(--heritage-gold);
  transition: transform 0.3s ease;
  pointer-events: none;
}

.canva-style-test:not(.step-active) #collapseFormBtn svg {
  transform: rotate(180deg);
}

.canva-style-test.step-active #collapseFormBtn svg {
  transform: rotate(0deg);
}

/* Navigation Icons Visibility */
.canva-style-test .navigation-buttons {
  display: none !important;
}

.canva-style-test .icon-step-nav {
  pointer-events: auto !important;
  z-index: 103 !important;
}

.canva-style-test .icon-step-nav * {
  pointer-events: auto !important;
}

/* Form Scroll States */
.canva-style-test .form-column * {
  pointer-events: auto !important;
}

.canva-style-test:not(.step-active) .form-column {
  overflow: hidden !important;
  overflow-y: hidden !important;
}



/* Hide summary form section on final step */
.canva-style-test .builder-step#step4 .form-section:first-child,
.canva-style-test .builder-step#step4 .form-section:has(.summary-box) {
  display: none !important;
}

/* ==========================================
   17. ANIMATIONS
   ========================================== */

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: translateY(-50%) rotate(0deg); }
  100% { transform: translateY(-50%) rotate(360deg); }
}

@keyframes dots {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.1;
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================
   18. SMALL SCREEN ADJUSTMENTS
   ========================================== */

@media (max-width: 480px) {
   .envelope-name-preview {
    font-size: 1.9rem !important; /* Smaller font = more characters */
    max-width: 80% !important; /* Wider container */
        line-height: 1.1; /* Reduced from 1.2 - tighter line spacing */

   }
  
  .envelope-address-preview {
    font-size: 1.3rem !important;
        line-height: 1.25; /* Reduced from 1.4 - tighter line spacing */

  }
  
  .letter-content-inner h3 {
    font-size: 1.3rem !important; /* Very slight reduction */
  }
  
  
  .letter-content-inner.text-medium p {
    font-size: 0.92rem !important;
  }
  
  .letter-content-inner.text-large p {
    font-size: 0.82rem !important;
  }
  
  .letter-content-inner.text-xlarge p {
    font-size: 0.72rem !important;
  }
}

@media (max-width: 380px) {
  #magicalAddress,
  #magicalAddress.form-control {
    font-size: 13px !important;
  }
  
  /* Even smaller fonts for very small screens */
  .letter-content-inner h3 {
    font-size: 1.25rem !important;
  }
  

  
  .letter-content-inner.text-xlarge p {
    font-size: 0.68rem !important;
  }
}

/* ==========================================
   TEMPLATE READ MODAL
   ========================================== */

/* Read Template Link */
.template-read-link {
  display: block;
  margin-top: 10px;
  font-family: var(--heritage-font-body);
  font-size: 11px;
  color: var(--heritage-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: none;
  border: none;
  padding: 4px 0;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: opacity 0.2s ease;
  width: 100%;
  text-align: center;
}

.template-read-link:hover {
  opacity: 0.8;
  text-decoration: none;
}

/* Template Modal */
.template-modal {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 2147483647 !important;
  display: flex;
  align-items: flex-start !important;  /* Keep at top */
  justify-content: center;
  padding-top: 40px !important;  /* Same as magical modal */
  padding-bottom: 40px !important;
  overflow-y: scroll !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
}

.template-modal-overlay {
  display: block !important;  /* CHANGE from none to block */
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: rgba(0, 0, 0, 0.7) !important;
  backdrop-filter: blur(4px);
  z-index: 2147483646 !important;  /* CHANGE from -1 to a high positive number */
}

.template-modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  padding: 32px 24px;
  margin: 0 auto 40px auto;  /* Same margins as magical modal */
  max-width: 90%;
  width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  -webkit-overflow-scrolling: touch;
  z-index: 2147483648 !important;
}

/* Reduce template text size */
.template-modal-body {
  font-size: 14px;  /* Reduced from 16px */
  line-height: 1.6;  /* Reduced from 1.8 */
  color: var(--heritage-green-dark);
}

.template-modal-body p {
  margin-bottom: 12px;  /* Reduced from 16px */
  font-size: 14px;  /* Ensure all paragraphs are smaller */
}

/* Make sure the highlighted placeholders are also smaller */
.template-modal-body mark {
  font-size: 14px;
  padding: 1px 3px;
}

.template-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--heritage-gold);
  background: white;
  color: var(--heritage-green-dark);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding: 0;
}

.template-modal-close:hover {
  background: var(--heritage-green-dark);
  color: white;
  transform: rotate(90deg);
}

.template-modal-title {
  font-size: 20px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--heritage-green-dark);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.template-modal-body {
  font-size: 16px;
  line-height: 1.8;
  color: var(--heritage-green-dark);
}

.template-modal-body p {
  margin-bottom: 16px;
}

/* When modal is open, hide navigation */
body.modal-open .site-header,
body.modal-open .header-wrapper,
body.modal-open header,
body.modal-open .sticky-header,
body.modal-open .sticky-nav {
  display: none !important;
}


/* Force hide magic pill on non-step-1 */
.letter-builder-container[data-current-step="2"] #magicPillWrapper,
.letter-builder-container[data-current-step="3"] #magicPillWrapper,
.letter-builder-container[data-current-step="4"] #magicPillWrapper {
  display: none !important;
  visibility: hidden !important;
}

/* ==========================================
   END OF MOBILE CSS
   ========================================== */



/* Ultra-specific selectors for modal header visibility */
#magicModal .magic-modal-content .modal-header,
.magic-modal-overlay .magic-modal-content .modal-header,
body .magic-modal-overlay .modal-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: var(--heritage-forest) !important;
  color: white !important;
  padding: 16px 40px !important;
  border-radius: 20px 20px 0 0 !important;
  align-items: center !important;
  justify-content: center !important;
  position: relative !important;
  z-index: 10 !important;
}

/* Override any header hiding rules */
.modal-header:not(.hide) {
  display: flex !important;
  visibility: visible !important;
}

/* Additional specificity to ensure it works */
.mobile-only .modal-header,
.magic-modal-overlay.mobile-only .modal-header {
  display: flex !important;
  visibility: visible !important;
}

/* Hide original navigation location on mobile */
/* Hide original navigation location on mobile */
.navigation-buttons:not(.step-4-nav) {
  display: none !important;
}

/* Show and style navigation inside step 4 on mobile only */
.step-4-nav {
  display: flex !important;
  position: relative !important;
  bottom: auto !important;
  margin-top: 20px;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}

/* Hide back button on step 4 */
.step-4-nav #backBtn,
.step-4-nav #productBackBtn {
  display: none !important;
}

/* Hide original navigation location on mobile, but keep step 4 nav */
.navigation-buttons {
  display: none !important;
}

/* Show and style navigation inside step 4 on mobile only */
.navigation-buttons.step-4-nav {
  display: flex !important;
  position: relative !important;
  bottom: auto !important;
  margin-top: 20px;
  padding: 0;
  border: none;
  box-shadow: none;
  background: transparent;
}


/* ULTIMATE OVERRIDE */
@media (max-width: 700px) {
  /* REMOVE THIS - it's overriding everything!
  #letterContentDisplay p {
    font-size: 1.0rem !important;
    min-height: 0 !important;
  }
  */
  
  #letterContentDisplay h3 {
    font-size: 1.0rem !important;
    min-height: 0 !important;
  }
  
  /* REMOVE THIS ENTIRE SECTION - it's overriding your variables
@media (max-width: 700px) {
  body .letter-text-overlay.Fancy #letterContentDisplay p[style] {
    font-size: 1.1rem !important;
    min-height: 0 !important;
    line-height: 1.0 !important;
    letter-spacing: -0.02em !important;
  }

  .letter-builder-container[data-letter-type="first-christmas"] .letter-text-overlay.Fancy #letterContentDisplay h3,
  #letterBuilderMain[data-letter-type="first-christmas"] .letter-text-overlay.Fancy #letterContentDisplay h3,
  body .letter-text-overlay.Fancy #letterContentDisplay h3[style] {
    font-size: 1.1rem !important;
    min-height: 0 !important;
    line-height: 0.95 !important;
    letter-spacing: -0.02em !important;
  }
}
*/

/* Fine-tuning for first-christmas specifically */
@media (max-width: 700px) {
  /* Additional control for first-christmas letters */
  [data-letter-type="first-christmas"] .letter-text-overlay.Fancy #letterContentDisplay p {
    line-height: 1.05 !important;
    letter-spacing: -0.01em !important;
  }
  
  /* Remove line-height override for Block to let JS control it */
  [data-letter-type="first-christmas"] .letter-text-overlay.Block #letterContentDisplay p {
    /* line-height controlled by JS */
  }
}

/* Remove bold from P.S. label */
.letter-ps-display p strong {
  font-weight: normal !important; /* Remove bold from "P.S." */
  -webkit-text-stroke: 0 !important; /* Remove any outline */
}

/* Base P.S. font styles */
.letter-ps-display.Block p {
  font-family: 'BlockFont', 'Times New Roman', serif !important;
  font-weight: normal;
  -webkit-text-stroke: 0.15px #2d3748;
}

.letter-ps-display.Fancy p {
  font-family: 'FancyFont', 'Brush Script MT', cursive !important;
  font-weight: normal;
  -webkit-text-stroke: 0.08px #2d3748;
  font-size: 1.15rem !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
}

/* P.S. Display positioning for mobile */
@media (max-width: 700px) {
  /* Block font P.S. positioning and spacing */
  .canva-style-test .letter-ps-display.Block {
    top: 84% !important; /* CHANGED from 80% - moves down by ~2 lines */
  }
  
  .canva-style-test .letter-ps-display.Block p {
    line-height: 1.15 !important; /* CHANGED from 1.3 - tighter line spacing */
  }
  
  /* Fancy font P.S. positioning */
  .canva-style-test .letter-ps-display.Fancy {
    top: 84% !important; /* Positioned from top, lower than Block */
  }
}

/* Keep your existing Fancy font P.S. (with the strong fix applied) */
.letter-ps-display.Fancy p {
  font-family: 'FancyFont', 'Brush Script MT', cursive !important;
  font-weight: normal;
  -webkit-text-stroke: 0.08px #2d3748;
  font-size: 1.15rem !important;
  line-height: 1.05 !important;
  letter-spacing: -0.02em !important;
}


/* ==========================================
PREVIEW TOOL TIP
========================================== */

/* Collapse Button Tooltip - Separate Element */
.collapse-tooltip-wrapper {
  position: fixed;
  bottom: calc(60px + 55vh + 10px); /* Above the expanded form */
  right: 16px; /* Align with collapse button */
  z-index: 106;
  opacity: 0;
  pointer-events: none;
  display: none;
}

/* Force opacity during animation */
.canva-style-test.step-active[data-current-step="2"]:not(.collapse-tooltip-shown) .collapse-tooltip-wrapper {
  display: block !important;
  opacity: 1 !important;
  pointer-events: none;
  animation: tooltipBounceVertical 5s ease-out 0.5s;
}

.collapse-tooltip-content {
  background: var(--heritage-forest); /* CHANGED to heritage green */
  color: white; /* CHANGED to white text */
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--heritage-gold);
  position: relative; /* Added for arrow positioning */
}

/* Add a gold border to the arrow for visibility */
.collapse-tooltip-arrow::before {
  content: '';
  position: absolute;
  bottom: 1px; /* Slightly above main arrow */
  left: -7px; /* Adjust for border width */
  width: 0;
  height: 0;
  border-top: 9px solid var(--heritage-gold); /* Gold outline */
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  z-index: -1; /* Behind main arrow */
}

/* Vertical bounce animation */
@keyframes tooltipBounceVertical {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  20%, 40%, 60%, 80% {
    opacity: 1;
    transform: translateY(0);
  }
  30%, 70% {
    opacity: 1;
    transform: translateY(-5px); /* Bounce up */
  }
  50% {
    opacity: 1;
    transform: translateY(5px); /* Bounce down */
  }
  90% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* Show tooltip only on step 2 when form is expanded */
.canva-style-test.step-active[data-current-step="2"] .collapse-tooltip-wrapper {
  display: block;
  animation: tooltipBounceVertical 5s ease-out 0.5s; /* CHANGED animation */
}

/* One-time show class */
.canva-style-test.step-active[data-current-step="2"].collapse-tooltip-shown .collapse-tooltip-wrapper {
  animation: none !important;
  opacity: 0 !important;
}


#achievement.large-textarea {
  min-height: 250px;
}


/* ==========================================
   OWNER NOTE - MOBILE STYLES
   ========================================== */

/* Base Owner Note Styling */
#ownerNote {
  background: #fef3c7 !important;
  border: 1px solid var(--heritage-gold) !important;
  margin-bottom: 20px !important;
  padding: 16px !important;
  border-radius: 8px !important;
  position: relative !important;
}

/* Ensure it shows in step 3 */
.canva-style-test #step3 #ownerNote {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  order: -1 !important; /* Appear first in step */
  margin-top: 0 !important;
}

/* Collapsed state styling */
.canva-style-test:not(.step-active) #ownerNote {
  background: #fef3c7 !important;
  border: 1px solid var(--heritage-gold) !important;
  border-radius: 8px !important;
  padding: 16px !important;
  margin: 12px 16px 16px 16px !important;
}

#ownerNote .note-close-btn {
  position: absolute !important;
   top: -8px !important;  /* Adjust to align with title */
  right: -35px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  color: #92400e !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  padding: 0 !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 9999 !important;
  -webkit-tap-highlight-color: transparent !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  text-align: center !important;
  isolation: isolate !important;
  transform: translateY(0) !important; /* Reset any transforms */
  margin-top: 0 !important; /* Reset any margins */
}

#ownerNote .note-close-btn:hover,
#ownerNote .note-close-btn:active {
  background: rgba(146, 64, 14, 0.1) !important;
  border-radius: 50% !important;
  color: var(--heritage-forest) !important;
}

/* Content Layout - Mobile Compact */
/* Content Layout - Mobile Compact */
.owner-note-content {
  display: block !important;
  padding: 0 10 !important; /* Equal padding both sides */
  position: relative !important;
}

/* Hide the separate icon on mobile */
.owner-note-icon {
  display: none !important;
}

/* Title with inline emoji */
.owner-note-text h5 {
  font-family: 'Crimson Text', serif !important;
  color: var(--heritage-forest) !important;
  margin: 0 0 8px 0 !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.4 !important;
  text-align: left !important;
  text-transform: uppercase !important;
  letter-spacing: 0.3px !important;
  position: relative !important;
  padding-left: 32px !important; /* Space for emoji */
}

/* Add emoji as pseudo-element */
.owner-note-text h5::before {
  content: '💌' !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  font-size: 20px !important;
}

/* Subtitle Styling - Inline with slash separator */
.owner-note-text h5 .owner-subtitle {
  display: inline !important;
  font-size: 10px !important;
  font-weight: 400 !important;
  color: var(--heritage-forest) !important;
  opacity: 0.8 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.2px !important;
  margin-left: 4px !important;
}

/* Add separator before subtitle */
.owner-note-text h5 .owner-subtitle::before {
  content: '• ' !important;
  margin-right: 4px !important;
  opacity: 0.6 !important;
}

/* Paragraph Styling */
.owner-note-text p {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: #92400e !important;
  margin: 0 !important;
  text-align: center !important;
}

/* Ensure all content is visible */
.canva-style-test #step3 .owner-note#ownerNote * {
  visibility: visible !important;
}

/* Ensure close button is on top of everything */
#ownerNote .note-close-btn {
  position: absolute !important;
  top: 8px !important;
  right: 8px !important;
  background: transparent !important;
  border: none !important;
  cursor: pointer !important;
  color: #92400e !important;
  font-size: 24px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  padding: 0 !important;
  width: 44px !important;
  height: 44px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: all 0.2s ease !important;
  z-index: 9999 !important; /* Increased from 1000 */
  -webkit-tap-highlight-color: transparent !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  text-align: center !important;
  isolation: isolate !important; /* Ensure it's in its own stacking context */

  /* Force header to hide when template modal is open */
body.modal-open .announcement-bar,
body.modal-open #shopify-section-announcement-bar,
body.modal-open .site-header,
body.modal-open header,
body.modal-open [class*="header"] {
  z-index: 1 !important;
  position: relative !important;
  display: none !important;
  visibility: hidden !important;
}

/* Also update your template modal to use the same high z-index */
.template-modal {
  z-index: 2147483647 !important;
}

.template-modal-overlay {
  z-index: 2147483647 !important;
}

.template-modal-content {
  z-index: 2147483648 !important;
}

/* Force header to hide when modal-open class is present */
body.modal-open .announcement-bar,
body.modal-open #shopify-section-announcement-bar, 
body.modal-open .site-header,
body.modal-open header,
body.modal-open [class*="header"] {
  z-index: 1 !important;
  position: relative !important;
  display: none !important;
  visibility: hidden !important;
}


/* Force specific Shopify header sections to hide when modal is open */
body.modal-open #shopify-section-sections--24722356273431__announcement-bar,
body.modal-open #shopify-section-sections--24722356273431__header,
body.modal-open .section-header,
body.modal-open .announcement-bar-section {
  display: none !important;
  visibility: hidden !important;
  z-index: 1 !important;
}


  
/* ==========================================
   Out Of Stock Swatches
   ========================================== */

/* Enhanced out-of-stock styling - subtle like Shopify */
.colour-swatch.out-of-stock {
  opacity: 0.5 !important;
  cursor: not-allowed !important;
  position: relative !important;
}

/* Semi-transparent overlay to grey out the color */
.colour-swatch.out-of-stock::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.5); /* White overlay at 50% */
  border-radius: 50%;
  pointer-events: none;
}

/* Ensure badge is visible */
.colour-swatch.out-of-stock .colour-swatch-badge {
  opacity: 1 !important;
  background: #dc2626 !important;
  color: white !important;
  font-weight: 600 !important;
  z-index: 1;
  position: relative;
}

/* Remove hover effects for out of stock */
.colour-swatch.out-of-stock:hover {
  transform: none !important;
  box-shadow: none !important;
}



/* Mobile adjustments */
@media (max-width: 700px) {
  .example-pills {
    gap: 6px;
  }
  
  .example-pill {
    font-size: 12px;
    padding: 6px 12px;
    white-space: normal;
    text-align: left;
  }
}
/* Example Pills - Mobile Styling */
.example-pills {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
  justify-content: center; /* Center the pills */
}

.example-pill {
  background: linear-gradient(135deg, #f5f3ef 0%, #faf8f3 100%);
  border: 1.5px solid #d4af37;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  color: #0f4c3a;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  text-decoration: none; /* Remove underline */
  display: inline-block;
  -webkit-appearance: none; /* Remove default button styling */
  appearance: none;
  font-family: inherit;
}

.example-pill:before {
  content: '✨';
  position: absolute;
  top: -20px;
  right: -20px;
  font-size: 40px;
  opacity: 0.1;
  transform: rotate(-15deg);
  transition: all 0.3s ease;
}

.example-pill:active {
  transform: scale(0.95);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  background: #d4af37;
  color: white;
}

/* Remove default button focus outline and add custom */
.example-pill:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.3);
}

/* Entrance animation */
@keyframes pillBounce {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.example-pills .example-pill:nth-child(1) {
  animation: pillBounce 0.4s ease forwards;
  animation-delay: 0.1s;
  opacity: 0;
}

.example-pills .example-pill:nth-child(2) {
  animation: pillBounce 0.4s ease forwards;
  animation-delay: 0.2s;
  opacity: 0;
}

.example-pills .example-pill:nth-child(3) {
  animation: pillBounce 0.4s ease forwards;
  animation-delay: 0.3s;
  opacity: 0;
}
/* Force example pill styling on mobile */
.letter-builder-container .example-pills {
  display: flex !important;
  gap: 8px !important;
  margin-top: 12px !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
}

.letter-builder-container button.example-pill,
.letter-builder-container .example-pill {
  background: linear-gradient(135deg, #f5f3ef 0%, #faf8f3 100%) !important;
  border: 1.5px solid #d4af37 !important;
  border-radius: 20px !important;
  padding: 8px 14px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  color: #0f4c3a !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
  text-decoration: none !important;
  display: inline-block !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  font-family: inherit !important;
  margin: 0 !important;
}

/* Accessibility: focus-visible outlines for interactive elements */
.colour-swatch:focus-visible,
.selection-card:focus-visible,
.font-card:focus-visible,
.btn:focus-visible,
.magic-pill-badge:focus-visible,
.template-read-link:focus-visible {
  outline: 3px solid rgba(212,175,55,.5);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(212,175,55,.35);
}



/* Utility: visually-hidden (screen-reader only) */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Mobile Chat Icon Position for Letter Builder Pages */
@media screen and (max-width: 700px) {
  /* Target the chat button on letter builder pages */
  body[data-letter-builder="true"] .Avada-Launcher__Button,
  body[data-letter-builder="true"] .Avada-Launcher__ButtonCustom {
    position: fixed !important;
    top: 140px !important;
    left: 20px !important;
    bottom: auto !important;
    right: auto !important;
    transform: none !important;
    transition: none !important;
  }
  
  /* Keep it in place when opened */
  body[data-letter-builder="true"] .Avada-Launcher__Button--opened {
    top: 140px !important;
    left: 20px !important;
    bottom: auto !important;
    right: auto !important;
  }
  
  /* Style the button */
  body[data-letter-builder="true"] .Avada-Launcher__Button {
    background-color: #D4AF37 !important; /* Gold - change to your color */
    width: 44px !important;
    height: 44px !important;
  }
}

/* Chat button positioning for mobile letter builder pages */
@media screen and (max-width: 700px) {
  body[data-letter-builder="true"] .Avada-Faqs_Button {
    position: fixed !important;
    top: 140px !important;
    left: 20px !important;
    bottom: auto !important;
    right: auto !important;
    width: 55px !important;
    height: 55px !important;
    z-index: 200 !important;
    border-radius: 50% !important;
  }
  
  body[data-letter-builder="true"] #Avada-FAQ_Widget {
    z-index: 200 !important;
  }
}

/* Force CSS variables to apply over JavaScript */
[data-letter-type="first-christmas"] .letter-text-overlay.Fancy .letter-content-inner p {
  font-size: var(--letter-p-size) !important;
  line-height: var(--letter-line-height) !important;
}

[data-letter-type="first-christmas"] .letter-text-overlay.Fancy .letter-content-inner h3 {
  font-size: var(--letter-h3-size) !important;
  line-height: var(--letter-line-height) !important;
}