/* =============================================
   DESIGNAR SOUVENIRS — Landing "Diseña tu imán con IA"
   Se carga después de style.css y landing-funnel.css
   ============================================= */

[hidden] { display: none !important; }

.ia-intro { text-align: center; max-width: 680px; margin: 0 auto 32px; }
.ia-card-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.ia-card-text { font-size: 14px; color: var(--text-mid); }
.funnel-offer-box a.btn-cta-main { text-decoration: none; }

/* Estructura: pasos a la izquierda, vista previa fija a la derecha */
.ia-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  grid-template-areas:
    "s1 result"
    "s2 result"
    "s3 result";
  gap: 20px 32px;
  align-items: start;
}
.ia-builder > .ia-step:nth-of-type(1) { grid-area: s1; }
.ia-builder > .ia-step:nth-of-type(2) { grid-area: s2; }
.ia-builder > .ia-step--buy { grid-area: s3; }
.ia-result { grid-area: result; position: sticky; top: 20px; }

.ia-step {
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--r-lg, 16px);
  padding: 24px;
}
.ia-step__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
  color: var(--toh-dark);
  margin-bottom: 16px;
}
.ia-step__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.ia-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-mid);
  margin: 18px 0 8px;
}
.ia-label small, .ia-option small, .ia-pack small { font-weight: 400; color: var(--text-light); }

/* Opciones */
.ia-options { display: grid; gap: 10px; }
.ia-options--formats, .ia-options--packs { grid-template-columns: repeat(3, 1fr); }
.ia-options--styles { display: flex; flex-wrap: wrap; gap: 8px; }

.ia-option, .ia-pack, .ia-chip, .ia-tab {
  font: inherit;
  cursor: pointer;
  background: var(--cream);
  border: 2px solid var(--beige-dark);
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.ia-option:hover, .ia-pack:hover, .ia-chip:hover, .ia-tab:hover { border-color: var(--nublado); }
.ia-option.active, .ia-pack.active, .ia-chip.active, .ia-tab.active {
  border-color: var(--accent);
  background: #F7F4E8;
}
.ia-option:focus-visible, .ia-pack:focus-visible, .ia-chip:focus-visible, .ia-tab:focus-visible {
  outline: 3px solid rgba(132, 118, 55, .35);
  outline-offset: 2px;
}

.ia-option {
  border-radius: var(--r-md, 12px);
  padding: 14px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 14px;
}
.ia-shape {
  display: block;
  background: linear-gradient(135deg, var(--piel), var(--barro));
  border-radius: 6px;
  margin-bottom: 6px;
  box-shadow: 0 2px 4px rgba(0,0,0,.15);
}
.ia-shape--vertical { width: 30px; height: 40px; }
.ia-shape--horizontal { width: 40px; height: 30px; margin-top: 5px; margin-bottom: 11px; }
.ia-shape--cuadrado { width: 35px; height: 35px; margin-top: 2px; margin-bottom: 9px; }

.ia-chip { border-radius: 999px; padding: 8px 14px; font-size: 14px; }

.ia-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ia-tab { border-radius: var(--r-sm, 8px); padding: 12px; font-weight: 700; font-size: 14px; }

/* Subir foto */
.ia-upload__drop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  border: 2px dashed var(--nublado);
  border-radius: var(--r-md, 12px);
  background: var(--cream);
  cursor: pointer;
  text-align: center;
  font-weight: 700;
  color: var(--text-mid);
  padding: 16px;
  overflow: hidden;
}
.ia-upload__drop:hover { border-color: var(--accent); }
.ia-upload__drop small { font-weight: 400; color: var(--text-light); }
.ia-upload__drop img { max-height: 220px; max-width: 100%; border-radius: 8px; object-fit: contain; }

.ia-link {
  background: none;
  border: 0;
  padding: 2px 0;
  font: inherit;
  font-size: 13px;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}
.ia-ideas { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; margin-top: 8px; font-size: 13px; color: var(--text-light); }

textarea.form-control { resize: vertical; font-family: inherit; }
.ia-generate { margin-top: 20px; }
.btn-cta-main:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.ia-error {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: var(--r-sm, 8px);
  background: #FDECEA;
  color: #8A1C12;
  font-size: 14px;
}

/* Vista previa tipo imán */
.ia-result {
  background: var(--white);
  border: 1px solid var(--beige-dark);
  border-radius: var(--r-lg, 16px);
  padding: 28px 24px;
  text-align: center;
}
.ia-magnet {
  position: relative;
  margin: 0 auto;
  width: 100%;
  border-radius: 14px;
  background: #EFE7D8;
  box-shadow:
    0 0 0 5px #D8C4A0,        /* canto de la madera de 3 mm */
    0 14px 28px rgba(0,0,0,.22);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ia-magnet--vertical { max-width: 300px; aspect-ratio: 3 / 4; }
.ia-magnet--horizontal { max-width: 380px; aspect-ratio: 4 / 3; }
.ia-magnet--cuadrado { max-width: 330px; aspect-ratio: 1 / 1; }
.ia-magnet img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ia-magnet__empty { color: var(--text-light); font-weight: 700; font-size: 15px; padding: 20px; }
.ia-magnet__loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-mid);
  font-weight: 700;
  font-size: 14px;
  padding: 20px;
}
.ia-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--beige-dark);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: ia-spin 0.9s linear infinite;
}
@keyframes ia-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ia-spinner { animation-duration: 3s; } }

.ia-result__note { font-size: 12px; color: var(--text-light); margin-top: 18px; }

.ia-history { margin-top: 12px; text-align: left; }
.ia-history__list { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.ia-history__item {
  flex: 0 0 60px;
  height: 60px;
  padding: 0;
  border: 2px solid var(--beige-dark);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  background: var(--cream);
}
.ia-history__item.active { border-color: var(--accent); }
.ia-history__item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Paquetes */
.ia-pack {
  position: relative;
  border-radius: var(--r-md, 12px);
  padding: 18px 8px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  text-align: center;
}
.ia-pack__price { font-size: 22px; font-weight: 800; color: var(--toh-dark); }
.ia-pack__tag {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: var(--white);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}
.ia-step--buy .btn-cta-main { margin-top: 18px; }
.ia-footnote { text-align: center; font-size: 12px; color: var(--text-light); margin-top: 20px; }

/* Checkout */
.ia-checkout-head { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; padding-right: 24px; }
.ia-checkout-head img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 3px #D8C4A0; }
.ia-checkout-head h3 { font-size: 20px; font-weight: 800; color: var(--toh-dark); }
.ia-checkout-head p { font-size: 13px; color: var(--text-mid); }
.ia-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--cream);
  padding: 14px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: 700;
}
.ia-total strong { font-size: 22px; font-weight: 800; color: var(--toh-dark); white-space: nowrap; }

/* Celular: vista previa entre el paso 2 y el 3 */
@media (max-width: 900px) {
  .ia-builder {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "s1" "s2" "result" "s3";
  }
  .ia-result { position: static; }
}
@media (max-width: 480px) {
  .ia-step { padding: 18px 16px; }
  .ia-options--formats, .ia-options--packs { gap: 8px; }
  .ia-option, .ia-pack { padding-left: 4px; padding-right: 4px; font-size: 13px; }
  .ia-pack__price { font-size: 18px; }
  .ia-pack__tag { font-size: 9px; }
}
