@charset "UTF-8";

#modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 99999 !important;
  justify-content: center;
  align-items: center;
}

#modal.show {
  display: flex !important;
}

.modal-content {
  position: relative;
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  z-index: 100000 !important;
}

@media (max-width: 768px) {
  #modal {
    padding: 16px;
  }

  .modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 85vh;
    padding: 20px;
  }
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-inventory-form {
  width: 700px;
  max-width: 95vw;
  height: auto;
  max-height: 85vh;
  padding: 0;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  position: relative;
  z-index: 10001;
  animation: slideIn 0.3s ease-out;
}

.modal-inventory-form .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 32px;
  background-color: #ffffff;
  border-bottom: 2px solid #e5e7eb;
}

.modal-inventory-form .modal-header .modal-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 18px;
  border-radius: 50%;
  background-color: #f3f4f6;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-inventory-form .modal-header .modal-info:hover {
  background-color: #e5e7eb;
  color: #374151;
}

.modal-inventory-form .modal-header .form-title {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin: 0;
  flex: 1;
  text-align: center;
  padding: 0 16px;
}

.modal-inventory-form .modal-header .modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  font-size: 24px;
  border-radius: 8px;
  background-color: #f3f4f6;
  border: none;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-inventory-form .modal-header .modal-close:hover {
  background-color: #fee2e2;
  color: #dc2626;
  transform: rotate(90deg);
}

.modal-inventory-form .form-product {
  padding: 32px;
  overflow-y: auto;
  max-height: calc(85vh - 100px);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
}

.modal-inventory-form .form-product::-webkit-scrollbar {
  width: 8px;
}

.modal-inventory-form .form-product::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.modal-inventory-form .form-product::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 10px;
}

.modal-inventory-form .form-product::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

.modal-inventory-form .form-product .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-inventory-form .form-product .form-group:nth-child(8) {
  grid-column: 1/-1;
}

.modal-inventory-form .form-product .form-group .form-label {
  font-size: 14px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 2px;
}

.modal-inventory-form .form-product .form-group input,
.modal-inventory-form .form-product .form-group select,
.modal-inventory-form .form-product .form-group textarea {
  width: 100%;
  height: 44px;
  border-radius: 8px;
  border: 1.5px solid #d0d5dd;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  box-sizing: border-box;
  transition: all 0.2s ease;
  background-color: #ffffff;
}

.modal-inventory-form .form-product .form-group input:focus,
.modal-inventory-form .form-product .form-group select:focus,
.modal-inventory-form .form-product .form-group textarea:focus {
  outline: none;
  border-color: #005bb6;
  box-shadow: 0 0 0 3px rgba(0, 91, 182, 0.1);
}

.modal-inventory-form .form-product .form-group input::placeholder,
.modal-inventory-form .form-product .form-group select::placeholder,
.modal-inventory-form .form-product .form-group textarea::placeholder {
  color: #98a2b3;
}

.modal-inventory-form .form-product .form-group textarea {
  height: 100px;
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
}

.modal-inventory-form .form-product .form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23667085' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.modal-inventory-form .form-product .autopart-toggle {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 16px 20px;
  transition: all 0.2s ease;
}

.modal-inventory-form .form-product .autopart-toggle:has(input:checked) {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-color: #93c5fd;
}

.modal-inventory-form .form-product .autopart-toggle .autopart-toggle-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}

.modal-inventory-form .form-product .autopart-toggle .autopart-toggle-label input[type=checkbox] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: #005bb6;
}

