/* =========================================================
   UFY PHONE — CÁMARA
   ========================================================= */

.ufy-phone-app-screen[
  data-ufy-active-app="camera"
] {
  background: #000;
}


.ufy-phone-app-screen[
  data-ufy-active-app="camera"
]
.ufy-phone-app-screen-header {
  display: none;
}


.ufy-phone-app-screen[
  data-ufy-active-app="camera"
]
.ufy-phone-app-screen-content {
  overflow: hidden;

  padding: 0;

  background: #000;
}


/* =========================================================
   SUPERFICIE PRINCIPAL
   ========================================================= */

.ufy-phone-camera {
  position: relative;

  width: 100%;
  height: 100%;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  background: #000;

  color: #fff;
}


/* =========================================================
   VISTA DE LA CÁMARA
   ========================================================= */

.ufy-phone-camera-preview {
  position: absolute;

  inset: 0;

  z-index: 0;

  display: block;

  width: 100%;
  height: 100%;

  border: 0;

  background: #000;

  object-fit: cover;
}


/* =========================================================
   CABECERA DE CÁMARA
   ========================================================= */

.ufy-phone-camera-topbar {
  position: absolute;

  left: 50%;
  top:
    max(
      14px,
      env(safe-area-inset-top)
    );

  z-index: 4;

  width:
    calc(100% - 32px);

  min-height: 44px;

  box-sizing: border-box;

  transform:
    translateX(-50%);

  display: flex;
  align-items: center;
  justify-content: space-between;

  pointer-events: none;
}


.ufy-phone-camera-top-action {
  appearance: none;

  width: 42px;
  height: 42px;

  margin: 0;

  padding:
    0 0 6px 0px;

  box-sizing: border-box;

  border:
    1px solid
    rgba(255, 255, 255, 0.18);

  border-radius: 50%;

  background:
    rgba(0, 0, 0, 0.42);

  color: #fff;

  display: grid;
  place-items: center;

  font: inherit;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;

  cursor: pointer;

  pointer-events: auto;

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);
}


.ufy-phone-camera-top-action:active {
  transform:
    scale(0.94);
}


.ufy-phone-camera-quality {
  min-width: 36px;

  box-sizing: border-box;

  padding:
    6px 8px;

  border:
    1px solid
    rgba(255, 255, 255, 0.22);

  border-radius: 10px;

  background:
    rgba(0, 0, 0, 0.42);

  color: #fff;

  font-size: 11px;
  font-weight: 700;
  line-height: 1;

  text-align: center;

  pointer-events: none;

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);
}


/* =========================================================
   PANEL INFERIOR
   ========================================================= */

.ufy-phone-camera-controls {
  position: absolute;

  left: 0;
  bottom: 0;

  z-index: 3;

  width: 100%;

  box-sizing: border-box;

  display: flex;
  flex-direction: column;

  padding:
    30px 14px
    max(
      14px,
      env(safe-area-inset-bottom)
    );

  border: 0;
  border-radius: 0;

    background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.96)
        0,
      rgba(0, 0, 0, 0.86)
        58px,
      transparent
        92px
    );

  backdrop-filter: none;

  -webkit-backdrop-filter: none;
}


/* =========================================================
   DESTINOS — DESLIZAMIENTO HORIZONTAL ESTABLE
   ========================================================= */

.ufy-phone-camera-destinations {
  position: relative;

  order: 2;

  width: 100%;
  min-height: 48px;

  margin-top: 24px;

  overflow: hidden;

  box-sizing: border-box;

  background: transparent;
}

/* FILA QUE SE DESLIZA */

.ufy-phone-camera-destinations-track {
  width: 100%;
  min-height: 48px;

  display: flex;
  align-items: center;

  gap: 8px;

  box-sizing: border-box;

  overflow-x: auto;
  overflow-y: hidden;

    padding:
    0
    calc(57% - 48px)
    0
    calc(43% - 48px);

  scroll-behavior: smooth;
   scroll-snap-type: none;

  scrollbar-width: none;

  overscroll-behavior-x: contain;

   touch-action: pan-y;

  user-select: none;
  -webkit-user-select: none;

  cursor: grab;

  -webkit-overflow-scrolling: touch;
}


.ufy-phone-camera-destinations-track.is-dragging {
  cursor: grabbing;

  scroll-behavior: auto;
}


.ufy-phone-camera-destinations-track::-webkit-scrollbar {
  display: none;
}


/* OPCIONES */

