/* =========================================================================
   ACTIVITY OVERLAY BUILDER — ELEGANT ARCHITECTURAL LIGHT DESIGN SYSTEM
   ========================================================================= */

:root {
  --primary: #FC5200;
  --primary-hover: #E04900;
  --primary-active: #C84100;
  --primary-tint: rgba(252, 82, 0, 0.06);
  --primary-ring: rgba(252, 82, 0, 0.16);

  /* Clean Architectural Light Palette */
  --bg: #F4F4F6;
  --card-bg: #FFFFFF;
  --surface-subtle: #F4F4F5;
  --surface-hover: #EAEAEF;
  --surface-disabled: #F8F8FA;

  --text: #09090B;
  --text-muted: #71717A;
  --text-dim: #A1A1AA;
  --placeholder: #A1A1AA;

  --border-color: #E4E4E7;
  --border-strong: #D4D4D8;

  --preview-mat: #1E293B;
  --preview-aura:
    radial-gradient(circle at 28% 32%, rgba(56, 189, 248, 0.35), transparent 52%),
    radial-gradient(circle at 72% 68%, rgba(251, 146, 60, 0.32), transparent 55%),
    linear-gradient(135deg, #1E293B 0%, #334155 45%, #0F172A 100%);
  --preview-mat-light: #E2E8F0;
  --preview-aura-light:
    radial-gradient(circle at 28% 32%, rgba(56, 189, 248, 0.32), transparent 54%),
    radial-gradient(circle at 72% 68%, rgba(251, 146, 60, 0.28), transparent 56%),
    linear-gradient(135deg, #DBEAFE 0%, #F1F5F9 48%, #E2E8F0 100%);
  --dock-bg: #FFFFFF;
  --dock-shadow: 0 -8px 30px rgba(9, 9, 11, 0.08);
  --card-shadow: none;
  --modal-backdrop: rgba(9, 9, 11, 0.55);
  --dropdown-bg: rgba(255, 255, 255, 0.96);

  --font-primary: 'Unbounded', sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

body {
  font-family: var(--font-primary);
  font-weight: 700;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 20px 24px 20px 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.container {
  max-width: 1040px;
  width: 100%;
  background: transparent;
  padding: 0;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* =========================================================================
   HEADER PRINCIPAL (IDIOMA — TÍTULO — FEEDBACK)
   ========================================================================= */
.app-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto;
  align-items: center;
  width: 100%;
  margin-bottom: 24px;
  position: relative;
}

.header-actions-dropdown {
  display: contents;
}

/* Botón de menú móvil circular de 44px */
.btn-menu-mobile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
  transition: all 0.15s ease;
}

.btn-menu-mobile .material-icons-outlined {
  font-size: 22px;
}

.app-header .btn-menu-mobile {
  display: none !important;
}

.app-header .lang-toggle {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
}

.app-header h1 {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  margin: 0;
  padding: 0;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  letter-spacing: -0.6px;
  text-transform: uppercase;
  color: var(--text);
}

.app-header .btn-feedback {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

/* =========================================================================
   SELECTOR DE IDIOMA (CUADRADO / ROUNDED-RECT, MIN 44PX)
   ========================================================================= */
.lang-toggle {
  --toggle-pad: 3px;
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  min-height: 44px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: var(--toggle-pad);
  user-select: none;
  box-shadow: var(--card-shadow);
}

.lang-slider {
  position: absolute;
  top: var(--toggle-pad);
  bottom: var(--toggle-pad);
  left: var(--toggle-pad);
  width: calc(50% - var(--toggle-pad));
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.lang-toggle[data-lang="en"] .lang-slider {
  transform: translateX(0);
}

.lang-toggle[data-lang="es"] .lang-slider {
  transform: translateX(100%);
}

.lang-btn {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: transparent !important;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 0 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

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

.lang-btn.active {
  color: var(--text);
}

/* =========================================================================
   BOTÓN DE FEEDBACK (MIN 44PX)
   ========================================================================= */
.btn-feedback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  min-height: 44px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 0 18px;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.6px;
  cursor: pointer;
  box-shadow: var(--card-shadow);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-feedback .material-icons-outlined {
  font-size: 17px;
  color: var(--primary);
}

.btn-feedback:hover {
  background: var(--surface-subtle);
  border-color: var(--border-strong);
}

/* =========================================================================
   STUDIO LAYOUT (CONTROLES IZQUIERDA — PREVIEW DERECHA)
   ========================================================================= */
.studio-layout {
  display: grid;
  grid-template-columns: 430px 1fr;
  gap: 24px;
  align-items: start;
}

.studio-controls-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.studio-controls-col .card-step {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
}

.studio-preview-col {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* 1. SPORT SEGMENTED CONTROL (CUADRADO / ROUNDED-RECT, MIN 44PX) */
.sport-grid {
  --sport-pad: 3px;
  position: relative;
  display: flex;
  align-items: center;
  height: 44px;
  min-height: 44px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: var(--sport-pad);
  user-select: none;
  box-shadow: var(--card-shadow);
}

.sport-slider {
  position: absolute;
  top: var(--sport-pad);
  bottom: var(--sport-pad);
  left: var(--sport-pad);
  width: calc(50% - var(--sport-pad));
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 7px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: transform 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 1;
}

.sport-grid[data-sport="cycling"] .sport-slider {
  transform: translateX(0);
}

.sport-grid[data-sport="running"] .sport-slider {
  transform: translateX(100%);
}

.sport-card {
  position: relative;
  z-index: 2;
  height: 100%;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  background: transparent !important;
  border: none !important;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  transition: color 0.18s ease;
  gap: 6px;
  user-select: none;
}

.sport-card:hover:not(.active) {
  color: var(--text);
}

.sport-card .material-icons-outlined {
  font-size: 18px;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

.sport-card:hover:not(.active) .material-icons-outlined {
  color: var(--text);
}

.sport-card.active {
  color: var(--text);
}

.sport-card.active .material-icons-outlined {
  color: var(--primary);
}

/* 2. METRICS INPUTS (LABELS PESO 700, INPUTS MIN 44PX) */
.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.field.full-width {
  grid-column: 1 / -1;
}

.field label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
}

.field input[type="text"] {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text);
  height: 46px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 700;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.field input[type="text"]:hover:not(:focus):not(:disabled) {
  border-color: var(--border-strong);
}

.field input[type="text"]:focus {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

.field input::placeholder {
  color: var(--placeholder);
  font-weight: 500;
}

.field input:disabled {
  background-color: var(--surface-disabled);
  color: var(--text-muted);
  cursor: not-allowed;
  border-color: var(--border-color);
  opacity: 0.85;
}

.time-inputs {
  display: flex;
  gap: 6px;
  width: 100%;
}

.time-inputs input {
  padding: 0 4px !important;
  text-align: center;
  flex: 1;
  min-width: 0;
  width: 0;
}

/* 3. COLOR SWATCHES (HIT AREA 44PX, RESPONSIVE ZERO OVERFLOW) */
.design-colors-row {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  width: 100%;
  display: flex;
  justify-content: center;
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.swatch-btn {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  min-width: 0;
  min-height: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(128, 128, 138, 0.28);
  cursor: pointer;
  background: transparent;
  box-sizing: border-box;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  transform: none;
}

.swatch-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

.swatch-btn:hover {
  transform: none;
}

.swatch-btn.active {
  border: 2.5px solid var(--primary);
  box-shadow: inset 0 0 0 2px var(--card-bg);
  transform: none;
}

/* 4. DESIGN TEMPLATES GRID + PAGINACIÓN CIRCULAR 44PX */
.design-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: auto auto;
  gap: 8px;
  min-height: 0;
}

.design-card {
  position: relative;
  aspect-ratio: 16/9;
  min-height: 44px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
  padding: 6px;
}

.design-card:hover:not(.active) {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.design-card.active {
  border-color: var(--primary);
  background: var(--primary-tint);
  box-shadow: inset 0 0 0 1px var(--primary);
}

/* Miniaturas sin fondo propio invertidas a tinta negra nítida sobre papel claro */
.design-card:not([data-design="7"]):not([data-design="11"]):not([data-design="12"]) img {
  filter: invert(1) brightness(0.08);
}

.design-card-num {
  position: absolute;
  top: 5px;
  left: 6px;
  font-family: var(--font-primary);
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  opacity: 0.75;
  height: 15px;
  display: inline-flex;
  align-items: center;
  line-height: 1;
  pointer-events: none;
  z-index: 2;
}

.design-card.active .design-card-num {
  color: var(--primary);
  opacity: 1;
}

.design-badge-new {
  position: absolute;
  top: 5px;
  right: 5px;
  background: var(--primary);
  color: #ffffff;
  font-family: var(--font-primary);
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 15px;
  padding: 0 6px;
  border-radius: 999px;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  z-index: 2;
}

.design-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 14px 0;
  padding: 0;
  width: 100%;
}

/* Indicador de swipe / dots (visible en móvil o dentro de Design System) */
.carousel-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 8px 0 12px 0;
  padding: 0;
  width: 100%;
}

.card-step > .carousel-dots {
  display: none;
}

.carousel-dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--border-strong);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease, opacity 0.2s ease;
  opacity: 0.65;
}

.carousel-dot::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
}

.carousel-dot.active {
  width: 20px;
  background: var(--primary);
  opacity: 1;
}

/* Botones de navegación circulares y de 44px */
.design-nav-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  padding: 0;
}

.design-nav-btn:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.design-nav-btn:active:not(:disabled) {
  background: #E2E2E7;
}

.design-nav-btn:disabled,
.design-nav-btn.disabled {
  opacity: 0.32;
  cursor: not-allowed;
  pointer-events: none;
}

.design-nav-btn .material-icons-outlined {
  font-size: 22px;
}

.design-page-indicator {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.design-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  border-radius: 4px;
  transition: transform 0.2s ease, filter 0.2s ease;
  transform: scale(1.2);
}

.design-card[data-design="1"] img { transform: scale(0.79); }
.design-card[data-design="2"] img { transform: scale(1.00); }
.design-card[data-design="3"] img { transform: scale(1.15); }
.design-card[data-design="4"] img { transform: scale(1.20); }
.design-card[data-design="5"] img { transform: scale(1.35); }
.design-card[data-design="6"] img { transform: scale(1.36); }
.design-card[data-design="7"] img { transform: scale(1.14); }
.design-card[data-design="8"] img { transform: scale(1.15); }
.design-card[data-design="9"] img { transform: scale(1.28); }
.design-card[data-design="10"] img { transform: scale(1.125); }
.design-card[data-design="11"] img { transform: scale(1.18); }
.design-card[data-design="12"] img { transform: scale(1.18); }

/* =========================================================================
   BOTÓN PRINCIPAL DE DESCARGA (SUELTO FUERA DE CARD, ALINEADO ABAJO)
   ========================================================================= */
.btn-main {
  background: var(--primary);
  color: #ffffff;
  border: none;
  height: 48px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  cursor: pointer;
  width: 100%;
  margin: auto 0 0 0;
  transition: background-color 0.15s ease, transform 0.1s ease;
  font-family: inherit;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
}

.btn-main.btn-downloaded {
  background: #22c55e;
}

.btn-main .material-icons-outlined {
  font-size: 19px;
}

@media (hover: hover) and (pointer: fine) {
  .btn-main:hover {
    background: var(--primary-hover);
  }
}

.btn-main:active {
  background: var(--primary-active);
}

/* =========================================================================
   PREVIEW CONTAINER (FONDO LISO, SIN SOMBRAS NI GRID)
   ========================================================================= */
.preview-container {
  position: relative;
  overflow: hidden;
  background-color: var(--preview-mat);
  background: var(--preview-aura);
  background-clip: padding-box;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 24px;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 420px;
  max-height: 460px;
  width: 100%;
  transition: border-color 0.28s ease;
}

.preview-container::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  background-color: var(--preview-mat-light);
  background: var(--preview-aura-light);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
  z-index: 0;
}

.preview-container.aura-light {
  border-color: var(--border-color);
}

.preview-container.aura-light::before {
  opacity: 1;
}

.preview-container canvas {
  position: relative;
  z-index: 1;
  max-width: 100%;
  max-height: 380px;
  width: auto;
  height: auto;
  border-radius: 6px;
  background: transparent;
  display: block;
  margin: auto;
}

.studio-preview-col .btn-main {
  width: 100%;
  height: 50px;
  margin: 0;
  box-shadow: none;
  border: none;
}

.studio-preview-col .btn-main:hover {
  box-shadow: none;
}

.studio-preview-col .btn-main:active {
  box-shadow: none;
}

.studio-preview-col .crafted-by {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  width: 100%;
}

.crafted-by {
  margin: 22px 0 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-muted);
}

.crafted-by a {
  color: var(--primary);
  font-weight: 800;
  text-decoration: none;
}

.crafted-by a:hover {
  text-decoration: underline;
}

/* =========================================================================
   FEEDBACK MODAL (CLOSE BUTTON CIRCULAR DE 44PX)
   ========================================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-overlay::-webkit-scrollbar,
.modal-card::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  max-width: 480px;
  width: 100%;
  padding: 28px 26px 32px 26px;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  transform: scale(0.96) translateY(8px);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 90vh;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

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

.modal-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin: 0;
  letter-spacing: -0.3px;
  line-height: 1.25;
}

/* Botón de cierre circular de 44px */
.modal-close-btn {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.modal-close-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
  color: var(--text);
}

.modal-close-btn:active {
  background: #E2E2E7;
}

.modal-close-btn .material-icons-outlined {
  font-size: 22px;
}

.field-req {
  color: var(--primary);
  font-weight: 800;
  margin-left: 2px;
}

.field-opt {
  color: var(--text-dim);
  font-size: 9.5px;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

#feedbackForm {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

#feedbackForm .field label {
  white-space: normal;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  font-weight: 700;
}

#feedbackForm input[type="text"],
#feedbackForm textarea {
  font-family: inherit;
  font-weight: 500;
  font-size: 16px;
}