.modal-inventory-form .form-product .autopart-toggle .autopart-toggle-label span {
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.modal-inventory-form .form-product .auto-part-fields {
  grid-column: 1/-1;
  display: none;
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.modal-inventory-form .form-product .auto-part-fields.is-visible {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px 32px;
  opacity: 1;
  max-height: 1000px;
  /* ← aumenta esto */
  overflow: visible;
  /* ← cambia a visible */
  padding-top: 8px;
  margin-bottom: 16px;
  /* ← añade separación */
}

.modal-inventory-form .form-product .auto-part-fields .form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-inventory-form .form-product .form-img {
  grid-column: 1/-1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  border: 2px solid #d0d5dd;
  border-radius: 12px;
  transition: all 0.3s ease;
  margin-top: 16px;
  border: 2px solid #d0d5dd;
  border-radius: 12px;
  transition: all 0.3s ease;
}

.modal-inventory-form .form-product .form-img:has(input:focus) {
  border-color: #005bb6;
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.modal-inventory-form .form-product .form-img .form-label {
  font-size: 14px;
  font-weight: 600;
  color: #344054;
  margin-bottom: 4px;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper .custom-file-upload {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background-color: #ffffff;
  border: 1.5px solid #d0d5dd;
  border-radius: 8px;
  color: #344054;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper .custom-file-upload:hover {
  background-color: #f9fafb;
  border-color: #005bb6;
  color: #005bb6;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper .custom-file-upload::before {
  content: "📁";
  font-size: 18px;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper .custom-file-upload input[type=file] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.modal-inventory-form .form-product .form-img .image-upload-wrapper .file-name {
  font-size: 13px;
  color: #6b7280;
  font-style: italic;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-inventory-form .form-product .form-img .product-preview {
  width: 100%;
  max-width: 400px;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 2px solid #e5e7eb;
  padding: 8px;
  background-color: #ffffff;
  display: none;
  margin: 0 auto;
  transition: all 0.3s ease;
}

.modal-inventory-form .form-product .form-img .product-preview.show {
  display: block;
  animation: fadeInScale 0.3s ease-out;
}

.modal-inventory-form .form-product .form-img .image-info {
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
  margin-top: 8px;
}

.modal-inventory-form .form-product .form-img .image-info span {
  display: block;
  margin-top: 4px;
}

.modal-inventory-form .form-product .form-actions {
  grid-column: 1/-1;
  display: flex;
  gap: 16px;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid #e5e7eb;
}

.modal-inventory-form .form-product .form-actions button {
  flex: 1;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  height: 44px;
}

.modal-inventory-form .form-product .form-actions button:active {
  transform: scale(0.98);
}

.modal-inventory-form .form-product .form-actions .btn-save {
  background: linear-gradient(135deg, #005bb6 0%, #004a94 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 91, 182, 0.3);
}

.modal-inventory-form .form-product .form-actions .btn-save:hover {
  box-shadow: 0 6px 16px rgba(0, 91, 182, 0.4);
  transform: translateY(-1px);
}

.modal-inventory-form .form-product .form-actions .btn-cancel {
  background-color: #ffffff;
  color: #374151;
  border: 1.5px solid #d0d5dd;
}

.modal-inventory-form .form-product .form-actions .btn-cancel:hover {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 900px) {
  .modal-inventory-form {
    width: 90%;
  }

  .modal-inventory-form .form-product {
    padding: 24px;
    gap: 20px 24px;
  }
}

@media (max-width: 600px) {
  :root {
    --app-header-height: 72px;
  }

  .modal-overlay {
    padding: 0;
    top: var(--app-header-height);
    height: calc(100vh - var(--app-header-height));
    align-items: stretch;
    justify-content: stretch;
  }

  .modal-inventory-form {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
  }

  .modal-inventory-form .modal-header {
    padding: 16px 20px;
    position: sticky;
    top: 0;
    background-color: #ffffff;
    z-index: 10;
  }

  .modal-inventory-form .modal-header .modal-info {
    display: none;
  }

  .modal-inventory-form .modal-header .modal-close {
    width: auto;
    height: auto;
    background: none;
    padding: 8px;
    border-radius: 8px;
  }

  .modal-inventory-form .modal-header .modal-close::before {
    content: "←";
    font-size: 24px;
    font-weight: bold;
    color: #374151;
  }

  .modal-inventory-form .modal-header .modal-close {
    font-size: 0;
  }

  .modal-inventory-form .modal-header .modal-close:hover {
    background-color: #f3f4f6;
    transform: none;
  }

  .modal-inventory-form .modal-header .modal-close:hover::before {
    color: #005bb6;
  }

  .modal-inventory-form .modal-header .form-title {
    font-size: 18px;
    text-align: left;
    padding-left: 12px;
  }

  .modal-inventory-form .form-product {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 80px - 70px);
    max-height: calc(100vh - 80px - 70px);
    overflow-y: auto;
  }

  .modal-inventory-form .form-product .auto-part-fields.is-visible {
    grid-template-columns: 1fr;
  }

  .modal-inventory-form .form-product .form-group .form-label {
    font-size: 14px;
    font-weight: 600;
  }

  .modal-inventory-form .form-product .form-group input,
  .modal-inventory-form .form-product .form-group select,
  .modal-inventory-form .form-product .form-group textarea {
    font-size: 16px;
    height: 48px;
  }

  .modal-inventory-form .form-product .form-group input::placeholder,
  .modal-inventory-form .form-product .form-group select::placeholder,
  .modal-inventory-form .form-product .form-group textarea::placeholder {
    font-size: 14px;
  }

  .modal-inventory-form .form-product .form-group textarea {
    height: 120px;
  }

  .modal-inventory-form .form-product .form-img {
    padding: 16px;
  }

  .modal-inventory-form .form-product .form-img .product-preview {
    max-width: 100%;
    max-height: 200px;
  }

  .modal-inventory-form .form-product .form-img .image-upload-wrapper .custom-file-upload {
    font-size: 14px;
    padding: 10px 18px;
    width: 100%;
    justify-content: center;
  }

  .modal-inventory-form .form-product .form-img .file-name {
    max-width: 100%;
    text-align: center;
  }

  .modal-inventory-form .form-product .form-actions {
    bottom: 0;
    background-color: #ffffff;
    flex-direction: column;
    gap: 12px;
    margin: 0 -20px -20px -20px;
    padding: 16px 20px;
    border-top: 2px solid #e5e7eb;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  }

  .modal-inventory-form .form-product .form-actions button {
    width: 100%;
    height: 48px;
    font-size: 16px;
  }

  .modal-inventory-form .form-product .form-actions .btn-save {
    order: 1;
  }

  .modal-inventory-form .form-product .form-actions .btn-cancel {
    order: 2;
  }
}

@media (max-width: 600px) and (orientation: landscape) {
  .modal-overlay {
    padding-top: 60px;
  }

  .modal-inventory-form {
    height: calc(100vh - 60px);
    max-height: calc(100vh - 60px);
  }

  .modal-inventory-form .form-product {
    height: calc(100vh - 60px - 60px);
    max-height: calc(100vh - 60px - 60px);
    padding: 16px;
    gap: 16px;
  }

  .modal-inventory-form .form-product .form-group input,
  .modal-inventory-form .form-product .form-group select,
  .modal-inventory-form .form-product .form-group textarea {
    height: 40px;
  }

  .modal-inventory-form .form-product .form-actions {
    flex-direction: row;
  }

  .modal-inventory-form .form-product .form-actions button {
    height: 44px;
  }
}

@media (max-width: 768px) {
  .category-dropdown {
    display: block !important;
    margin-bottom: 12px;
  }

  .category-option li {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .category-dropdown {
    display: none !important;
  }

  .category-option li {
    display: block !important;
  }
}

.modal-inventory-form.view-mode .form-product input[readonly],
.modal-inventory-form.view-mode .form-product textarea[readonly],
.modal-inventory-form.view-mode .form-product select[disabled] {
  background-color: #f8f9fa;
  cursor: not-allowed;
  color: #495057;
  border-color: #dee2e6;
  opacity: 1;
}

/* ========================================
   ESTILOS PARA VALIDACIÓN DE CAMPOS
   ======================================== */

.error-message {
  color: #dc2626;
  font-size: 12px;
  margin-top: 4px;
  display: block;
  font-weight: 500;
}

.input-error {
  border-color: #dc2626 !important;
  background-color: #fef2f2 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1) !important;
}

.temp-warning {
  color: #ff9800 !important;
  font-size: 12px !important;
  margin-top: 4px !important;
  display: block !important;
  opacity: 1 !important;
  transition: opacity 0.3s ease !important;
  font-weight: 500 !important;
  animation: slideInWarning 0.3s ease;
}

@keyframes slideInWarning {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilo para campos con advertencia */
.input-warning {
  border-color: #ff9800 !important;
  background-color: #fff8e1 !important;
}

/* Autopart badge para modo vista */
.autopart-badge {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border: 1px solid #81c784;
  border-radius: 8px;
  margin: 8px 0;
}

.autopart-badge span {
  color: #2e7d32;
  font-weight: 600;
  font-size: 14px;
}

.autopart-badge {
  grid-column: 1/-1;
  background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
  color: white;
  padding: 12px 20px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  margin: 8px 0;
}

.autopart-badge span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

@media (max-width: 600px) {
  .autopart-badge {
    padding: 10px 16px;
  }

  .autopart-badge span {
    font-size: 14px;
  }
}

/*# sourceMappingURL=modal-add-product.css.map */