.ufy-phone-camera-destination {
   appearance: none;

  position: relative;

  flex:
    0 0 96px;

  min-width: 96px;
  height: 46px;

  padding: 0;

  border: 0;
  outline: 0;

  background: transparent;

  color:
    rgba(255, 255, 255, 0.48);

  font: inherit;
  font-size: 11px;
  font-weight: 600;

  line-height: 1;

  text-align: center;

  white-space: nowrap;

    scroll-snap-align: none;
  scroll-snap-stop: normal;
  cursor: pointer;

  transition:
    color 160ms ease,
    transform 160ms ease;
}


.ufy-phone-camera-destination.is-active {
  color: #a970ff;

  transform:
    scale(1.04);
}


.ufy-phone-camera-destination.is-active::after {
  content: "";

  position: absolute;

  left: 50%;
    top: 4px;

  width: 18px;
  height: 2px;

  transform:
    translateX(-50%);

  border-radius: 999px;

  background: #9f62ff;
}




/* =========================================================
   FOTO | VIDEO — DESLIZABLE
   ========================================================= */

.ufy-phone-camera-capture-types {
  position: relative;
      
  z-index: 4;

  width: 190px;
  height: 38px;
  min-height: 0;

  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    66px
    minmax(0, 1fr);

  align-items: center;

  column-gap: 0;

  padding: 0 6px;

  overflow: visible;

  box-sizing: border-box;

  border: 0;

  background: transparent;

  box-shadow: none;

  touch-action: pan-y;

  user-select: none;
  -webkit-user-select: none;

  cursor: grab;
}


.ufy-phone-camera-capture-types::before {
  content: "";

  position: absolute;

  left: 50%;
  top: calc(50% + 15px);

  z-index: 0;

  width: 190px;
  height: 38px;

  transform:
    translate(-50%, -50%);

  box-sizing: border-box;

  border:
    1px solid
    rgba(255, 255, 255, 0.16);

  border-radius: 999px;

  background:
    rgba(12, 12, 15, 0.52);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  box-shadow:
    0 6px 16px
    rgba(0, 0, 0, 0.24);

  pointer-events: none;
}

.ufy-phone-camera-capture-types.is-dragging {
  cursor: grabbing;
}


/* OPCIONES FOTO Y VIDEO */

.ufy-phone-camera-capture-type {
  appearance: none;

  position: relative;
   

  z-index: 1;

  min-width: 0;
       height: 48px;
  min-height: 0;

  padding: 0;

  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;

  background: transparent;

  color:
    rgba(255, 255, 255, 0.70);

  font: inherit;

  font-size: 12px;
  font-weight: 600;

  text-transform: none;

  cursor: pointer;

  transition:
    color 170ms ease,
    transform 120ms ease;
}


.ufy-phone-camera-capture-type.is-active {
  background: transparent;

  color: #a970ff;

  box-shadow: none;

  transform:
    translateX(
      var(
        --ufy-camera-swipe-x,
        0px
      )
    );
}




.ufy-phone-camera-capture-types.is-dragging
.ufy-phone-camera-capture-type.is-active {
  transition:
    color 170ms ease;
}

/* =========================================================
   CONTROLES PRINCIPALES
   ========================================================= */

.ufy-phone-camera-primary-controls {
  position: relative;

  z-index: 3;

  order: 1;

  width: 100%;

  margin-top: 0;

  display: grid;

  grid-template-columns:
    58px
    220px
    58px;

  align-items: center;
  justify-content: space-between;

  gap: 8px;
}



.ufy-phone-camera-library,
.ufy-phone-camera-shutter,
.ufy-phone-camera-switch {
  appearance: none;

  margin: 0;
  padding: 0;

  cursor: pointer;
}


/* BIBLIOTECA PRIVADA */

.ufy-phone-camera-library {
  width: 58px;
  height: 58px;

  justify-self: center;

  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.38);

  border-radius: 14px;

  background:
    linear-gradient(
      145deg,
      #20242a,
      #050608
    );
}


.ufy-phone-camera-library:active {
  transform:
    scale(0.94);
}


/* OBTURADOR */

.ufy-phone-camera-shutter {
  appearance: none;

  position: relative;
  z-index: 6;

  width: 66px;
  height: 66px;

  padding: 0;

  flex: 0 0 66px;

  border:
    3px solid
    rgba(255, 255, 255, 0.92);

  border-radius: 50%;

  background:
    rgba(8, 8, 10, 0.82);

  box-shadow:
    inset 0 0 0 2px
    rgba(145, 145, 155, 0.48),
    0 5px 14px
    rgba(0, 0, 0, 0.38);

  cursor: pointer;

  box-sizing: border-box;
}

