.crop-class-container {
  padding: 20px;
  border-radius: 5px;
  text-align: center;
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: center;
}

.crop-wrapper {
  width: 100%;
  height: auto;

}

.cropme-wrapper {
  height: auto;
}

.cropme-container {
  width: 100%;
  height: auto;

}

.pfb-title {
  font-size: 25px;
  font-weight: 900;
  margin-top: 30px;
  margin-bottom: 30px;
}

.result-step {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  justify-content: center;
}

.result-content {
  width: 100%;
  max-width: 268px;
}

.result-buttons {
  min-width: 20%;
  display: flex;
  flex-direction: column;
  gap: 15px;
  justify-content: center;
  align-items: center;
}



/* 
Alinhamento na base da tela.
#floating-bg-options {
  position        : fixed;
  bottom          : 70px;
  left            : 0;
  width           : 100%;
  background-color: rgba(226, 226, 226, 0.741);
  z-index         : 9999;
} */

/* Alinhamento centralizado na tela (vertical e horizontal)
#floating-bg-options {
  width: 100%;
  position: fixed !important;
  top : 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  bottom: auto !important;
  background-color: rgba(226, 226, 226, 0.741);
  z-index: 9999;
  padding-top: 30px;
  padding-bottom: 30px;
} */

.bg-options-title {
  width: 100%;
  padding: 7px;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  display: flex;
  justify-content: center;
  flex-direction: row;
  align-items: center;
  gap: 30px;
  z-index: 9999;
}

.bg-options {
  padding: 10px;
  height: auto;

  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  z-index: 9999;
}

.btn-base {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.bg-download {
  background-color: #196e37;
}

.bg-reset {
  background-color: #ff0000;
}

.bg-btn {
  padding: 10px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 7px;
}

.btn-img-bg {
  background-color: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  height: 100%;
  justify-content: center;
  position: relative;
}

.bg-legend {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0;
  text-align: center;
  width: 90%;
}

.btn-img-bg .bg-title {
  pointer-events: none;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06rem;
  color: #317aac;
}

.btn-img-bg .bg-description {


  pointer-events: none;

  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06rem;
  color: #317aac;
}

.img-opts {
  width: 160px;
}

.active img {
  border: 5px solid #3ac603;
}

/* #floating-bar {
  position: fixed;
  bottom  : 0;
  left    : 0;
  width   : 100%;
  gap     : 10px;

  background: white;
  padding   : 10px;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);

  z-index        : 9999;
  display        : flex;
  flex-wrap      : wrap;
  justify-content: center;
} */

#btn-send {
  /* max-width: 300px; */
  padding: 15px;
  font-size: 16px;
}



#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.6);
  z-index: 99999;

  display: flex;
  align-items: center;
  justify-content: center;
}

.content-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

#loading-overlay.hidden {
  display: none;
}

/* Spinner simples */
.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #fff;
  border-top: 5px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.hide-crop {
  overflow: hidden;
  width: 1px;
  height: 1px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.steps {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}



.upload-wrapper {
  max-width: 600px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  background: #007bff;
  padding: 10px;
  border-radius: 8px;
  color: white;
}

/* Esconde o input feio */
.upload-input {
  display: none;
}


.upload-btn {
  background: white;
  color: black;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.upload-btn:hover {
  background: #eee;
}

#file-name {
  font-size: 14px;
}

#bg-options-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0, 0, 0, 0.6);
  z-index: 9977;
}

.ui-dialog {
  z-index: 99999 !important;
}

.ui-dialog-titlebar {
  display: none !important;
}

.ui-dialog .ui-widget-content.ui-dialog-content {
  border-radius: 15px !important;
}

.ui-dialog-buttonset {
  margin: 0 !important;
}

.ui-dialog-buttonpane {
  justify-content: center !important;
  display: flex !important;
  padding: 0 !important;
  border: 0 !important;
  margin: 0 !important;
  margin-bottom: 15px !important;
}

.cropme-container img#moldura-live-preview {
  /* max-width : none !important; */
  /* Impede que o cropme esprema a imagem */
  width: auto !important;
  /* Mantém a largura original da moldura */
  height: auto !important;
  /* Mantém a altura original da moldura */
  opacity: 1 !important;
  /* Garante que ela fique visível */
  visibility: visible !important;
  transform: none !important;
  /* O cropme usa transform na foto base, precisamos anular isso na moldura */
  display: block !important;
}

.cropme-container .viewport {
  box-sizing: border-box !important;
  border-width: 0 !important;
}





/* ///// RESPONSIVIDADE ///// */

@media (max-width: 768px) {
  #floating-bar button {
    flex: 1 1 calc(50% - 10px);
  }

  .bg-options {
    scroll-snap-type: x mandatory;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;

    overflow-x: auto;
    overflow-y: hidden;
    margin-left: 20px;
    margin-right: 20px;

    /* gap: 10px; */

    white-space: nowrap;
    /* evita quebra */
    -webkit-overflow-scrolling: touch;
    /* smooth no iOS */
  }

  .bg-options::after {
    content: "›";
    position: absolute;
    right: -8px;
    top: 0;
    width: 40px;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 80px;
    font-weight: bold;
    color: #333;
    transform: scaleX(0.6);
    transform-origin: center;

    pointer-events: none;

    background: linear-gradient(to left, white, transparent);
  }

  .bg-options::before {
    content: "‹";
    position: absolute;
    left: -8px;
    top: 0;
    width: 40px;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 80px;
    font-weight: bold;
    font-width: 8px;
    color: #333;
    transform: scaleX(0.6);
    transform-origin: center;

    pointer-events: none;

    background: linear-gradient(to right, white, transparent);
  }

  .bg-opt {
    scroll-snap-align: start;
    flex: 0 0 auto;
    /* 🔥 impede encolher */
    width: 170px;
    /* define tamanho do card */
  }

  .crop-class-container {
    padding: 0;
  }

  .crop-wrapper {
    padding: 0;
  }

  .result-step {
    width: 100%;
    flex-direction: column;

  }

  .result-buttons {
    width: 100%;
  }

  .upload-wrapper {
    width: 100%;
  }

  #btn-send {
      max-width: 300px;
            width: 100%;
  }
}

/* ==================== popover ==================== */

.popover {
  --bs-popover-max-width: 350px !important;
}

.popover-body__list {
  display: flex;
  gap: 15px;
  padding: 10px;
  justify-content: center;
}

.popover-body__list a {
  text-decoration: none;
  font-size: 12px;
  color: #333;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.popover-share {
  display: block !important;
}

.popover-header {
  display: none !important;
}

.custom-popover-share {
  z-index: 10000;
}



.custom-popover-share .popover-arrow {
  display: block !important;
  position: absolute !important;
  width: 22px !important;
  height: 11px !important;
  bottom: -10px !important;
}

.custom-popover-share .popover-arrow::before,
.custom-popover-share .popover-arrow::after {
  content: "" !important;
  position: absolute !important;
  display: block !important;
  width: 0 !important;
  height: 0 !important;
  border-style: solid !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
}

.custom-popover-share .popover-arrow::before {
  bottom: -1px !important;
  border-width: 11px 11px 0 11px !important;

  border-color: #dee2e6 transparent transparent transparent !important;
}

.custom-popover-share .popover-arrow::after {
  bottom: 0 !important;
  border-width: 10px 10px 0 10px !important;
  border-color: #ffffff transparent transparent transparent !important;
}

/* ==================== fim popover ==================== */



@media (min-width: 769px) {
  #floating-bar button {
    flex: 0 0 auto;
  }
}