/* Probador virtual */

body.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }

.app-bar { height: 64px; flex: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 24px; border-bottom: 1px solid var(--line); }
.app-bar__title { font-family: var(--font-display); font-weight: 480; font-variation-settings: "wdth" 108; font-size: 17px; }
.app-bar__back { color: var(--ash); font-size: 15px; }
.app-bar__back:hover { color: var(--ivory); }

.studio { flex: 1; display: grid; grid-template-columns: 1fr 400px; min-height: 0; }

/* Escenario */
.stage-wrap { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.stage { position: relative; flex: 1; min-height: 420px; border-radius: var(--r-card); background: var(--graphite); overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.handles { position: absolute; inset: 0; }
.handles[hidden] { display: none; }
.quad-outline { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.quad-outline polygon { fill: rgba(7, 17, 53, 0.18); stroke: rgba(255,255,255,.85); stroke-width: 1.25; stroke-dasharray: 6 5; }
.handle { position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; cursor: grab; touch-action: none; display: grid; place-items: center; }
.handle::before { content: ""; width: 18px; height: 18px; border-radius: 50%; background: var(--white); border: 3px solid var(--brand-tint); box-shadow: 0 0 0 4px rgba(7,17,53,.35); transition: transform .15s; }
.handle:hover::before, .handle.is-drag::before { transform: scale(1.2); }
.handle.is-drag { cursor: grabbing; }
.handle--move::before { width: 28px; height: 28px; border: 1.5px solid var(--white); background: rgba(7,17,53,.55) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3v18M3 12h18M12 3l-3 3M12 3l3 3M12 21l-3-3M12 21l3-3M3 12l3-3M3 12l3 3M21 12l-3-3M21 12l-3 3' fill='none' stroke='%23fff' stroke-width='1.5'/%3E%3C/svg%3E") center / 16px no-repeat; }
.handles.is-off .handle, .handles.is-off .quad-outline { opacity: 0; pointer-events: none; }

.empty { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 32px; gap: 18px; }
.empty[hidden] { display: none; }
.empty h1 { font-family: var(--font-display); font-weight: 480; font-variation-settings: "wdth" 106; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; margin: 8px 0 0; letter-spacing: -0.01em; }
.empty p { color: var(--ash); max-width: 440px; margin: 0; }
.empty__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.empty__actions label { cursor: pointer; }
.empty__art { width: 132px; height: 150px; border-radius: 6px; border: 1.5px solid var(--line-strong); position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; padding: 14px 10px 0; }
.empty__art::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 9px; background: var(--ash); }
.empty__art span { height: 14px; border-radius: 2px; background: var(--obsidian); transform-origin: top; animation: band 3.6s var(--ease) infinite; }
.empty__art span:nth-child(2) { animation-delay: .08s; } .empty__art span:nth-child(3) { animation-delay: .16s; } .empty__art span:nth-child(4) { animation-delay: .24s; } .empty__art span:nth-child(5) { animation-delay: .32s; } .empty__art span:nth-child(6) { animation-delay: .4s; }
@keyframes band { 0%, 20% { background: var(--obsidian); } 50%, 80% { background: var(--slate); } 100% { background: var(--obsidian); } }

.stage-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.stage-tools[hidden] { display: none; }
.tool { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 40px; border: 1px solid var(--line-strong); font-size: 14px; color: var(--ash); cursor: pointer; transition: all .2s; user-select: none; -webkit-user-select: none; }
.tool svg { width: 18px; height: 18px; }
.tool:hover { color: var(--ivory); border-color: var(--ivory); }
.tool[aria-pressed="true"] { background: var(--ivory); color: var(--onyx); border-color: var(--ivory); }
.tool.is-hold { background: var(--obsidian); color: var(--ivory); }
.hint { margin: 0; font-size: 14px; color: var(--ash); }
.hint[hidden] { display: none; }

/* Panel */
.panel { border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.panel__block { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.panel__label { font-size: 13px; font-weight: 480; color: var(--ash); margin: 0 0 14px; letter-spacing: .02em; display: flex; gap: 8px; }
.panel__label span { color: var(--ivory); font-weight: 400; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.seg button { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 6px 12px; border-radius: 12px; border: 1px solid var(--line); font-size: 13px; color: var(--ash); transition: all .2s; text-align: center; }
.seg button:hover { color: var(--ivory); border-color: var(--line-strong); }
.seg button[aria-checked="true"] { background: var(--obsidian); color: var(--ivory); border-color: var(--ivory); }
.ico { width: 36px; height: 40px; border-radius: 3px; position: relative; display: block; }
.ico--roller { background: linear-gradient(var(--ash) 0 5px, transparent 5px), linear-gradient(currentColor, currentColor) 0 5px / 100% 70% no-repeat; opacity: .8; border: 1px solid currentColor; }
.ico--duo { border: 1px solid currentColor; background: repeating-linear-gradient(180deg, currentColor 0 5px, transparent 5px 8px); opacity: .8; }
.ico--onda { border-top: 2px solid currentColor; background: repeating-linear-gradient(90deg, currentColor 0 2px, rgba(255,255,255,.12) 2px 5px, transparent 5px 7px); opacity: .8; }

.fams { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fams button { height: 32px; padding: 0 14px; border-radius: 40px; border: 1px solid var(--line); font-size: 13px; color: var(--ash); transition: all .2s; }
.fams button:hover { color: var(--ivory); }
.fams button[aria-pressed="true"] { background: var(--ivory); color: var(--onyx); border-color: var(--ivory); }
.models { display: flex; flex-wrap: wrap; gap: 6px; }
.models button { height: 34px; padding: 0 12px; border-radius: 10px; background: var(--graphite); font-size: 13px; color: var(--ash); transition: all .2s; }
.models button:hover { color: var(--ivory); }
.models button[aria-pressed="true"] { background: var(--obsidian); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--ivory); }

.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.swatches button { aspect-ratio: 1; border-radius: 50%; overflow: hidden; outline: 1.5px solid transparent; outline-offset: 2px; transition: outline-color .2s, transform .2s; background-size: cover; background-position: center; }
.swatches button:hover { transform: scale(1.06); }
.swatches button[aria-checked="true"] { outline-color: var(--ivory); }

.range { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; align-items: center; }
.range + .range { margin-top: 20px; }
.range label { font-size: 13px; font-weight: 480; color: var(--ash); }
.range output { font-size: 13px; color: var(--ivory); font-variant-numeric: tabular-nums; }
.range input { grid-column: 1 / -1; width: 100%; -webkit-appearance: none; appearance: none; height: 28px; background: transparent; }
.range input::-webkit-slider-runnable-track { height: 2px; background: var(--line-strong); border-radius: 2px; }
.range input::-moz-range-track { height: 2px; background: var(--line-strong); }
.range input::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ivory); margin-top: -10px; border: 0; }
.range input::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--ivory); border: 0; }
.range[hidden] { display: none; }

.panel__summary { margin-top: auto; padding: 22px 24px 24px; background: var(--graphite); position: sticky; bottom: 0; }
.summary { display: flex; flex-direction: column; margin-bottom: 16px; }
.summary__style { font-size: 13px; color: var(--ash); }
.summary b { font-family: var(--font-display); font-weight: 480; font-variation-settings: "wdth" 106; font-size: 20px; }
.panel__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.panel__actions .btn { padding: 0 12px; font-size: 15px; height: 48px; }
.panel__actions .btn:disabled { opacity: .4; cursor: not-allowed; }
.panel__note { margin: 14px 0 0; font-size: 12px; color: var(--slate); }

/* v3 · íconos, ayuda y tutorial */
.seg .ico { width: 40px; height: 40px; border: 0; background: none; opacity: 1; color: currentColor; }
.app-bar__right { display: flex; align-items: center; gap: 18px; }
.app-bar__help { height: 34px; padding: 0 14px; border-radius: 40px; border: 1px solid var(--line-strong); font-size: 14px; color: var(--ash); }
.app-bar__help:hover { color: var(--ivory); border-color: var(--ivory); }
.stage .mini-loader { background: rgba(7,17,53,.35); }

.tour { position: fixed; inset: 0; z-index: 100; }
.tour[hidden] { display: none; }
.tour__spot { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(3,8,28,.72); outline: 2px solid var(--ivory); outline-offset: 4px; transition: all .4s var(--ease); pointer-events: none; }
.tour__card { position: fixed; width: min(340px, calc(100vw - 32px)); background: var(--obsidian); border: 1px solid var(--line-strong); border-radius: 16px; padding: 22px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,.5); transition: top .4s var(--ease), left .4s var(--ease); }
.tour__step { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ash); }
.tour__card h2 { font-family: var(--font-display); font-weight: 480; font-variation-settings: "wdth" 106; font-size: 22px; line-height: 1.15; margin: 8px 0 8px; }
.tour__card p { margin: 0; color: var(--ash); font-size: 15px; }
.tour__dots { display: flex; gap: 6px; margin: 18px 0 14px; }
.tour__dots i { width: 6px; height: 6px; border-radius: 6px; background: var(--slate); transition: width .3s, background-color .3s; }
.tour__dots i.is-on { width: 20px; background: var(--ivory); }
.tour__btns { display: flex; justify-content: space-between; align-items: center; }
.tour__skip { font-size: 14px; color: var(--ash); padding: 8px 4px; }
.tour__skip:hover { color: var(--ivory); }
@media (max-width: 960px) {
  .app-bar__back { font-size: 14px; }
  .app-bar__right { gap: 10px; }
}
@media (max-width: 420px) { .app-bar__back { display: none; } }

