/* ═══════════════════════════════════════════════════════════
   Ahá Herramientas Digitales · Marca de agua (/marca-de-agua)
   ═══════════════════════════════════════════════════════════ */
.ma .dropzone { padding: 34px 18px; }
.ma .dropzone.compact { padding: 14px; }
.ma .dropzone.over { border-color: var(--orange); background: var(--orange-50); }
.ma kbd { font: inherit; font-size: .78em; font-weight: 700; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; background: #fff; color: var(--ink-2); }
.ma-priv { text-align: center; font-size: .88rem; color: var(--ink-2); margin: 12px 0 0; }
.ma-priv b { color: var(--navy); }
.ma-err { margin-top: 12px; white-space: pre-line; }
.ma .tc-tit { display: flex; align-items: center; gap: 8px; }
.ma-n { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--navy); color: #fff; font-size: .8rem; font-weight: 800; flex-shrink: 0; }
.ma-sub { margin-top: 22px; }

/* Fotos cargadas */
.ma-fotos-wrap { margin-top: 18px; }
.ma-fotos-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ma-fotos-head .tc-tit { margin: 0; }
.ma-fotos { list-style: none; margin: 10px 0 0; padding: 4px 2px 8px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.ma-foto { position: relative; flex: 0 0 auto; scroll-snap-align: start; }
.ma-foto-btn { display: block; width: 76px; height: 76px; padding: 0; border: 2px solid var(--line); border-radius: 12px; overflow: hidden; cursor: pointer;
  background: #fff conic-gradient(#eef1f6 25%, #fff 0 50%, #eef1f6 0 75%, #fff 0) 0 0 / 12px 12px; }
.ma-foto-btn canvas { width: 100%; height: 100%; display: block; }
.ma-foto-btn[aria-current=true] { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(254, 130, 2, .2); }
.ma-foto-x { position: absolute; top: -6px; right: -6px; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font: inherit; font-size: 15px; line-height: 1; cursor: pointer; display: grid; place-items: center; padding: 0; box-shadow: var(--shadow); }
.ma-foto-x:hover { color: var(--err); border-color: var(--err); }

/* Opciones */
.ma-grid { margin-top: 22px; }
.ma .tabs { margin-bottom: 14px; overflow: visible; }
.ma-panel { display: flex; flex-direction: column; gap: 12px; }
.ma-lbl { display: block; font-weight: 700; font-size: .88rem; margin-bottom: -4px; }
.ma-campo { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.ma-campo input { width: 100%; }
.ma-fila { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; }
.ma-color { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: .9rem; }
.ma-check { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.ma-check input { width: 18px; height: 18px; accent-color: var(--orange); flex-shrink: 0; }

.ma-logo-zona { display: flex; gap: 14px; align-items: center; padding: 12px; border: 2px dashed #c9d5ec; border-radius: 14px; background: var(--bg); transition: border-color .12s, background .12s; }
.ma-logo-zona.over { border-color: var(--orange); background: var(--orange-50); }
.ma-logo-prev { width: 92px; height: 92px; flex-shrink: 0; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden;
  background: #fff conic-gradient(#eef1f6 25%, #fff 0 50%, #eef1f6 0 75%, #fff 0) 0 0 / 12px 12px; }
.ma-logo-prev span { font-size: .75rem; color: var(--muted); font-weight: 600; }
.ma-logo-prev canvas { max-width: 84px; max-height: 84px; width: auto; height: auto; display: block; }
.ma-logo-acc { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }

.ma-pos-wrap { display: flex; gap: 14px; align-items: stretch; flex-wrap: wrap; margin-top: 4px; }
.ma-pos { display: grid; grid-template-columns: repeat(3, 38px); gap: 4px; padding: 5px; background: #fff; border: 1.5px solid var(--line); border-radius: 12px; width: max-content; }
.ma-p { width: 38px; height: 30px; border: 0; border-radius: 7px; background: var(--bg); cursor: pointer; display: grid; place-items: center; padding: 0; }
.ma-p span { width: 10px; height: 10px; border-radius: 3px; background: #c3cbdb; }
.ma-p:hover span { background: var(--blue); }
.ma-p[aria-pressed=true] { background: var(--orange-50); }
.ma-p[aria-pressed=true] span { background: var(--orange); width: 14px; height: 14px; }
.ma-mosaico { flex: 1 1 170px; display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; color: var(--ink); }
.ma-mosaico:hover { border-color: var(--blue); }
.ma-mosaico[aria-pressed=true] { border-color: var(--orange); background: var(--orange-50); }
.ma-mosaico b { display: block; font-size: .92rem; color: var(--navy); }
.ma-mosaico small { display: block; font-size: .78rem; color: var(--muted); line-height: 1.35; }
.ma-mosaico-ico { width: 40px; height: 40px; flex-shrink: 0; border-radius: 8px;
  background: repeating-linear-gradient(-35deg, #c3cbdb 0 4px, transparent 4px 11px), var(--bg); }
.ma-mosaico[aria-pressed=true] .ma-mosaico-ico { background: repeating-linear-gradient(-35deg, var(--orange) 0 4px, transparent 4px 11px), #fff; }

.ma-sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-top: 16px; }
.ma-slider { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: .88rem; }
.ma-slider b { color: var(--navy); }
.ma-reset { margin-top: 14px; }

/* Vista previa */
.ma-prev { min-height: 260px; }
.ma-prev canvas { width: auto; height: auto; max-width: 100%; max-height: 460px; border-radius: 4px; box-shadow: 0 2px 10px rgba(20, 35, 70, .18); }
.ma-nav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 8px; }
.ma-nav .btn { min-width: 42px; font-size: 1.1rem; }
#maCap { min-height: 1.2em; overflow-wrap: anywhere; }

/* Formato y descarga */
.ma-final { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.ma-fmt .opt { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.ma-fmt select { width: 100%; }
.ma-acciones { margin-top: 14px; }
.ma-estado { text-align: right; margin: 8px 0 0; min-height: 1.2em; }

/* Resultados */
.ma-res { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.ma-res li { border: 1px solid var(--line); border-radius: 12px; padding: 8px; display: flex; flex-direction: column; gap: 6px; background: #fff; min-width: 0; }
.ma-res .ma-res-img { height: 120px; display: grid; place-items: center; border-radius: 8px; overflow: hidden;
  background: #fff conic-gradient(#eef1f6 25%, #fff 0 50%, #eef1f6 0 75%, #fff 0) 0 0 / 12px 12px; }
.ma-res img { max-width: 100%; max-height: 120px; width: auto; height: auto; }
.ma-res-nom { font-size: .78rem; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; line-height: 1.3; margin: 0; }
.ma-res-meta { font-size: .74rem; color: var(--muted); margin: 0; }
.ma-res .btn { margin-top: auto; }

@media (max-width: 860px) {
  .ma-grid { grid-template-columns: minmax(0, 1fr); }
  /* En celular la vista previa queda arriba y fija mientras movés los controles */
  .ma-con-fotos .ma-grid > .ma-col-prev { order: -1; position: sticky; top: 64px; z-index: 5; background: #fff; padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
  .ma-col-prev > .tc-tit { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ma-prev { min-height: 0; padding: 6px; }
  .ma-prev canvas { max-height: 30vh; }
  .ma-prev .vacio { padding: 18px 10px; }
  .ma-nav { margin-top: 4px; }
  #maCap { margin-top: 4px; font-size: .74rem; }
}
@media (max-width: 640px) {
  .ma .dropzone { padding: 24px 14px; }
  .ma-fmt > * { flex-basis: 100%; }
  .ma-sliders { grid-template-columns: 1fr; }

  .ma-logo-zona { flex-direction: column; align-items: flex-start; }
  .ma-res { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ma-res .ma-res-img { height: 96px; }
  .ma-res img { max-height: 96px; }
  .ma-estado { text-align: center; }
  .ma .resultado-head .btn { width: 100%; }
}