.ufy-phone-camera-shutter::after {
  content: "";

  position: absolute;

  left: 50%;
  top: 50%;

  width: 20px;
  height: 20px;

  transform:
    translate(-50%, -50%);

  border-radius: 50%;

  background: transparent;

  box-shadow: none;

  opacity: 0;

  transition:
    width 160ms ease,
    height 160ms ease,
    border-radius 160ms ease,
    background 160ms ease;
}


.ufy-phone-camera-shutter:active {
  transform:
    scale(0.93);
}


/* CAMBIAR CÁMARA */

.ufy-phone-camera-switch {
  width: 58px;
  height: 58px;

  justify-self: center;

  border:
    1px solid
    rgba(255, 255, 255, 0.30);

  border-radius: 50%;

  background:
    rgba(0, 0, 0, 0.90);

  color: #fff;

  display: grid;
  place-items: center;

  font: inherit;
}


.ufy-phone-camera-switch-image {
  display: block;

  width: 35px;
  height: 35px;

  object-fit: contain;

  pointer-events: none;

  user-select: none;
  -webkit-user-select: none;
}


.ufy-phone-camera-switch:active {
  transform:
    scale(0.94);
}




/* =========================================================
   REVISIÓN DE FOTOGRAFÍA
   ========================================================= */

.ufy-phone-camera-review {
  position: absolute;

  inset: 0;

  z-index: 20;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: #000;
}


.ufy-phone-camera-review-image {
  position: absolute;

  inset: 0;

  width: 100%;
  height: 100%;

  object-fit: contain;

  background: #000;

  user-select: none;
  -webkit-user-select: none;

  -webkit-user-drag: none;
}


.ufy-phone-camera-review-topbar {
  position: relative;

  z-index: 2;

  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;

  width: 100%;

  padding:
    max(18px, env(safe-area-inset-top))
    18px
    16px;

  background:
    linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0.76),
      transparent
    );
}


.ufy-phone-camera-review-repeat {
  justify-self: start;

  border: 0;

  padding: 8px 0;

  color: #fff;
  background: transparent;

  font: inherit;
  font-size: 15px;
  font-weight: 650;

  cursor: pointer;
}


.ufy-phone-camera-review-title {
  grid-column: 2;

  margin: 0;

  color: #fff;

  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;

  text-align: center;
}


.ufy-phone-camera-review-bottom {
  position: relative;

  z-index: 2;

  width:
    calc(100% - 24px);

  margin:
    auto 12px
    max(12px, env(safe-area-inset-bottom));

  padding: 14px;

  border:
    1px solid
    rgba(255, 255, 255, 0.14);

  border-radius: 22px;

  background:
    rgba(7, 7, 9, 0.88);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  box-shadow:
    0 18px 42px
    rgba(0, 0, 0, 0.38);
}


.ufy-phone-camera-review-question {
  margin:
    0 0 11px;

  color:
    rgba(255, 255, 255, 0.78);

  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;

  text-align: center;
}


.ufy-phone-camera-review-destinations {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  gap: 8px;

  margin-bottom: 10px;
}


.ufy-phone-camera-review-destination {
  min-height: 42px;

  border:
    1px solid
    rgba(255, 255, 255, 0.14);

  border-radius: 14px;

  padding: 9px 12px;

  color:
    rgba(255, 255, 255, 0.76);

  background:
    rgba(255, 255, 255, 0.055);

  font: inherit;
  font-size: 14px;
  font-weight: 650;

  cursor: pointer;

  transition:
    border-color 160ms ease,
    color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}


.ufy-phone-camera-review-destination.is-active {
  border-color:
    rgba(255, 255, 255, 0.92);

  color: #050505;

  background: #fff;
}


.ufy-phone-camera-review-destination:active {
  transform:
    scale(0.98);
}


.ufy-phone-camera-review-use {
  width: 100%;
  min-height: 46px;

  border: 0;

  border-radius: 15px;

  padding: 11px 16px;

  color: #050505;
  background: #fff;

  font: inherit;
  font-size: 15px;
  font-weight: 750;

  cursor: pointer;

  transition:
    opacity 160ms ease,
    transform 160ms ease;
}


.ufy-phone-camera-review-use:disabled {
  opacity: 0.38;

  cursor: default;
}


.ufy-phone-camera-review-use:not(:disabled):active {
  transform:
    scale(0.985);
}

/* =========================================================
   CAPTURA FOTOGRÁFICA
   ========================================================= */

/* MINIATURA DE LA ÚLTIMA CAPTURA */

