*,
*::before,
::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
}

:root {
  --Width-header: 4.8in;

  --container_width_paddign: 4in;
  --container_width: calc(var(--container_width_paddign) - 3.2cm);
  --height: 60px;
  --border-radius: 8px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
    Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  font-size: 16px;
  color: #82868a;

  background-color: rgb(251, 251, 252);
}

body.dev {
  background-color: rgb(51, 51, 53);
  color: #1a1a1a;
}

.View-20292 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;

  width: 100%;
  height: 100%;

  transform: matrix(1, 0, 0, 1, 0, 0);
  --View-20292-width: 1366;
  --View-20292-height: 599;
  /* --View-20292-source: url(&quot;https://hatch.one/_/api/resources/-O-hCAUsVZXIfh-ECp5K/data/sha256:e0551922d8983147811f31ec4e6e894d7f8ecf430d70f759ce36e89e0d37dd97&quot;); */
  transition: undefined;

  video {
    position: inherit;
    object-fit: cover;
    opacity: 0.2;
    width: 100%;
    height: 100%;
    user-select: none;
    filter: invert(100%);
  }

  z-index: -1;
}

.background-image {
  position: fixed;
  top: 0;
  left: 0;
  background-image: url('../images/videoframe_9938.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed; /* Mantiene el fondo fijo durante el scroll */

  width: 100%;
  height: 100%;

  opacity: 0.1;
  filter: invert(100%);
  z-index: -1;
}

.btn:hover {
  box-shadow: 0px 0px 20px 0 #52a5b866;
}

.btn-primary:not(.selected) {
  background: linear-gradient(90deg, rgb(80, 167, 186), rgb(103, 147, 174));
  border-color: rgb(80, 167, 186);
}

.btn-primary:not(.selected):hover {
  background: linear-gradient(90deg, rgb(74, 149, 165), rgb(74, 149, 165));
}

header {
  width: var(--Width-header);

  h1 {
    width: 100%;
    text-wrap: nowrap;
    padding-bottom: 8px;
  }

  .dropdown-container {
    width: 100%;

    margin: 0 auto;
    width: fit-content;

    .dropdown-container-list {
      display: flex;
      gap: 8px;

      li {
        list-style: none;
      }

      li a {
        padding: 5px 10px;
        text-decoration: none;
      }

      .selected {
        background: #333;
        box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.12);
      }

      a:hover.selected {
        background: #1a1a1a;
      }
    }
  }
}

.insert-code {
  width: var(--container_width_paddign);

  .editor-label {
    text-size-adjust: none;
    font-family: Source Sans Pro, Arial, sans-serif;
    color: #1a1a1a;
    line-height: 12pt;
    outline: none;
    padding: 4px;

    white-space: nowrap;
    color: gray;
  }

  .editor-field {
    text-size-adjust: none;
    font-family: Source Sans Pro, Arial, sans-serif;
    color: #1a1a1a;
    line-height: 12pt;
    outline: none;

    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;

    textarea {
      background: transparent !important;
      border: 1px solid #b7a8ee;
    }
  }

  .barcodeRefresh {
    line-height: 20px;
    text-align: right;
    padding: 4px 0;

    input {
      font-size: 10pt;
    }
  }
}

.trash-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  align-content: center;

  .custum-file-upload {
    cursor: pointer;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    border: 2px solid #cacaca;
    background-color: rgba(255, 255, 255, 1);
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0px 48px 35px -48px rgba(0, 0, 0, 0.1);

    .icon {
      display: flex;
      align-items: center;
      justify-content: center;
    }

    .icon svg {
      height: 50px;
      fill: #dc3545;
    }

    .text {
      display: flex;
      align-items: center;
      justify-content: center;
      flex-wrap: wrap;
      text-wrap: wrap;
      text-align: center;
    }

    .text span {
      font-weight: 400;
      color: rgba(75, 85, 99, 1);
    }

    input {
      display: none;
    }
  }

  .over {
    border-style: dashed;
    border-width: 4px;
  }

  &.show {
    display: flex !important;
  }
}

/* Area de Impresion */

.main {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  row-gap: 8px;

  width: 100%;
  /* height: calc(4in + 8px + var(--height)); */

  .mb-40 {
    margin-bottom: 40px;
  }

  header {
    width: 100%;
    height: var(--height);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .radio-inputs {
      position: relative;
      display: flex;
      flex-wrap: wrap;
      border-radius: 0.5rem;
      background-color: #eee;
      box-sizing: border-box;
      box-shadow: 0 0 0px 1px rgba(0, 0, 0, 0.06);
      padding: 0.25rem;
      width: fit-content;
      font-size: 14px;
      column-gap: 4px;
    }

    .radio-inputs .radio {
      flex: 1 1 auto;
      text-align: center;
    }

    .radio-inputs .radio input {
      display: none;
    }

    .radio-inputs .radio .name {
      display: flex;
      cursor: pointer;
      align-items: center;
      justify-content: center;
      border-radius: 0.25rem;
      border: none;
      color: rgba(51, 65, 85, 1);
      transition: all 0.15s ease-in-out;
      opacity: 0.5;
    }

    .radio-inputs .radio input:checked + .name {
      background-color: #fff;
      font-weight: 600;
      opacity: 1;
    }
  }

  .area-de-impresion {
    background-color: rgb(255, 255, 255, 0.35);
    outline: 3px dashed #8b8b8b;
    outline-offset: -3px;
    position: relative;
    border-radius: var(--border-radius);

    width: var(--container_width_paddign);
    height: var(--container_width_paddign);
  }

  .area-de-impresion.with-margin::before {
    content: '';
    width: var(--container_width);
    height: var(--container_width);
    outline: 3px dashed #080808a6;
    outline-offset: 3px;
    position: absolute;
    top: 5px;
    left: 5px;
    border-radius: var(--border-radius);
  }

  .area-de-impresion figure:not(.selected),
  .area-de-impresion figure:not(.selected) div:hover,
  .area-de-impresion figure:not(.selected) img:hover,
  .area-de-impresion .texto-plano:not(.selected) p:hover,
  .area-de-impresion .texto-plano:not(.selected) {
    cursor: grab;
    cursor: move;
  }

  figure {
    position: absolute;
  }

  figure.selected {
    overflow: hidden;
    resize: both;
    z-index: 2;
  }

  .codigo-QR {
    --height-text: 21px;

    img {
      width: 100%;
      height: calc(100% - var(--height-text));
    }

    figcaption {
      font-size: 21px;
      font-weight: bold;
      text-align: center;
      margin-top: -4px;
      height: var(--height-text);
    }
  }

  .codigo-128,
  .codigo-upca {
    img {
      width: 100%;
      height: 100%;
    }
  }

  .texto-plano {
    width: fit-content;
    height: auto;
    position: absolute;
    z-index: 2;
    outline: 2px solid #000000a4;
    outline-offset: 2px;

    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: start;
    align-content: start;
    justify-content: start;

    /* Ajusta el tamaño del texto al 5% del tamaño del padre */
    font-size: 14px;

    .texto {
      font-weight: bold;
    }

    &.selected:not(.texto-plano) {
      overflow: hidden;
      resize: both;
    }
  }

  .selected {
    outline: 3px dashed #8b8b8b !important;
    outline-offset: 2px !important;
  }

  .dragging {
    transition: transform 0.2s ease;
    /* Añadimos una transición para suavizar el movimiento */
  }
}

footer {
  width: 100%;
  margin-top: 50px;
  background-color: transparent;
  display: flex;
  justify-content: center;
  padding: 8px;
  gap: 8px;
}

/* Animaciones */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none !important;
}
