@charset "UTF-8";

/* ====================================
   REI SISTEMAS - QR Code App
   CSS Mobile-First
   ==================================== */

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --secondary: #1e40af;
  --success: #10b981;
  --warning: #f97316;
  --danger: #ef4444;
  --dark: #1f2937;
  --light: #f9fafb;
  --border: #e5e7eb;
  --text: #374151;
  --muted: #6b7280;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --header-height: 68px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
    sans-serif;
  color: var(--text);
  background: #fff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Evita scroll horizontal indesejado causado por elementos que ultrapassam a largura */
html, body {
  overflow-x: hidden;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  color: var(--dark);
  font-size: 18px;
}

.header-logo svg {
  width: 32px;
  height: 32px;
}

.header-nav {
  display: none;
  gap: 24px;
  list-style: none;
}

.header-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s;
}

.header-nav a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-pro {
  padding: 8px 16px;
  background: var(--warning);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-pro:hover {
  background: #ea580c;
}

/* Mobile Menu */
.menu-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
}

/* Desktop */
@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }
}

/* Ad Slots */
.ad-slot {
  background: #f3f4f6;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 20px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-slot.medium {
  min-height: 250px;
}

.ad-slot.large {
  min-height: 600px;
}

/* Generator */
.qr-generator {
  padding: 24px 0 60px;
}

.section-title {
  font-size: 26px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--dark);
}

.section-subtitle {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
  line-height: 1.6;
}

/* Types Grid */
.types-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  display: block;
}

.types-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  margin-bottom: 24px;
}

.types-grid {
  display: grid;
  grid-auto-flow: column;
  gap: 8px;
  width: max-content;
}

.type-btn {
  padding: 8px 12px;
  border: 2px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 70px;
  transition: all 0.2s;
  white-space: nowrap;
}

.type-btn svg {
  width: 20px;
  height: 20px;
}

.type-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.type-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* Layout Grid */
.gen-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
  overflow: hidden;
}

/* Preview stage: canvas + overlay must align perfectly */
.qr-stage{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 360px;
  margin: 0 auto;
  background: transparent;
  overflow: hidden;
}

#qrCanvas{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#qrBaseCanvas{ /* hidden base, but keep box sizing */
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
}

#frameOverlay{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

/* Hide DOM overlay - frames are drawn into the canvas final only to avoid duplication */
#frameOverlay { display: none !important; }

/* Desktop two-column layout: left content + fixed preview column */
.qr-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
  min-height: calc(100vh - var(--header-height));
}

@media (min-width: 1100px) {
  .qr-layout {
    grid-template-columns: minmax(0, 1fr) 420px;
  }
}

/* Backwards compatibility: keep .gen-grid basic layout for small screens */
@media (min-width: 768px) {
  .gen-grid { gap: 24px; }
}

/* Form Sections */
.form-section {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
  overflow-x: hidden;
  max-width: 100%;
  min-height: 0;
}

.form-section h3 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  color: var(--dark);
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-section h3::before {
  content: attr(data-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--primary);
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 900;
}

/* Form Fields */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tab-btn {
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.2s;
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Colors Grid */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
  gap: 8px;
}

