/* ============================================================
   Óptica Carampangue — Probador virtual de lentes (Etapa 5)
   Cámara/foto + overlay de armazón, simulador de tratamientos y
   medición referencial de DP. Extiende tokens de sitio.css/tienda.css.
   Mobile-first, sin CDNs.
   ============================================================ */
.prob-wrap{padding-top:36px}

/* Varios elementos del probador (botones .btn, .prob-empty) fijan su propio
   `display` vía clase; sin esta regla el atributo `hidden` del navegador no
   gana la cascada (mismo origen "author", especificidad similar) y el
   elemento queda visible igual. Se fuerza explícitamente. */
#probApp [hidden]{display:none!important}

/* ===== Selector de armazón ===== */
.prob-picker{display:flex;gap:10px;overflow-x:auto;padding:4px 2px 14px;margin-bottom:18px;
  scrollbar-width:thin}
.prob-pick{flex:0 0 auto;width:84px;display:flex;flex-direction:column;align-items:center;gap:6px;
  border:1.5px solid var(--line);border-radius:14px;background:#fff;padding:8px 6px 9px;cursor:pointer;
  transition:.15s;min-height:44px}
.prob-pick:hover{border-color:var(--aqua)}
.prob-pick.on{border-color:var(--lente);background:var(--lente-bg);box-shadow:var(--sh-sm)}
.prob-pick img{width:100%;aspect-ratio:480/340;object-fit:cover;border-radius:9px;background:var(--bg)}
.prob-pick span{font-size:10px;font-weight:700;color:var(--navy);text-align:center;line-height:1.2;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}

/* ===== Layout general ===== */
.prob-grid{display:grid;grid-template-columns:1fr 340px;gap:22px;align-items:start}
@media(max-width:960px){.prob-grid{grid-template-columns:1fr}}

.prob-stage-card{background:#fff;border:1px solid var(--line);border-radius:var(--r-lg);
  box-shadow:var(--sh-sm);padding:16px;position:sticky;top:82px}
@media(max-width:960px){.prob-stage-card{position:static}}