.app-bar .brand__logo { height: 30px; }

/* Etiquetas largas / cortas y botón de cámara */
.s { display: none; }
.only-touch { display: none !important; }
@media (pointer: coarse) { .only-touch { display: inline-flex !important; } }
.sheet-tabs { display: none; }
.fab-specs { margin: 12px 0 0; font-size: 12.5px; color: var(--ash); }
.fab-specs:empty { display: none; }
.hint { transition: opacity .4s; }
.hint.is-gone { opacity: 0; }

/* =========================================================
   Móvil: la foto arriba y un panel con pestañas abajo.
   Todo cabe en la pantalla, sin desplazar la página.
   ========================================================= */
@media (max-width: 960px) {
  body.app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
  .app-bar { height: 54px; padding: 0 14px; }
  .app-bar__title { display: none; }
  .app-bar .brand__logo { height: 26px; }
  .app-bar__help { height: 32px; font-size: 13px; padding: 0 12px; }

  .studio { display: flex; flex-direction: column; min-height: 0; }
  .stage-wrap { flex: 1; min-height: 0; padding: 8px 10px 6px; gap: 8px; position: relative; }
  .stage { flex: 1; min-height: 0; }
  .stage-tools { justify-content: center; gap: 6px; flex-wrap: nowrap; }
  .tool { height: 36px; padding: 0 12px; font-size: 13px; }
  .l { display: none; }
  .s { display: inline; }
  .hint { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: max-content; max-width: calc(100% - 40px); padding: 8px 14px; border-radius: 20px; background: rgba(7,17,53,.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 12.5px; line-height: 1.35; text-align: center; pointer-events: none; z-index: 3; }

  .empty { padding: 18px; gap: 10px; }
  .empty__art { width: 84px; height: 96px; padding: 12px 8px 0; gap: 5px; }
  .empty__art span { height: 10px; }
  .empty h1 { font-size: 27px; }
  .empty p { font-size: 14px; }
  .empty__actions { flex-direction: column; width: 100%; max-width: 300px; gap: 8px; }
  .empty__actions .btn { width: 100%; height: 48px; }

  .panel { flex: none; border-left: 0; overflow: visible; background: var(--graphite); border-radius: 18px 18px 0 0; border-top: 1px solid var(--line); }
  .sheet-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 10px 2px; }
  .sheet-tabs button { height: 38px; border-radius: 10px; font-size: 13.5px; color: var(--ash); transition: background-color .2s, color .2s; }
  .sheet-tabs button[aria-selected="true"] { background: var(--obsidian); color: var(--ivory); box-shadow: inset 0 0 0 1px var(--line-strong); }

  .panel__block { display: none; border-bottom: 0; padding: 10px 14px 8px; height: 132px; overflow-y: auto; }
  .panel[data-sheet="tStyle"] #tStyle, .panel[data-sheet="tFabric"] #tFabric,
  .panel[data-sheet="tColor"] #tColor, .panel[data-sheet="tAdjust"] #tAdjust { display: block; }
  .panel__label { display: none; }
  #tColor .panel__label { display: flex; margin-bottom: 8px; }

  .seg { gap: 6px; }
  .seg button { padding: 10px 4px 8px; gap: 6px; font-size: 12.5px; border-radius: 12px; }
  .seg .ico { width: 34px; height: 34px; }

  .fams { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px 8px; padding: 0 14px; scrollbar-width: none; }
  .fams::-webkit-scrollbar, .models::-webkit-scrollbar, .swatches::-webkit-scrollbar { display: none; }
  .fams button { flex: none; height: 34px; }
  .models { flex-wrap: nowrap; overflow-x: auto; margin: 0 -14px; padding: 0 14px; scrollbar-width: none; }
  .models button { flex: none; height: 38px; padding: 0 14px; }
  .fab-specs { margin-top: 8px; font-size: 12px; }

  .swatches { display: flex; overflow-x: auto; gap: 10px; margin: 0 -14px; padding: 4px 14px 8px; scrollbar-width: none; }
  .swatches button { flex: none; width: 52px; height: 52px; }

  .range + .range { margin-top: 10px; }

  .panel__summary { position: static; display: flex; align-items: center; gap: 10px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--onyx); border-top: 1px solid var(--line); }
  .summary { flex: 1; min-width: 0; margin: 0; }
  .summary__style { font-size: 11px; }
  .summary b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .panel__actions { display: flex; gap: 6px; }
  .panel__actions .btn { height: 42px; padding: 0 16px; font-size: 14px; }
  .panel__note { display: none; }

  body.app .promo-badge { bottom: auto; top: 62px; left: 10px; height: 38px; font-size: 11.5px; }
}
@media (max-width: 960px) and (max-height: 680px) {
  .panel__block { height: 112px; }
  .seg .ico { width: 26px; height: 26px; }
  .stage-tools .tool { height: 32px; }
}
