:root {
  --input-background: #F7F7F7;
}

.ticket-form {
  --input-background: #FFF;
}
/* Estilos para la modal de imagen */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  max-height: 90%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.modal-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}



/* Estilos para secciones personalizadas en el formulario RMA */
.form-section {}

.form-section .field-wrapper {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  box-sizing: border-box;
  position: relative;
}


.form-section textarea {
  width: 100%;
  max-width: 100%;
}

.form-subsection {
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.form-subsection__title {
  grid-column: span 3;
  font-size: 14px;
  font-weight: 600;
  padding-bottom: 5px;
  border-bottom: 1px solid #e2e8f0;
  width: 100%;
  margin-bottom: 0;
}



/* Grid de campos */
.form-subsection .field-wrapper {
  width: 100%;
  box-sizing: border-box;
  margin-top: -8px;
}


.form-subsection .field-wrapper:nth-child(3n + 1) {
  margin-right: 0;
}

/* Labels */
.form-section label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-section label[data-required="true"]::after {
  content: " *";
}

/* Inputs y Selects */
.form-section input[type="text"],
.form-section select,
.form-section textarea {
  width: 100%;
  max-width: 100%;
    background-color: var(--input-background, #FFF);
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  box-sizing: border-box;
}

.form-section input[type="text"]:focus,
.form-section select:focus,
.form-section textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-section input[type="text"]::placeholder {
  color: #9ca3af;
}

.form-section select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Input file estilizado */
.form-section input[type="file"] {
  width: 100%;
  padding: 8px;
  font-size: 11px;
  color: #6b7280;
  background-color: var(--input-background, #FFF);
  border: 2px dashed #d1d5db;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}

.form-section input[type="file"]:hover {
  border-color: #3b82f6;
  background-color: #f0f7ff;
}

.form-section input[type="file"]:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Botón interno "Seleccionar archivo" */
.form-section input[type="file"]::file-selector-button {
  margin-right: 10px;
  font-size: 10px;
  font-weight: 500;
  color: #374151;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.form-section .field-file-wrapper {
  display: flex;
  flex-direction: row-reverse;
  gap: 10px;

}

.form-section .field-file-wrapper .field-file-existing {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 50%;

  a {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

  }
}

.form-section input[type="file"]::file-selector-button:hover {
  background-color: #f3f4f6;
  border-color: #9ca3af;
}

/* Versión para navegadores WebKit (Safari) */
.form-section input[type="file"]::-webkit-file-upload-button {
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  background: transparent;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
}

.form-section .field-helper {
  margin-top: 4px;
    font-size: 11px;
  color: #6b7280;
}

#case_detail,#rma-detail {
 .field-helper, .field-wrapper label::after {
  display: none;
}
} 


.field-errors {
  font-size: 11px;
  color: #e53e3e;
  display: flex;
  flex-direction: column;

  >div {
    margin-top: 4px;
    min-height: 14px;
  }

}


/* ── LiveSearch ── */
.livesearch {
  position: relative;
}

.livesearch__input {
  width: 100%;
  box-sizing: border-box;
}

.livesearch__dropdown {
  position: absolute;
  z-index: 10;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

.livesearch__option {
  padding: 8px;
  cursor: pointer;
}

.livesearch__option:hover,
.livesearch__option--active {
  background: #f3f4f6;
}

.livesearch__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.livesearch__tag {
  background: #e0f2fe;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: .8rem;
  display: flex;
  align-items: center;
  gap: 4px;
}

.livesearch__tag button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.livesearch__status {
  padding: 8px;
  font-size: .85rem;
  color: #888;
  list-style: none;
}

.livesearch__status--error {
  color: #dc2626;
}

/* ── Multiselect ── */
.multiselect {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.multiselect__option {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
}


 

#rma_form,#rma-detail, #case_detail {
    .form-section__title {
        display: none;
    }
}


@media (max-width: 1200px) {
  .form-subsection__title {
    grid-column: span 2;
  }



  .form-subsection {
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
  }
}


@media (max-width: 768px) {

  .left-column,
  .right-column {
    margin: 0 0 15px 0 !important;
    width: 100% !important;
    padding: 10px 20px !important;
  }

          .right-column {
              padding: 10px 5px !important;
        }
}


@media (max-width: 480px) {

  .form-subsection__title {
    grid-column: span 1;
  }

    [data-field="file_upload"] {
    grid-column: span 1 !important;
  }
  .form-subsection {
    gap: 10px;
    grid-template-columns: 1fr;
  }

  #rma_form, .footer-form,
  #form-section-medias {
    padding: 0px !important;
  }


}