.color-swatch {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.color-swatch:hover {
  transform: scale(1.05);
}

.color-swatch.selected {
  box-shadow: 0 0 0 2px var(--primary);
}

/* Carousel */
.carousel {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: #f9fafb;
}

.carousel-inner {
  display: flex;
  transition: transform 0.3s ease;
}

.carousel-item {
  flex: 0 0 100%;
  padding: 20px;
  text-align: center;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

.carousel-item.selected {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.carousel-nav {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.carousel-btn {
  padding: 6px 12px;
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: background 0.2s;
}

.carousel-btn:hover {
  background: var(--border);
}

/* Preview */
.qr-preview {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  position: sticky;
  top: 80px;
  overflow-x: hidden;
  max-width: 100%;
}

/* Force preview column width and prevent it from expanding */
.qr-preview {
  width: 100%;
  max-width: 100%;
}

.qr-preview h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 16px;
  color: var(--dark);
}

.qr-preview-box {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-preview canvas {
  max-width: 100%;
  height: auto;
}

.qr-preview-image {
  max-width: 100%;
  height: auto;
}

.preview-error {
  color: var(--danger);
  font-size: 13px;
  padding: 12px;
  background: rgba(239, 68, 68, 0.05);
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Buttons */
.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  background: var(--secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--light);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-sm {
  padding: 8px 12px;
  font-size: 13px;
}

.btn-block {
  width: 100%;
  margin-bottom: 8px;
}

/* Sections */
.section {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

.section-header {
  margin-bottom: 24px;
}

.section h2 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 8px;
  color: var(--dark);
}

.section-description {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

/* Pro Section */
.pro-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.pro-card {
  background: var(--light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  position: relative;
  opacity: 0.6;
}

.pro-card::before {
  content: '🔒';
  font-size: 32px;
  display: block;
  margin-bottom: 8px;
}

.pro-card-label {
  position: absolute;
  top: -12px;
  right: 12px;
  background: var(--warning);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.pro-card h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.pro-card p {
  font-size: 12px;
  color: var(--muted);
}

/* Pro Call-to-Action */
.pro-cta {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  padding: 32px 20px;
  text-align: center;
  margin: 32px 0;
}

.pro-cta h3 {
  font-size: 20px;
  font-weight: 900;
  margin-bottom: 12px;
}

.pro-cta p {
  font-size: 15px;
  margin-bottom: 16px;
  opacity: 0.95;
}

.pro-cta .btn {
  background: white;
  color: #667eea;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}

.pro-cta .btn:hover {
  background: #f0f0f0;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 8px;
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 900;
  color: var(--dark);
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.modal-body {
  margin-bottom: 20px;
}

.modal-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Validation */
.form-group.error input,
.form-group.error textarea {
  border-color: var(--danger);
}

.form-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}

/* Success */
.success-message {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid rgba(16, 185, 129, 0.3);
  font-size: 13px;
  margin-bottom: 16px;
}

/* Footer */
footer {
  background: var(--light);
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  margin-top: 60px;
  font-size: 13px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

footer h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}

footer a {
  color: var(--muted);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
  transition: color 0.2s;
}

footer a:hover {
  color: var(--primary);
}

.footer-bottom {
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

@media (min-width: 768px) {
  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* Utilities */
.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mt-40 {
  margin-top: 40px;
}

.mb-20 {
  margin-bottom: 20px;
}

.hidden {
  display: none !important;
}

/* Loading */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Print */
/* Frame Section and Carousel */
.frame-section {
  margin-bottom: 20px;
  width: 100%;
  overflow: hidden;
}

.frames-carousel-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  width: 100%;
  height: 110px; /* fixed height so carousel doesn't stretch layout */
  overflow: hidden;
  box-sizing: border-box;
}

.frames-scroll-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: all 0.2s ease;
  padding: 0;
  min-width: 36px;
}

.frames-scroll-btn:hover {
  background: var(--light);
  border-color: var(--primary);
  color: var(--primary);
}

.frames-scroll-btn:active {
  transform: scale(0.95);
}

.frames-carousel {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  flex: 1;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  height: 100%;
}

.frames-carousel::-webkit-scrollbar {
  height: 4px;
}

.frames-carousel::-webkit-scrollbar-track {
  background: transparent;
}

.frames-carousel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.frames-carousel::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

.frame-item {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.frame-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.frame-item.selected {
  border-color: var(--primary);
  background: #f0f6ff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.frame-item-thumb {
  width: 56px;
  height: 56px;
  border: 1px solid #ddd;
  border-radius: 4px;
  object-fit: contain;
  background: white;
}

/* Compact form controls */
input, textarea, select, .input {
  height: 44px;
  padding: 8px 10px;
  font-size: 14px;
}

textarea {
  min-height: 100px;
  height: auto;
}

.form-group { margin-bottom: 10px; }

.frame-item-label {
  font-size: 11px;
  font-weight: 600;
  text-align: center;
  color: var(--muted);
  word-break: break-word;
}

.frame-item.selected .frame-item-label {
  color: var(--primary);
  font-weight: 700;
}

/* Frame Text Config */
.frame-text-config {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.frame-text-config .input {
  width: 100%;
  max-width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}

.frame-text-config .input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* QR Preview with Frame Overlay */
.qr-preview-box {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  /* height driven by the canvas container (320×360) */
  min-height: 0;
  max-width: 100%;
  padding-bottom: 0;
}


/* Container matches SVG frame proportions: 320 wide × 360 tall (bottom bar = 40px) */
.qr-canvas-container {
  position: relative;
  margin: 0 auto;
  width: 320px;
  max-width: 100%;
  /* 320×360 → aspect-ratio 8/9 */
  height: 360px;
  background: white;
  overflow: hidden;
  flex-shrink: 0;
}

/* QR sits inside the top portion of the 320×360 container.
   SVG top bar ends at y≈30; bottom bar starts at y=310 → 280px QR zone.
   We center 256px within that zone: top = 30 + (280-256)/2 = 42px */
#qr-code-wrapper {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 256px;
  height: 256px;
  box-sizing: border-box;
}

.qr-canvas-container .preview-error {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  width: max-content;
  max-width: 90%;
  text-align: center;
}

/* Overlay fills the entire container (320×360), exactly matching the SVG viewBox */
.frame-overlay-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill; /* stretch to fill container exactly like SVG viewBox */
  pointer-events: none;
  display: none !important;
  z-index: 10;
  box-sizing: border-box;
}

.frame-overlay-img.visible {
  display: block !important;
}

/* Fix layout overflow */
.gen-grid {
  display: grid;
  gap: 24px;
  margin-bottom: 24px;
  width: 100%;
  overflow: hidden;
}

@media (min-width: 768px) {
  .gen-grid:not(.qr-layout) {
    grid-template-columns: 1fr 1fr;
    overflow: visible;
  }
}

/* Mobile adjustments - expanded breakpoint and less compressed spacing */
@media (max-width: 767px) {
  /* layout stack */
  .qr-layout { display: block; }
  .qr-left, .qr-right { width: 100%; }

  /* Scale 320×360 canvas down for small screens */
  .qr-canvas-container {
    width: 290px;
    height: 327px; /* 360 * 290/320 */
  }
  #qr-code-wrapper {
    width: 232px; /* 256 * 290/320 */
    height: 232px;
    top: 27px;   /* 30 * 290/320 */
  }

  /* frames carousel compact but not cramped */
  .frames-carousel-wrapper {
    gap: 8px;
    height: 92px;
    padding: 6px 0;
  }

  .frames-carousel { padding: 6px 0; }

  .frame-item {
    width: 88px;
    height: 88px;
    gap: 6px;
    padding: 6px;
  }

  .frame-item-thumb {
    width: 52px;
    height: 52px;
  }

  .frame-item-label { font-size: 11px; }

  .frames-scroll-btn { width: 34px; height: 34px; }

  /* preview sizing for mobile */
  .qr-preview { padding: 12px; }
  .qr-preview-box { min-height: 0; padding: 12px; }

  /* form spacing looser */
  .form-section { padding: 14px; margin-bottom: 14px; }
  .form-group { margin-bottom: 12px; }

  /* frame-text config stack */
  .frame-text-config > div { grid-template-columns: 1fr !important; }

  /* ensure sticky disabled on mobile */
  .gen-grid.qr-layout .qr-left { max-height: none; overflow: visible; }
  .gen-grid.qr-layout .qr-right .qr-preview { position: static; top: auto; }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .header,
  .qr-controls,
  footer,
  .ad-slot,
  .frame-section {
    display: none;
  }

  .qr-preview-box {
    border: none;
    background: none;
  }
}

/* Layout helpers for QR generator */
.gen-grid.qr-layout .qr-left{
  max-height: calc(100vh - var(--header-height) - 24px);
  overflow: auto;
  min-width: 0;
}

.gen-grid.qr-layout .qr-right{
  position: relative;
}

/* Make the preview sticky within the right column */
.gen-grid.qr-layout .qr-right .qr-preview{
  position: sticky;
  top: calc(var(--header-height) + 12px);
  align-self: start;
}

/* Mobile: ensure preview is static and columns stack */
@media (max-width: 767px) {
  .gen-grid.qr-layout .qr-left { max-height: none; overflow: visible; }
  .gen-grid.qr-layout .qr-right .qr-preview { position: static; top: auto; }
}
