/* ============================================
   PRODUCT PANEL - Gestión de Productos
   ============================================ */

.product-panel {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.product-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.product-panel-header h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.product-panel-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.product-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #23d160 0%, #12a14a 100%);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(35, 209, 96, 0.3);
}

.product-add-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(35, 209, 96, 0.4);
}

.product-add-btn.primary {
  background: linear-gradient(135deg, #23d160 0%, #12a14a 100%);
}

.product-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

/* Product Form */
.product-form-container {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.product-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.product-form-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  margin: 0;
}

.product-form-close-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.7);
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-form-close-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.product-form-close-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-form .form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-form .form-field label {
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-form .form-field label input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.product-form .form-field input,
.product-form .form-field textarea,
.product-form .form-field select {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.product-form .form-field input:focus,
.product-form .form-field textarea:focus,
.product-form .form-field select:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(35, 209, 96, 0.5);
  box-shadow: 0 0 0 3px rgba(35, 209, 96, 0.1);
}

.product-form .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.product-form .form-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.product-form .form-actions button {
  flex: 1;
}

/* Product List */
.product-list {
  width: 100%;
}

.product-list-loading,
.product-list-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  color: rgba(255, 255, 255, 0.6);
}

.product-list-empty svg {
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 16px;
}

.product-list-empty h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}

.product-list-empty p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0 0 24px 0;
}

.product-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.product-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(35, 209, 96, 0.3);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.product-card-image {
  position: relative;
  width: 100%;
  height: 200px;
  background: rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.3);
}

.product-featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 193, 7, 0.9);
  border-radius: 20px;
  color: #000;
  font-size: 12px;
  font-weight: 600;
}

.product-card-content {
  padding: 20px;
}

.product-card-content h3 {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin: 0 0 8px 0;
}

.product-card-description {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.6);
  margin: 0 0 12px 0;
  line-height: 1.5;
}

.product-card-price {
  font-size: 20px;
  font-weight: 700;
  color: #23d160;
  margin-bottom: 12px;
}

.product-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.product-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(35, 209, 96, 0.15);
  border: 1px solid rgba(35, 209, 96, 0.3);
  border-radius: 12px;
  font-size: 12px;
  color: rgba(35, 209, 96, 0.9);
}

.product-card-status {
  margin-bottom: 16px;
}

.status-active {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(35, 209, 96, 0.15);
  border: 1px solid rgba(35, 209, 96, 0.3);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #23d160;
}

.status-inactive {
  display: inline-block;
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.5);
}

.product-card-actions {
  display: flex;
  gap: 8px;
}

.product-card-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.product-card-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(35, 209, 96, 0.5);
  color: #fff;
}

.product-card-btn.danger:hover {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.3);
  color: #fca5a5;
}

.existing-images {
  margin-bottom: 12px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.image-preview-grid img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Asegurar que las imágenes dentro de image-preview-item se vean */
.image-preview-grid .image-preview-item img {
  width: 100% !important;
  height: 100% !important;
  min-height: 80px !important;
  object-fit: cover !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.image-preview-item {
  position: relative;
  width: 100%;
  height: 80px;
  min-height: 80px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.image-preview-item img {
  width: 100% !important;
  height: 100% !important;
  min-height: 80px !important;
  object-fit: cover !important;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.image-remove-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.9);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.image-remove-btn:hover:not(:disabled) {
  background: rgba(220, 38, 38, 1);
  transform: scale(1.1);
}

.image-remove-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.image-remove-btn svg {
  color: #fff;
  width: 14px;
  height: 14px;
}

.image-preview-section {
  margin-top: 12px;
}

.add-more-images-btn {
  margin-top: 12px;
  padding: 8px 16px;
  background: rgba(35, 209, 96, 0.15);
  border: 1px solid rgba(35, 209, 96, 0.3);
  border-radius: 8px;
  color: rgba(35, 209, 96, 0.9);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s ease;
  display: inline-block;
}

.add-more-images-btn:hover:not(:disabled) {
  background: rgba(35, 209, 96, 0.25);
  border-color: rgba(35, 209, 96, 0.5);
  color: #23d160;
}

.add-more-images-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.file-preview {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(35, 209, 96, 0.1);
  border: 1px solid rgba(35, 209, 96, 0.2);
  border-radius: 8px;
  font-size: 12px;
  color: rgba(35, 209, 96, 0.9);
}

/* Responsive */
@media (max-width: 768px) {
  .product-form-container {
    padding: 24px 20px;
  }

  .product-form .form-row {
    grid-template-columns: 1fr;
  }

  .product-list-grid {
    grid-template-columns: 1fr;
  }

  .product-panel-header {
    flex-direction: column;
    align-items: stretch;
  }

  .product-panel-actions {
    width: 100%;
    justify-content: space-between;
  }
}

