/* ══════════════════════════════════════════════════════════════════
   CONTROLES EK — ver ek-controls.js. Solo tokens del tema (ek.css):
   los 5 colores de marca, DM Mono para valores y opciones, Satoshi
   para el título del mes.
   ══════════════════════════════════════════════════════════════════ */

/* el nativo se queda (es la fuente de verdad) pero fuera de vista */
.ekc-native {
  position:absolute !important; width:1px !important; height:1px !important;
  margin:0 !important; padding:0 !important; border:0 !important;
  opacity:0 !important; pointer-events:none !important;
  clip-path:inset(50%) !important; overflow:hidden !important;
}

/* ── BOTÓN ──────────────────────────────────────────────────────────
   Hereda las clases del control original (sc-input, auth-input,
   ekp-input…): borde, padding y tipografía salen de la página. Acá
   solo lo estructural, y valores base de especificidad cero por si
   la página no define alguno. */
:where(.ekc-trigger) { font:inherit; color:inherit; background:none; border:0; padding:0; margin:0; }
button.ekc-trigger {
  display:flex; align-items:center; justify-content:space-between; gap:8px;
  text-align:left; cursor:pointer; min-width:0;
  -webkit-appearance:none; appearance:none;
  -webkit-tap-highlight-color:transparent; touch-action:manipulation;
}
button.ekc-trigger:disabled { cursor:default; opacity:.5; }
.ekc-val { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ekc-trigger.is-empty .ekc-val { color:var(--t3,#747474); }
.ekc-chev, .ekc-ico {
  width:13px; height:13px; flex-shrink:0;
  fill:none; stroke:var(--t3,#747474); stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round;
  transition:transform .18s;
}
.ekc-trigger.is-open .ekc-chev { transform:rotate(180deg); }
.ekc-trigger.is-open { border-color:var(--t2,#464646); }

/* ── PANEL (escritorio: junto al campo) ─────────────────────────── */
.ekc-panel {
  position:fixed; z-index:10050; display:flex; flex-direction:column;
  background:var(--surf,#FFFFFF); color:var(--t1,#181818);
  border:.5px solid var(--brd,rgba(116,116,116,.4)); border-radius:6px;
  box-shadow:0 16px 48px rgba(24,24,24,.12);
  font-family:'DM Mono',monospace; font-size:12px; line-height:1.3;
  opacity:0; transform:translateY(-6px) scale(.98); transform-origin:top center;
  transition:opacity .16s ease, transform .16s ease;
  pointer-events:none; overflow:hidden;
}
.ekc-panel.is-up { transform-origin:bottom center; transform:translateY(6px) scale(.98); }
.ekc-panel.is-open { opacity:1; transform:none; pointer-events:auto; }
.ekc-body {
  position:relative; flex:1 1 auto; min-height:0;
  overflow-y:auto; -webkit-overflow-scrolling:touch; overscroll-behavior:contain;
  padding:5px;
}
.ekc-panel svg { fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }

/* ── LISTA ──────────────────────────────────────────────────────── */
.ekc-list { list-style:none; margin:0; padding:0; outline:none; }
.ekc-opt {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  min-height:36px; padding:0 10px; border-radius:4px;
  font-size:11.5px; letter-spacing:.02em; color:var(--t2,#464646);
  cursor:pointer; user-select:none; -webkit-user-select:none;
}
.ekc-opt.is-active { background:var(--bg,#F1F1F1); color:var(--t1,#181818); }
.ekc-opt.is-sel { color:var(--t1,#181818); }
.ekc-check { width:14px; height:14px; flex-shrink:0; visibility:hidden; }
.ekc-opt.is-sel .ekc-check { visibility:visible; }
.ekc-opt.is-off { color:var(--t3,#747474); opacity:.5; cursor:default; }

/* ── CALENDARIO ─────────────────────────────────────────────────── */
.ekc-panel-date .ekc-body { padding:12px 12px 10px; }
.ekc-cal-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:6px; }
.ekc-cal-title {
  font-family:'Satoshi',sans-serif; font-weight:700; text-transform:uppercase;
  font-size:13px; letter-spacing:.02em; color:var(--t1,#181818);
}
.ekc-nav {
  width:34px; height:34px; flex-shrink:0; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  border:.5px solid transparent; background:none; color:var(--t2,#464646); cursor:pointer;
  transition:border-color .15s, color .15s;
}
.ekc-nav svg { width:15px; height:15px; }
.ekc-nav:hover { border-color:var(--brd,rgba(116,116,116,.4)); color:var(--t1,#181818); }
.ekc-nav:disabled { opacity:.25; cursor:default; border-color:transparent; }
.ekc-cal-grid { display:grid; grid-template-columns:repeat(7,1fr); gap:2px; }
.ekc-dow {
  text-align:center; padding:6px 0 7px;
  font-size:9px; letter-spacing:.16em; color:var(--t3,#747474);
}
.ekc-day {
  height:36px; border:0; border-radius:50%; background:none;
  display:flex; align-items:center; justify-content:center;
  font-family:'DM Mono',monospace; font-size:12px; color:var(--t1,#181818);
  cursor:pointer; touch-action:manipulation; transition:background .12s;
}
.ekc-day:hover { background:var(--bg,#F1F1F1); }
.ekc-day.is-today { box-shadow:inset 0 0 0 1px var(--t3,#747474); }
.ekc-day.is-sel, .ekc-day.is-sel:hover { background:var(--t1,#181818); color:var(--surf,#FFFFFF); box-shadow:none; }
.ekc-day:disabled { color:var(--t3,#747474); opacity:.35; cursor:default; background:none; }
.ekc-day:focus { outline:none; }
.ekc-day:focus-visible { outline:1.5px solid var(--t1,#181818); outline-offset:1px; }
.ekc-cal-foot { display:flex; margin-top:8px; padding-top:6px; border-top:.5px solid var(--brd,rgba(116,116,116,.4)); }
.ekc-link {
  background:none; border:0; cursor:pointer; padding:8px 4px;
  font-family:'DM Mono',monospace; font-size:9.5px; letter-spacing:.18em; text-transform:uppercase;
  color:var(--t2,#464646);
}
.ekc-link:hover { color:var(--t1,#181818); }

/* ── TELÉFONO: hoja desde abajo, targets de dedo ────────────────── */
.ekc-scrim {
  position:fixed; inset:0; z-index:10040; background:rgba(24,24,24,.38);
  opacity:0; transition:opacity .22s;
}
.ekc-scrim.is-open { opacity:1; }
.ekc-panel.is-sheet {
  left:0; right:0; bottom:0; top:auto; width:auto;
  max-height:min(72vh,560px); border-radius:16px 16px 0 0; border-bottom:0;
  padding-bottom:env(safe-area-inset-bottom);
  opacity:1; transform:translateY(100%); transition:transform .3s cubic-bezier(.22,1,.36,1);
  box-shadow:0 -10px 50px rgba(24,24,24,.16);
}
.ekc-panel.is-sheet.is-open { transform:none; }
.ekc-sheet-head {
  display:flex; align-items:center; justify-content:space-between; gap:12px; flex-shrink:0;
  padding:10px 10px 10px 20px; border-bottom:.5px solid var(--brd,rgba(116,116,116,.4));
}
.ekc-sheet-title { font-size:9.5px; letter-spacing:.22em; text-transform:uppercase; color:var(--t3,#747474); }
.ekc-x {
  width:44px; height:44px; border-radius:50%; border:0; background:none; cursor:pointer;
  display:flex; align-items:center; justify-content:center; color:var(--t2,#464646);
}
.ekc-x svg { width:18px; height:18px; }
.is-sheet .ekc-body { padding:8px 10px 14px; }
.is-sheet .ekc-opt { min-height:50px; padding:0 14px; font-size:14px; }
.is-sheet.ekc-panel-date .ekc-body { padding:14px 16px 12px; }
.is-sheet .ekc-day { height:46px; font-size:14px; }
.is-sheet .ekc-nav { width:44px; height:44px; }
.is-sheet .ekc-cal-title { font-size:15px; }

@media (prefers-reduced-motion:reduce) {
  .ekc-panel, .ekc-panel.is-up, .ekc-panel.is-sheet { transform:none; transition:opacity .12s; }
  .ekc-panel.is-sheet { opacity:0; }
  .ekc-panel.is-sheet.is-open { opacity:1; }
}