.ufy-phone-camera-library-image {
  display: block;

  width: 100%;
  height: 100%;

  object-fit: cover;

  pointer-events: none;

  user-select: none;
  -webkit-user-select: none;

  -webkit-user-drag: none;
}


/* OBTURADOR PROCESANDO */

.ufy-phone-camera-shutter.is-capturing,
.ufy-phone-camera-shutter:disabled {
  opacity: 0.62;

  cursor: wait;

  transform:
    scale(0.94);
}


/* DESTELLO DE LA CÁMARA */

.ufy-phone-camera::after {
  content: "";

  position: absolute;

  inset: 0;

  z-index: 8;

  background: #fff;

  opacity: 0;

  pointer-events: none;

  transition:
    opacity 130ms ease;
}


.ufy-phone-camera.did-capture-photo::after {
  opacity: 0.88;

  transition: none;
}

/* =========================================================
   ERROR DE PERMISO
   ========================================================= */

.ufy-phone-camera-error {
  position: absolute;

  left: 50%;
  top: 50%;

  z-index: 2;

  display: none;

  width:
    min(82%, 310px);

  box-sizing: border-box;

  transform:
    translate(-50%, -50%);

  padding:
    16px 18px;

  border:
    1px solid
    rgba(255, 255, 255, 0.22);

  border-radius: 20px;

  background:
    rgba(0, 0, 0, 0.84);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  color:
    rgba(255, 255, 255, 0.92);

  font-size: 13px;
  line-height: 1.45;

  text-align: center;
}


.ufy-phone-camera.has-camera-error
.ufy-phone-camera-error,
.ufy-phone-camera.has-microphone-warning
.ufy-phone-camera-error,
.ufy-phone-camera.has-camera-success
.ufy-phone-camera-error {
  display: block;
}


/* AVISO TEMPORAL DE MICRÓFONO */

.ufy-phone-camera.has-microphone-warning
.ufy-phone-camera-error {
  border-color:
    rgba(255, 255, 255, 0.34);

  background:
    rgba(0, 0, 0, 0.90);

  box-shadow:
    0 8px 26px
    rgba(0, 0, 0, 0.48);
}


/* CONFIRMACIÓN TEMPORAL DE GUARDADO */

.ufy-phone-camera.has-camera-success
.ufy-phone-camera-error {
  top: auto;
  bottom: 126px;

  z-index: 12;

  width:
    min(
      calc(100% - 36px),
      340px
    );

  transform:
    translateX(-50%);

  border-color:
    rgba(255, 255, 255, 0.22);

  border-radius: 16px;

  padding:
    11px 14px;

  color: #fff;

  background:
    rgba(7, 7, 9, 0.90);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  box-shadow:
    0 10px 30px
    rgba(0, 0, 0, 0.42);

  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}



/* =========================================================
   CONTADOR DE GRABACIÓN — VERSIÓN 2
   ========================================================= */

.ufy-phone-camera-recording-counter {
  position: absolute;

  left: 50%;
  top:
    max(
      20px,
      calc(
        env(safe-area-inset-top) +
        6px
      )
    );

  z-index: 5;

  transform:
    translateX(-50%);

  display: flex;
  align-items: center;
  justify-content: center;

    gap: 7px;

  padding:
    7px 11px;

  border:
    1px solid
    rgba(255, 80, 92, 0.28);

  border-radius: 8px;

  background:
    rgba(190, 20, 32, 0.30);

  backdrop-filter:
    blur(2px);

  -webkit-backdrop-filter:
    blur(2px);

  color: #fff;

  font-size: 14px;
  font-weight: 750;
  line-height: 1;

  letter-spacing: 0.8px;

  font-variant-numeric:
    tabular-nums;

  text-shadow:
    0 2px 8px
    rgba(0, 0, 0, 0.72);

  pointer-events: none;
}





.ufy-phone-camera-recording-counter[hidden] {
  display: none;
}


/* BOTÓN DURANTE LA GRABACIÓN */

.ufy-phone-camera.is-recording
.ufy-phone-camera-shutter {
  border-color:
    rgba(255, 255, 255, 0.92);

  background:
    rgba(8, 8, 10, 0.88);

  box-shadow:
    inset 0 0 0 2px
    rgba(145, 145, 155, 0.48),
    0 5px 14px
    rgba(0, 0, 0, 0.42);
}

.ufy-phone-camera.is-recording
.ufy-phone-camera-shutter::after {
      opacity: 1;
  width: 18px;
  height: 18px;

  border-radius: 4px;

  background: #ff2d35;

  box-shadow:
    0 0 10px
    rgba(255, 45, 53, 0.20);
}