.prob-stage-wrap{position:relative;width:100%;aspect-ratio:4/3;background:linear-gradient(135deg,#0F3F68,#0a2e4d);
  border-radius:14px;overflow:hidden;touch-action:none}
#probVideo,#probCanvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;
  background:#0a2e4d}
.prob-empty{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:10px;color:rgba(255,255,255,.75);text-align:center;padding:24px}
.prob-empty svg{stroke:var(--aqua);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;opacity:.9}
.prob-empty p{font-size:12.5px;max-width:220px;line-height:1.5;margin:0}

/* ===== Overlay del armazón ===== */
.prob-overlay-wrap{position:absolute;left:0;top:0;width:180px;height:90px;pointer-events:auto;cursor:grab;
  transform-origin:center center;touch-action:none}
.prob-overlay-wrap.dragging{cursor:grabbing}
.prob-overlay-img{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;user-select:none;
  filter:drop-shadow(0 3px 6px rgba(0,0,0,.35))}
.prob-lens{position:absolute;width:38.33%;height:38.33%;border-radius:50%;top:30.83%;overflow:hidden;
  pointer-events:none;transition:background-color .35s}
.prob-lens-l{left:5%}
.prob-lens-r{left:56.67%}
.prob-lens .prob-glare{position:absolute;top:14%;left:18%;width:34%;height:20%;border-radius:50%;
  background:rgba(255,255,255,.55);filter:blur(2px);transform:rotate(-22deg);transition:opacity .35s}
.prob-overlay-wrap.fx-azul .prob-lens{background:rgba(60,120,255,.24)}
.prob-overlay-wrap.fx-foto .prob-lens{background:rgba(20,18,15,.12);transition:background-color 1.1s var(--ease)}
.prob-overlay-wrap.fx-foto.sol-on .prob-lens{background:rgba(20,18,15,.62)}
.prob-overlay-wrap.fx-polarizado .prob-lens{background:rgba(30,40,50,.22)}
.prob-overlay-wrap.fx-noglare .prob-glare{opacity:0}
.prob-overlay-wrap.reduce-motion .prob-lens,
.prob-overlay-wrap.reduce-motion .prob-glare{transition:none}

/* ===== Calibración DP ===== */
.prob-calib{position:absolute;left:0;top:18%;width:100%;pointer-events:none}
.prob-calib-bar{position:absolute;top:0;height:0;border-top:3px dashed #f6c945}
.prob-calib-handle{position:absolute;top:50%;width:26px;height:26px;margin:-13px 0 0 -13px;border-radius:50%;
  background:#f6c945;border:3px solid #7a5a0c;box-shadow:0 2px 6px rgba(0,0,0,.35);cursor:ew-resize;
  pointer-events:auto;touch-action:none}
@media(max-width:560px){.prob-calib-handle{width:30px;height:30px;margin:-15px 0 0 -15px}}

/* ===== Estado / avisos ===== */
.prob-status{position:absolute;left:10px;bottom:10px;right:10px;background:rgba(15,63,104,.88);color:#fff;
  font-size:11.5px;font-weight:600;padding:8px 12px;border-radius:10px;backdrop-filter:blur(4px);
  display:flex;align-items:center;gap:8px}
.prob-status.warn{background:rgba(201,138,20,.92)}
.prob-status.ok{background:rgba(31,157,107,.92)}
.prob-status .dot{width:7px;height:7px;border-radius:50%;background:#fff;flex:0 0 auto}

/* ===== Barra de acciones ===== */
.prob-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin-top:14px}
.prob-toolbar .btn{min-height:44px}
.prob-upload{position:relative;overflow:hidden}
.prob-privacidad{font-size:11px;color:var(--muted);margin-top:10px;text-align:center}

/* ===== Panel lateral ===== */
.prob-side{display:flex;flex-direction:column;gap:16px}
.prob-card{background:#fff;border:1px solid var(--line);border-radius:var(--r-lg);box-shadow:var(--sh-sm);padding:18px}
.prob-card-h{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.prob-card-ico{width:32px;height:32px;border-radius:9px;background:var(--lente-bg);display:grid;place-items:center;flex:0 0 auto}
.prob-card-ico svg{width:17px;height:17px;stroke:var(--lente);fill:none;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.prob-card h2{font-size:14.5px;font-weight:700;color:var(--navy)}
.prob-card-sub{font-size:12px;color:var(--muted);line-height:1.5;margin-bottom:14px}

/* Sliders */
.prob-slider{display:block;margin-bottom:14px}
.prob-slider span{display:flex;justify-content:space-between;font-size:11.5px;font-weight:700;color:var(--navy);
  text-transform:uppercase;letter-spacing:.3px;margin-bottom:6px}
.prob-slider span b{color:var(--lente);font-weight:800}
.prob-slider input[type=range]{width:100%;-webkit-appearance:none;appearance:none;height:6px;border-radius:999px;
  background:var(--line);outline:none;min-height:24px}
.prob-slider input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:22px;height:22px;border-radius:50%;
  background:var(--lente);border:3px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.25);cursor:pointer}
.prob-slider input[type=range]::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:var(--lente);
  border:3px solid #fff;box-shadow:0 2px 6px rgba(0,0,0,.25);cursor:pointer}
.prob-manual-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-top:4px}
.prob-check{display:flex;align-items:center;gap:8px;font-size:12px;font-weight:600;color:var(--navy);cursor:pointer;
  min-height:24px}
.prob-check input{width:18px;height:18px;accent-color:var(--lente)}

/* Tratamientos */
.prob-trat-list{display:flex;flex-direction:column;gap:8px}
.prob-trat{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1.5px solid var(--line);border-radius:12px;
  cursor:pointer;transition:.15s;min-height:44px}
.prob-trat:hover{border-color:var(--aqua)}
.prob-trat.on{border-color:var(--lente);background:var(--lente-bg)}
.prob-trat input{width:17px;height:17px;accent-color:var(--lente);flex:0 0 auto}
.pt-name{flex:1;font-size:12.5px;font-weight:600;color:var(--navy)}
.pt-price{font-size:12px;font-weight:800;color:var(--lente);white-space:nowrap}
.prob-sol-toggle{margin-top:12px;background:var(--amber-bg);color:#7a5a0c;padding:10px 12px;border-radius:11px}
.prob-sol-toggle input{accent-color:var(--amber)}

/* DP */
.prob-dp-steps{margin:0 0 14px;padding-left:18px;font-size:12px;color:var(--muted);line-height:1.6}
.prob-dp-panel{margin-top:14px;padding-top:14px;border-top:1px solid var(--line)}
.prob-dp-result{margin-top:14px;background:var(--bg);border-radius:12px;padding:14px;text-align:center}
.prob-dp-result b{display:block;font-size:22px;color:var(--lente);font-weight:800;letter-spacing:-.3px;margin:2px 0 6px}
.prob-dp-result span{display:block;font-size:11px;color:var(--muted);text-transform:uppercase;letter-spacing:.3px;font-weight:700}
.prob-dp-result small{display:block;font-size:11px;color:var(--muted);margin-top:8px;line-height:1.5}
.prob-dp-result .btn{width:100%;justify-content:center;margin-top:12px}
