
.ptar-ar-wrapper{
  position:relative;
  width:100%;
  height:100dvh;
  min-height:520px;
  max-height:100dvh;
  background:#000;
  overflow:hidden;
  isolation:isolate;
  touch-action:manipulation;
}
.ptar-ar-scene{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  z-index:1!important;
  background:transparent!important;
}
.ptar-ar-wrapper video{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  max-width:none!important;
  max-height:none!important;
  object-fit:cover!important;
  z-index:0!important;
}
.ptar-ar-wrapper .a-canvas,
.ptar-ar-wrapper canvas.a-canvas{
  position:absolute!important;
  inset:0!important;
  width:100%!important;
  height:100%!important;
  z-index:2!important;
  background:transparent!important;
  pointer-events:none!important;
}
.ptar-ar-ui{
  position:absolute;
  z-index:50;
  inset:0;
  pointer-events:none;
  font-family:Arial,sans-serif;
  touch-action:none;
}

.ptar-ar-status{
  position:absolute;
  top:calc(12px + env(safe-area-inset-top));
  left:50%;
  transform:translateX(-50%);
  z-index:70;
  max-width:calc(100% - 120px);
  box-sizing:border-box;
  background:rgba(0,0,0,.32);
  color:rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  padding:7px 11px;
  font-size:11px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  text-align:center;
  pointer-events:none;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.ptar-ar-topbar{
  position:absolute;
  top:calc(10px + env(safe-area-inset-top));
  left:12px;
  right:12px;
  z-index:75;
  display:flex;
  justify-content:space-between;
  align-items:center;
  pointer-events:none;
}
.ptar-ar-topbar button{
  pointer-events:auto;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.ptar-ar-camera,
.ptar-ar-close{
  width:40px;height:40px;
  border:1px solid rgba(255,255,255,.20);
  border-radius:50%;
  background:rgba(0,0,0,.28);
  color:#fff;
  font-size:21px;
  line-height:40px;
  text-align:center;
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  box-shadow:0 3px 14px rgba(0,0,0,.18);
}
.ptar-ar-close{font-size:25px}
.ptar-ar-start{
  position:absolute;
  left:50%;
  bottom:calc(22px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:80;
  pointer-events:auto!important;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  min-width:210px;
  min-height:58px;
  padding:16px 28px;
  font-size:17px;
  font-weight:700;
  border:0;
  border-radius:999px;
  cursor:pointer;
}
.ptar-ar-bottom{
  position:absolute;
  left:50%;
  bottom:calc(14px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:80;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  pointer-events:none;
}
.ptar-ar-mode{
  display:flex;
  gap:2px;
  padding:2px;
  border:1px solid rgba(255,255,255,.16);
  border-radius:999px;
  background:rgba(0,0,0,.30);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
  pointer-events:auto;
  box-shadow:0 3px 14px rgba(0,0,0,.16);
}
.ptar-ar-mode-btn{
  border:0;
  border-radius:999px;
  background:transparent;
  color:rgba(255,255,255,.78);
  padding:5px 10px;
  font-size:10px;
  font-weight:700;
  letter-spacing:.04em;
  min-width:54px;
  min-height:30px;
  pointer-events:auto;
  touch-action:manipulation;
}
.ptar-ar-mode-btn.is-active{
  background:rgba(255,255,255,.90);
  color:#111;
}
.ptar-ar-shutter{
  width:64px;
  height:64px;
  padding:0;
  border-radius:50%;
  border:4px solid rgba(255,255,255,.88);
  background:
    radial-gradient(circle at 50% 50%,
      rgba(255,255,255,.96) 0 20px,
      rgba(255,255,255,.12) 21px 100%);
  box-shadow:0 4px 18px rgba(0,0,0,.28);
  color:transparent;
  font-size:0;
  line-height:0;
  pointer-events:auto;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
}
.ptar-ar-shutter.is-video{
  background:
    radial-gradient(circle at 50% 50%,
      #ef4444 0 20px,
      rgba(255,255,255,.12) 21px 100%);
}
.ptar-ar-shutter.is-recording{
  border-color:#ef4444;
  background:
    radial-gradient(circle at 50% 50%,
      #ef4444 0 15px,
      rgba(255,255,255,.16) 16px 100%);
}
.ptar-ar-bottom-note{
  color:#fff;
  font-size:11px;
  padding:5px 10px;
  border-radius:12px;
  background:rgba(0,0,0,.42);
  white-space:nowrap;
}
.ptar-ar-layer-picker{
  position:absolute;
  left:50%;
  bottom:calc(160px + env(safe-area-inset-bottom));
  transform:translateX(-50%);
  z-index:85;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:4px;
  max-width:min(88%,520px);
  pointer-events:auto;
  padding:3px 5px;
  border-radius:18px;
  background:rgba(0,0,0,.08);
  backdrop-filter:blur(4px);
  -webkit-backdrop-filter:blur(4px);
}
.ptar-ar-layer-label{
  font-size:9px;
  line-height:1;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:rgba(255,255,255,.68);
  text-shadow:0 1px 5px rgba(0,0,0,.45);
  pointer-events:none;
}
.ptar-ar-accessories{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  max-width:min(88vw,520px);
  overflow-x:auto;
  overflow-y:hidden;
  padding:2px 3px;
  scrollbar-width:none;
  -ms-overflow-style:none;
  touch-action:pan-x;
}
.ptar-ar-accessories::-webkit-scrollbar{display:none}
.ptar-ar-accessory{
  flex:0 0 auto;
  width:clamp(32px, 3.1vw, 40px);
  height:clamp(32px, 3.1vw, 40px);
  padding:0;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.58);
  border-radius:50%;
  background:rgba(0,0,0,.22);
  color:#fff;
  box-shadow:0 2px 12px rgba(0,0,0,.16);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
  cursor:pointer;
  touch-action:manipulation;
  -webkit-tap-highlight-color:transparent;
  transition:background .16s ease,border-color .16s ease,transform .16s ease,box-shadow .16s ease;
}
.ptar-ar-accessory:active{transform:scale(.94)}
.ptar-ar-icon{
  width:clamp(16px, 1.55vw, 20px);
  height:clamp(16px, 1.55vw, 20px);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:14px;
  font-weight:700;
  line-height:1;
}
.ptar-ar-icon svg{
  width:100%;
  height:100%;
  fill:none;
  stroke:currentColor;
  stroke-width:1.7;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.ptar-ar-accessory.is-selected{
  background:rgba(255,151,25,.96);
  border-color:rgba(255,255,255,.92);
  color:#fff;
  box-shadow:0 3px 16px rgba(255,151,25,.34);
}
.ptar-ar-accessory.is-selected .ptar-ar-icon{transform:scale(1.04)}
.ptar-ar-reopen{
  position:absolute;
  left:50%;top:50%;
  transform:translate(-50%,-50%);
  z-index:100;
  border:0;border-radius:999px;
  padding:14px 24px;min-width:160px;font-weight:700;
}
@supports not (height:100dvh){
  .ptar-ar-wrapper{height:100vh;max-height:100vh}
}
@media (min-width:768px){
  .ptar-ar-start{bottom:22px;min-width:220px;min-height:58px}
  .ptar-ar-bottom{bottom:12px}
  .ptar-ar-layer-picker{bottom:160px}
}
@media (max-width:767px){
  .ptar-ar-status{
    top:calc(8px + env(safe-area-inset-top));
    font-size:10px;
    max-width:calc(100% - 100px);
    padding:6px 9px;
  }
  .ptar-ar-topbar{
    top:calc(7px + env(safe-area-inset-top));
    left:8px;
    right:8px;
  }
  .ptar-ar-camera,.ptar-ar-close{
    width:36px;
    height:36px;
    line-height:36px;
    font-size:19px;
  }
  .ptar-ar-close{font-size:23px}
  .ptar-ar-start{
    min-width:180px;
    min-height:50px;
    padding:12px 20px;
    font-size:15px;
    bottom:calc(14px + env(safe-area-inset-bottom));
  }
  .ptar-ar-bottom{
    bottom:calc(8px + env(safe-area-inset-bottom));
    gap:5px;
  }
  .ptar-ar-mode-btn{
    min-width:50px;
    min-height:28px;
    padding:4px 8px;
    font-size:9px;
  }
  .ptar-ar-shutter{
    width:58px;
    height:58px;
    border-width:4px;
    background:
      radial-gradient(circle at 50% 50%,
        rgba(255,255,255,.96) 0 18px,
        rgba(255,255,255,.12) 19px 100%);
  }
  .ptar-ar-shutter.is-video{
    background:
      radial-gradient(circle at 50% 50%,
        #ef4444 0 18px,
        rgba(255,255,255,.12) 19px 100%);
  }
   .ptar-ar-layer-picker{
    bottom:calc(142px + env(safe-area-inset-bottom));
    max-width:88%;
  }
  .ptar-ar-layer-label{font-size:8px}
  .ptar-ar-accessories{
    max-width:88vw;
    gap:6px;
  }
  .ptar-ar-accessory{
    width:clamp(30px,9vw,34px);
    height:clamp(30px,9vw,34px);
  }
  /* Keep the fixed-image control unmistakable on iPhone/Safari.
     Same size and position as the other element buttons. */
  .ptar-ar-accessory-fixed{
    flex:0 0 auto;
  }
  .ptar-ar-icon{
    width:clamp(15px,4.5vw,17px);
    height:clamp(15px,4.5vw,17px);
  }
  .ptar-ar-bottom-note{display:none}
}

@media (max-width:767px){
  /* The AR visor must own the complete phone viewport.
     This does NOT move its internal controls; it only removes the
     narrow WordPress content column around the camera. */
  .ptar-ar-wrapper{
    position:relative;
    left:50%;
    margin-left:-50vw;
    width:100vw;
    height:100svh;
    min-height:100svh;
    max-height:none;
    box-sizing:border-box;
    overflow:hidden;
  }
}


/* Captura: vista previa real antes de guardar/compartir. */
.ptar-capture-preview{
  position:absolute;
  inset:0;
  z-index:200;
  display:none;
  align-items:center;
  justify-content:center;
  padding:20px;
  box-sizing:border-box;
  background:rgba(0,0,0,.82);
  pointer-events:auto;
}
.ptar-capture-preview.is-open{display:flex}
.ptar-capture-card{
  width:min(92vw,560px);
  max-height:92vh;
  overflow:auto;
  box-sizing:border-box;
  padding:14px;
  border-radius:20px;
  background:rgba(20,20,20,.96);
  box-shadow:0 12px 40px rgba(0,0,0,.45);
}
.ptar-capture-title{
  color:#fff;
  text-align:center;
  font:700 15px/1.2 Arial,sans-serif;
  margin:2px 0 12px;
}
.ptar-capture-media{
  width:100%;
  border-radius:14px;
  overflow:hidden;
  background:#000;
}
.ptar-capture-media img,
.ptar-capture-media video{
  display:block;
  width:100%;
  height:auto;
  max-height:68vh;
  object-fit:contain;
  background:#000;
}
.ptar-capture-actions{
  display:flex;
  gap:8px;
  justify-content:center;
  margin-top:12px;
}
.ptar-capture-actions button{
  min-height:44px;
  border:0;
  border-radius:999px;
  padding:10px 16px;
  font:700 12px/1 Arial,sans-serif;
  cursor:pointer;
  touch-action:manipulation;
}
.ptar-capture-share{background:#fff;color:#111}
.ptar-capture-close{background:rgba(255,255,255,.15);color:#fff}
@media(max-width:767px){
  .ptar-capture-preview{padding:10px}
  .ptar-capture-card{width:96vw;max-height:94vh;padding:10px;border-radius:17px}
  .ptar-capture-actions button{flex:1;min-height:46px;padding:10px 8px;font-size:11px}
}
