/* ================================================================
   ImprimiblesDeFiesta — Style Sheet
   Paletas por categoría + componentes
   ================================================================ */

/* ================================================================
   DESIGN TOKENS
   ================================================================ */
:root {
  --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
  --max-width: 1100px;
  --header-height: 64px;

  /* Neutros */
  --bg: #f8f9fa;
  --card-bg: #ffffff;
  --text: #2c3e50;
  --text-light: #7f8c8d;
  --border: #e0e0e0;
  --success: #27ae60;
  --danger: #e74c3c;
  --warning: #f39c12;
}

/* ================================================================
   PALETAS POR CATEGORÍA
   ================================================================ */

/* --- Cumpleaños --- */
.cat-cumpleaños {
  --cat-primary: #FF6B35;
  --cat-secondary: #FFD700;
  --cat-accent: #00B4D8;
  --cat-bg: linear-gradient(135deg, #FFF3E0, #FFF8E1);
  --cat-primary-rgb: 255, 107, 53;
}

.cat-cumpleaños .cat-header { background: linear-gradient(135deg, #FF6B35, #FFD700); color: #fff; }
.cat-cumpleaños .cat-badge { background: #FF6B35; color: #fff; }
.cat-cumpleaños .btn-primary { background: #FF6B35; border-color: #FF6B35; }
.cat-cumpleaños .btn-primary:hover { background: #e55a2b; border-color: #e55a2b; }

/* --- Baby Shower --- */
.cat-baby-shower {
  --cat-primary: #F48FB1;
  --cat-secondary: #B2EBF2;
  --cat-accent: #FFF8E1;
  --cat-bg: linear-gradient(135deg, #FCE4EC, #E0F7FA);
  --cat-primary-rgb: 244, 143, 177;
}

.cat-baby-shower .cat-header { background: linear-gradient(135deg, #F48FB1, #B2EBF2); color: #5a5a5a; }
.cat-baby-shower .cat-badge { background: #F48FB1; color: #fff; }
.cat-baby-shower .btn-primary { background: #F48FB1; border-color: #F48FB1; }
.cat-baby-shower .btn-primary:hover { background: #e07a9e; border-color: #e07a9e; }

/* --- Revelación de Género --- */
.cat-revelacion {
  --cat-primary: #E91E63;
  --cat-secondary: #2196F3;
  --cat-accent: #ECEFF1;
  --cat-bg: linear-gradient(135deg, #FCE4EC, #E3F2FD);
  --cat-primary-rgb: 233, 30, 99;
}

.cat-revelacion .cat-header { background: linear-gradient(135deg, #E91E63, #2196F3); color: #fff; }
.cat-revelacion .cat-badge { background: #E91E63; color: #fff; }
.cat-revelacion .btn-primary { background: #E91E63; border-color: #E91E63; }
.cat-revelacion .btn-primary:hover { background: #c2185b; border-color: #c2185b; }

/* ================================================================
   RESET & BASE
   ================================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-family);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--cat-primary, #3498db); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; display: block; }

/* ================================================================
   SKIP LINK (accesibilidad)
   ================================================================ */
.skip-link {
  position: fixed; top: -999px; left: 0; z-index: 10000;
  padding: 0.6rem 1.2rem; background: #e67e22; color: #fff;
  text-decoration: none; font-weight: 700; font-size: 0.9rem;
  transition: top 0.15s;
}
.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: 2px; }

/* ================================================================
   HEADER
   ================================================================ */
.app-header {
  background: linear-gradient(135deg, var(--cat-primary, #667eea), var(--cat-secondary, #764ba2));
  color: #fff;
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.app-header h1 { font-size: 1.5rem; font-weight: 700; }

.site-nav {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.site-nav a {
  color: rgba(255,255,255,0.85);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.3rem 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}
.site-nav a:hover,
.site-nav a.active {
  color: #fff;
  text-decoration: none;
  border-bottom-color: rgba(255,255,255,0.5);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: var(--max-width);
  margin: 0 auto;
}

/* ================================================================
   HERO
   ================================================================ */
.hero {
  text-align: center;
  padding: 3rem 1.5rem 2rem;
  background: var(--cat-bg, linear-gradient(135deg, #f5f7fa, #c3cfe2));
}

.hero h2 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-light);
  max-width: 600px;
  margin: 0 auto;
}

/* ================================================================
   CATEGORY GRID
   ================================================================ */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 2px solid transparent;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-card.active {
  border-color: var(--cat-primary, #667eea);
}

.category-card .cat-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}

.category-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.category-card p {
  color: var(--text-light);
  font-size: 0.9rem;
}

/* ================================================================
   FORMAT GRID
   ================================================================ */
.formatos-section {
  padding: 1rem 1.5rem 2rem;
  max-width: var(--max-width);
  margin: 0 auto;
  width: 100%;
}

.formatos-section h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.formatos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
}

.formato-card {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  transition: transform var(--transition), box-shadow var(--transition);
  border: 1px solid var(--border);
}

.formato-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.formato-card .fmt-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.formato-card h4 { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.formato-card p { font-size: 0.8rem; color: var(--text-light); }

/* ================================================================
   STEP INDICATOR
   ================================================================ */
.step-indicator {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  background: #f0f0f0;
  color: var(--text-light);
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.step .step-num {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step.activo {
  background: var(--cat-primary, #667eea);
  color: #fff;
}
.step.activo .step-num { background: rgba(255,255,255,0.3); }

.step.completado {
  background: #e8f5e9;
  color: #2e7d32;
}
.step.completado .step-num { background: #4caf50; }

/* ================================================================
   EDITOR — PASOS
   ================================================================ */
.editor-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
  width: 100%;
}

.step-content {
  display: none;
}
.step-content.activo { display: block; }

.step-content h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.paso-tag {
  display: inline-block;
  background: var(--cat-primary, #667eea);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.step-desc {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

/* ================================================================
   FILE UPLOADS
   ================================================================ */
.file-group {
  margin-bottom: 1.5rem;
}

.file-group h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.file-group input[type="file"] {
  display: block;
  margin-bottom: 0.5rem;
}

.file-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.file-preview {
  width: 100%;
  max-width: 300px;
  min-height: 100px;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 0.5rem;
  background: #fafafa;
}

.file-preview img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* ================================================================
   COLOR PICKER
   ================================================================ */
.color-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0 1rem;
}

.color-swatch {
  width: 40px; height: 40px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  transition: var(--transition);
}
.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }

/* ================================================================
   TEXT INPUTS
   ================================================================ */
.editor-input {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-family);
  transition: var(--transition);
}
.editor-input:focus {
  outline: none;
  border-color: var(--cat-primary, #667eea);
  box-shadow: 0 0 0 3px rgba(var(--cat-primary-rgb, 102, 126, 234), 0.15);
}

/* ================================================================
   PREVIEW
   ================================================================ */
.preview-container {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.preview-container canvas {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.preview-hint {
  text-align: center;
  color: var(--text-light);
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
  font-family: var(--font-family);
}

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

.btn-primary {
  background: var(--cat-primary, #667eea);
  color: #fff;
  border-color: var(--cat-primary, #667eea);
}
.btn-primary:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-secondary {
  background: #95a5a6;
  color: #fff;
}
.btn-secondary:hover:not(:disabled) {
  background: #7f8c8d;
}

.btn-outline {
  background: transparent;
  color: var(--cat-primary, #667eea);
  border-color: var(--cat-primary, #667eea);
}
.btn-outline:hover:not(:disabled) {
  background: var(--cat-primary, #667eea);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}
.btn-success:hover:not(:disabled) {
  background: #219a52;
}

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
}

.btn-preview-nav {
  min-width: 36px;
  min-height: 36px;
  font-size: 1rem;
  padding: 0.3rem 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn-preview-nav:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 2rem;
  flex-wrap: wrap;
}

/* ================================================================
    VISTA PREVIA
    ================================================================ */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.preview-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.preview-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1rem;
  background: #f8f9fa;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.preview-card-icon {
  font-size: 1.3rem;
}

.preview-card-body {
  padding: 0;
  text-align: center;
  min-height: 80px;
}

/* Canvas de preview — renderizado por el engine de cada formato */
.preview-card-canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 210 / 297;
  display: block;
  background: #f5f5f5;
}

/* Preview visual con fondo de color */
.preview-card-visual {
  position: relative;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
}

.preview-card-img {
  max-width: 100%;
  max-height: 100px;
  object-fit: contain;
  border-radius: 4px;
}

.preview-card-placeholder {
  color: var(--text-light);
  font-size: 2rem;
  padding: 1rem 0;
}

.preview-card-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  text-align: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.6);
  padding: 2px 8px;
  border-radius: 4px;
}

.preview-card-info {
  padding: 0.6rem 0.8rem;
}

.preview-card-text {
  font-size: 0.85rem;
  color: var(--text-light);
  font-style: italic;
  margin-bottom: 0.3rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-card-swatches {
  display: flex;
  gap: 0.3rem;
  justify-content: center;
  flex-wrap: wrap;
}

.preview-swatch {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ddd;
}

/* ================================================================
    FREEMIUM CARDS (Paso 4)
    ================================================================ */
.freemium-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.freemium-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  box-shadow: var(--shadow);
  text-align: center;
  position: relative;
  border: 2px solid var(--border);
}

.freemium-free { border-color: #bdc3c7; }
.freemium-premium {
  border-color: var(--cat-primary, #f1c40f);
  box-shadow: 0 4px 24px rgba(var(--cat-primary-rgb, 241, 196, 15), 0.15);
}

.freemium-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: #7f8c8d;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 1rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.freemium-badge-premium { background: var(--cat-primary, #f1c40f); }

.freemium-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.freemium-title { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.5rem; }

.freemium-price {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--cat-primary, #e67e22);
  margin: 0.5rem 0;
}
.freemium-price-label { font-size: 0.8rem; font-weight: 400; color: var(--text-light); }
.freemium-local-ref { font-size: 0.8rem; color: var(--text-light); margin-bottom: 0.5rem; }

.freemium-features {
  list-style: none;
  text-align: left;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.freemium-features li { padding: 0.3rem 0; }
.freemium-restricted { color: var(--text-light); font-style: italic; }

.freemium-hint {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-top: 0.5rem;
}

.freemium-email {
  margin: 1rem 0;
}

.email-verify-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.email-verify-row input[type="email"] {
  flex: 1;
  padding: 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-family);
}

.otp-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.otp-row input[type="text"] {
  flex: 1;
  padding: 0.6rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  text-align: center;
  letter-spacing: 4px;
  font-family: monospace;
}

.email-verified {
  color: var(--success);
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0.5rem 0;
}

.freemium-status {
  font-size: 0.85rem;
  margin: 0.5rem 0;
  min-height: 1.2em;
}

.freemium-warning {
  font-size: 0.8rem;
  color: var(--warning);
  margin: 0.5rem 0;
  padding: 0.3rem 0.5rem;
  background: #fef9e7;
  border-radius: 4px;
}

/* ================================================================
   POST-PAGO SUCCESS
   ================================================================ */
.post-pago-success {
  text-align: center;
  padding: 2rem 1rem;
}
.post-pago-success h3 { color: #2e7d32; margin: 0 0 0.5rem 0; }
.progress-bar { height: 6px; background: #e0e0e0; border-radius: 3px; overflow: hidden; }
.progress-bar-fill {
  height: 100%;
  width: 100%;
  background: var(--success);
  border-radius: 3px;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* ================================================================
   OTP RECOVERY (mis-descargas)
   ================================================================ */
.recovery-container {
  max-width: 480px;
  margin: 2rem auto;
  padding: 2rem;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.recovery-step { display: none; }
.recovery-step.activo { display: block; }

.recovery-step h2 { font-size: 1.3rem; margin-bottom: 1rem; }

.compra-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.8rem;
  background: #fafafa;
}

.compra-info h4 { font-size: 0.95rem; margin-bottom: 0.2rem; }
.compra-info p { font-size: 0.8rem; color: var(--text-light); }

.compra-download .btn { font-size: 0.85rem; padding: 0.4rem 1rem; }

.cooldown-timer {
  color: var(--text-light);
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* ================================================================
   FOOTER
   ================================================================ */
.app-footer {
  background: #2c3e50;
  color: rgba(255,255,255,0.7);
  padding: 1.5rem 2rem;
  text-align: center;
  margin-top: auto;
}

.footer-nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.footer-nav a {
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}
.footer-nav a:hover { color: #fff; }

.app-footer p { font-size: 0.8rem; }

/* ================================================================
   SEO CONTENT
   ================================================================ */
.seo-content {
  max-width: var(--max-width);
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.content-block {
  margin-bottom: 2rem;
}

.content-block h2 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--text);
}

.content-block ul,
.content-block ol {
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.content-block li {
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

/* ================================================================
   MISC
   ================================================================ */
.hint {
  color: var(--text-light);
  font-size: 0.9rem;
}

.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-1 { margin-bottom: 1rem; }

.img-recommendations {
  margin: 1rem 0;
  background: #f8f9fa;
  border-radius: var(--radius-sm);
  padding: 0.8rem 1rem;
}
.img-recommendations summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
}
.img-recommendations ul {
  margin-top: 0.5rem;
  padding-left: 1.2rem;
}
.img-recommendations li {
  font-size: 0.85rem;
  margin-bottom: 0.3rem;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 600px) {
  .hero h2 { font-size: 1.5rem; }
  .category-grid { grid-template-columns: 1fr; padding: 1rem; }
  .formatos-grid { grid-template-columns: repeat(2, 1fr); }
  .freemium-grid { grid-template-columns: 1fr; }
  .step-indicator { flex-wrap: wrap; gap: 0.3rem; }
  .step { font-size: 0.75rem; padding: 0.3rem 0.6rem; }
  .step .step-num { width: 20px; height: 20px; font-size: 0.65rem; }
  .app-header { padding: 0.8rem 1rem; }
  .app-header h1 { font-size: 1.2rem; }
  .btn-row { flex-direction: column; align-items: center; }
  .btn-row .btn { width: 100%; max-width: 300px; }
}

/* ================================================================
   PRINT
   ================================================================ */
@media print {
  .app-header, .app-footer, .skip-link, .step-indicator, .btn-row { display: none; }
  body { background: #fff; }
  .editor-container { padding: 0; max-width: 100%; }
}