.field textarea {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text);
  padding: 12px;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
  font-weight: 500;
  line-height: 1.45;
  resize: vertical;
  min-height: 110px;
  outline: none;
  width: 100%;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.field textarea:focus {
  background: var(--card-bg);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

#feedbackForm .btn-feedback-submit {
  margin: 0;
  width: 100%;
}

#feedbackForm .btn-feedback-submit:disabled {
  background: var(--surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-dim);
  cursor: not-allowed;
}

.btn-feedback-submit.loading {
  opacity: 0.7;
  cursor: wait;
}

.feedback-error {
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 8px;
  color: #ef4444;
  font-size: 10px;
  line-height: 1.4;
}

#feedbackSuccessView {
  text-align: center;
  padding: 12px 0 6px 0;
}

.modal-desc {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 12px auto 24px auto;
  max-width: 380px;
}

.modal-success-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.12);
  border: 2px solid #22c55e;
  color: #22c55e;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px auto;
}

.modal-success-icon .material-icons-outlined {
  font-size: 32px;
}

.mobile-dock-bg {
  display: none;
}

/* =========================================================================
   MOBILE & PWA TOUCH ERGONOMICS (<= 800px)
   ========================================================================= */
@media (max-width: 800px) {
  /* Previene el zoom automático de iOS Safari al enfocar cualquier input */
  input[type="text"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }

  body {
    padding-top: 12px;
    padding-left: max(16px, env(safe-area-inset-left, 16px));
    padding-right: max(16px, env(safe-area-inset-right, 16px));
    padding-bottom: 230px;
    display: block;
    background: var(--bg);
  }

  .container {
    margin: 0;
  }

  .app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 4px 0 16px 0;
    width: 100%;
  }

  .app-header h1 {
    order: 1;
    font-size: clamp(18px, 5vw, 22px);
    letter-spacing: -0.6px;
    text-align: left;
    flex: 1;
    min-width: 0;
  }

  /* Botón de menú móvil circular de 44px */
  .app-header .btn-menu-mobile {
    order: 2;
    display: flex !important;
  }

  /* DROPDOWN DESPLEGABLE EN MOBILE */
  .header-actions-dropdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1001;
    background: var(--dropdown-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 14px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
    min-width: 220px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;
    transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .header-actions-dropdown.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
  }

  .header-actions-dropdown .lang-toggle,
  .header-actions-dropdown .btn-feedback {
    width: 100%;
    height: 44px;
  }

  .studio-layout {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .studio-controls-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .studio-preview-col {
    position: static !important;
    display: contents !important;
  }

  .studio-controls-col .card-step {
    padding: 16px;
    border-radius: 16px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
  }

  .design-colors-row {
    margin-top: 12px;
    padding-top: 0;
    border-top: none;
    display: flex;
    justify-content: center;
  }

  .color-swatches {
    justify-content: center;
    gap: 8px;
  }

  .design-pagination {
    display: none !important;
  }

  /* INDICADOR DE SWIPE / DOTS EN MOBILE */
  .card-step > .carousel-dots {
    display: flex !important;
  }

  .design-grid {
    display: flex !important;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding: 0 16px;
    -webkit-overflow-scrolling: touch;
    gap: 10px;
    padding: 4px 16px 6px 16px;
    margin-left: -16px;
    margin-right: -16px;
    width: calc(100% + 32px);
    max-width: calc(100% + 32px);
    box-sizing: border-box;
    min-height: 0 !important;
    scrollbar-width: none;
  }

  .design-grid::-webkit-scrollbar {
    display: none;
  }

  .design-card {
    display: flex !important;
    flex: 0 0 calc((100% - 24px) / 2.3) !important;
    width: calc((100% - 24px) / 2.3) !important;
    min-width: calc((100% - 24px) / 2.3) !important;
    max-width: calc((100% - 24px) / 2.3) !important;
    scroll-snap-align: start;
    aspect-ratio: 16/9;
  }

  /* FIXED BOTTOM DOCK (208px) */
  .mobile-dock-bg {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 208px;
    background: var(--dock-bg);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    border-top: 1px solid var(--border-color);
    box-shadow: var(--dock-shadow);
    z-index: 998;
    pointer-events: none;
  }

  .preview-container {
    position: fixed !important;
    bottom: 72px !important;
    height: 122px !important;
    min-height: 0 !important;
    max-height: 122px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    z-index: 999 !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    pointer-events: none !important;
  }

  .preview-container canvas {
    max-height: 106px !important;
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block !important;
    margin: 0 auto !important;
  }

  .btn-main,
  .studio-preview-col .btn-main {
    position: fixed !important;
    bottom: 14px !important;
    left: 16px !important;
    right: 16px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    height: 48px !important;
    min-height: 44px !important;
    z-index: 1000 !important;
    box-shadow: none !important;
  }

  .studio-preview-col .crafted-by {
    display: block;
    margin: 22px 0 0 0;
    text-align: center;
    width: 100%;
  }

  /* MODAL EN MÓVIL (COMPACTO Y PROTEGIDO FRENTE A TECLADO VIRTUAL) */
  .modal-overlay {
    padding: max(16px, env(safe-area-inset-top, 16px)) 16px max(16px, env(safe-area-inset-bottom, 16px)) 16px;
    align-items: flex-start;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .modal-card {
    margin: auto;
    max-height: calc(100dvh - 32px);
    padding: 22px 20px 24px 20px;
  }

  #feedbackForm {
    gap: 14px;
  }

  .modal-card .btn-main {
    position: static !important;
    width: 100% !important;
    margin-top: 14px !important;
    transform: none !important;
    pointer-events: auto !important;
  }

  body.modal-open .mobile-dock-bg,
  body.modal-open #btnDownload,
  body.modal-open #previewContainer,
  body.modal-open .btn-menu-mobile,
  body.modal-open .header-actions-dropdown {
    display: none !important;
  }

  /* TRANSICIONES DEL DOCK FLOTANTE */
  .mobile-dock-bg,
  .preview-container,
  #btnDownload,
  .studio-preview-col .btn-main {
    transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, background-color 0.25s ease, border-color 0.2s ease !important;
  }

  /* VIRTUAL KEYBOARD AVOIDANCE (DESLIZA EL DOCK SUAVEMENTE FUERA DE LA VISTA AL ESCRIBIR EN LA PANTALLA PRINCIPAL) */
  body.keyboard-open {
    padding-bottom: 24px !important;
  }

  body.keyboard-open .mobile-dock-bg,
  body.keyboard-open .preview-container,
  body.keyboard-open #btnDownload,
  body.keyboard-open .studio-preview-col .btn-main {
    transform: translateY(240px) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }

  /* Blindaje total para que los botones del modal jamás sean afectados por keyboard-open */
  body.keyboard-open .modal-card .btn-main,
  body.keyboard-open .modal-overlay .btn-main {
    transform: none !important;
    pointer-events: auto !important;
  }
}

/* Mobile PWA / Standalone Safe Area & Native Scrollbar Removal */
@media (max-width: 800px) and (display-mode: standalone),
       (max-width: 800px) and (display-mode: fullscreen),
       (max-width: 800px) and (display-mode: minimal-ui) {
  body {
    padding-top: max(62px, calc(env(safe-area-inset-top, 0px) + 24px));
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }

  body::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .app-header {
    margin: 10px 0 18px 0;
  }
}

html.is-pwa body {
  padding-top: max(62px, calc(env(safe-area-inset-top, 0px) + 24px)) !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

html.is-pwa body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html.is-pwa .app-header {
  margin: 10px 0 18px 0 !important;
}


/* =========================================================================
   SEO & KNOWLEDGE GUIDE (BELOW-THE-FOLD)
   ========================================================================= */
.seo-guide-section {
  width: 100%;
  margin-top: 56px;
  padding-top: 48px;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.seo-block {
  width: 100%;
}

.seo-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-tint);
  color: var(--primary);
  border: 1px solid var(--primary-ring);
  padding: 4px 12px;
  border-radius: 999px;
  font-family: var(--font-primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.seo-header-badge .material-icons-outlined {
  font-size: 14px;
}

.seo-main-title {
  font-family: var(--font-primary);
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 800;
  letter-spacing: -0.8px;
  color: var(--text);
  margin: 0 0 12px 0;
  line-height: 1.25;
}

.seo-lead-text {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 28px 0;
  max-width: 720px;
}

.seo-section-title {
  font-family: var(--font-primary);
  font-size: clamp(18px, 2.5vw, 22px);
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text);
  margin: 0 0 24px 0;
  line-height: 1.3;
}

/* Steps Grid */
.seo-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.seo-step-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.seo-step-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.seo-step-num {
  font-family: var(--font-primary);
  font-size: 12px;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}

.seo-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  margin-bottom: 16px;
}

.seo-step-icon .material-icons-outlined {
  font-size: 20px;
}

.seo-step-title {
  font-family: var(--font-primary);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0 0 8px 0;
}

.seo-step-desc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* Features Grid */
.seo-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.seo-feature-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 22px 20px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  transition: border-color 0.2s ease;
}

.seo-feature-card:hover {
  border-color: var(--border-strong);
}

.seo-feature-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 12px;
  background: var(--primary-tint);
  border: 1px solid var(--primary-ring);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-feature-icon .material-icons-outlined {
  font-size: 22px;
}

.seo-feature-title {
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px 0;
}

.seo-feature-desc {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

/* FAQs */
.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.seo-faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.seo-faq-item:hover {
  border-color: var(--border-strong);
}

.seo-faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  font-family: var(--font-primary);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
  gap: 12px;
}

.seo-faq-question::-webkit-details-marker {
  display: none;
}

.seo-faq-arrow {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  font-size: 20px;
  flex-shrink: 0;
}

.seo-faq-item[open] .seo-faq-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.seo-faq-answer {
  padding: 0 20px 18px 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.6;
}

.seo-faq-answer p {
  margin: 0;
}

/* Extended Footer */
.seo-footer {
  margin-top: 12px;
  padding: 32px 0 16px 0;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.seo-footer-inner p {
  margin: 0 0 6px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.seo-footer-inner a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 700;
}

.seo-footer-inner a:hover {
  text-decoration: underline;
}

.seo-footer-sub {
  font-size: 11px !important;
  color: var(--text-dim) !important;
  font-weight: 400 !important;
}

/* Mobile Adjustments for SEO section */
@media (max-width: 800px) {
  .seo-guide-section {
    margin-top: 36px;
    padding-top: 28px;
    gap: 32px;
    margin-bottom: 32px;
  }

  .seo-steps-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .seo-features-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .seo-step-card,
  .seo-feature-card {
    padding: 18px 16px;
  }

  .seo-faq-question {
    padding: 16px;
    font-size: 13px;
  }

  .seo-faq-answer {
    padding: 0 16px 16px 16px;
    font-size: 12.5px;
  }
}
