/* Bulk Variant Selector Styles */

.bulk-variant-selector {
  background: #fff;
  border: 1px solid #d1d8dd;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
}

.variant-header {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e8ecef;
}

.variant-header h4 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 600;
  color: #2e3338;
}

.variant-header p {
  margin: 0;
  font-size: 14px;
}

.variant-table-container {
  overflow-x: auto;
  margin-bottom: 20px;
}

.variant-table {
  width: 100%;
  margin-bottom: 0;
}

.variant-table thead th {
  background-color: #f5f7fa;
  font-weight: 600;
  color: #2e3338;
  border-bottom: 2px solid #d1d8dd;
  padding: 12px;
  font-size: 14px;
}

.variant-table tbody td {
  padding: 12px;
  vertical-align: middle;
  font-size: 14px;
}

.variant-table tbody tr:hover {
  background-color: #f9fafb;
}

.variant-qty-input {
  width: 100px;
  padding: 6px 10px;
  border: 1px solid #d1d8dd;
  border-radius: 4px;
  font-size: 14px;
}

.variant-qty-input:focus {
  border-color: #2490ef;
  outline: none;
  box-shadow: 0 0 0 2px rgba(36, 144, 239, 0.1);
}

.variant-qty-input:disabled {
  background-color: #f5f7fa;
  cursor: not-allowed;
}

.variant-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.variant-actions .btn {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.variant-actions .btn-primary {
  background-color: #2490ef;
  border-color: #2490ef;
  color: #fff;
}

.variant-actions .btn-primary:hover {
  background-color: #1a7fd4;
  border-color: #1a7fd4;
}

.variant-actions .btn-secondary {
  background-color: #fff;
  border-color: #d1d8dd;
  color: #4c5a67;
}

.variant-actions .btn-secondary:hover {
  background-color: #f5f7fa;
  border-color: #b8c2cc;
}

.variant-summary {
  margin-top: 15px;
}

.variant-summary .alert {
  margin-bottom: 0;
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
}

.variant-summary .alert-info {
  background-color: #e8f4fd;
  border-color: #bee5f8;
  color: #0c5460;
}

/* Badge styles */
.badge {
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 500;
  border-radius: 4px;
  display: inline-block;
}

.badge-success {
  background-color: #d4edda;
  color: #155724;
}

.badge-warning {
  background-color: #fff3cd;
  color: #856404;
}

.badge-info {
  background-color: #d1ecf1;
  color: #0c5460;
}

.badge-danger {
  background-color: #f8d7da;
  color: #721c24;
}

/* Stock status colors */
.text-success {
  color: #28a745 !important;
  font-weight: 500;
}

.text-danger {
  color: #dc3545 !important;
  font-weight: 500;
}

.text-warning {
  color: #ffc107 !important;
  font-weight: 500;
}

/* Responsive design */
@media (max-width: 768px) {
  .variant-table-container {
    overflow-x: scroll;
  }

  .variant-table {
    min-width: 600px;
  }

  .variant-actions {
    flex-direction: column;
    width: 100%;
  }

  .variant-actions .btn {
    width: 100%;
  }
}

/* Cart backorder warning */
.cart-backorder-warning {
  background-color: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  padding: 15px;
  margin: 15px 0;
}

.cart-backorder-warning .warning-icon {
  color: #856404;
  font-size: 20px;
  margin-right: 10px;
}

.cart-backorder-warning .warning-text {
  color: #856404;
  font-size: 14px;
  line-height: 1.5;
}

.cart-backorder-warning .warning-text strong {
  font-weight: 600;
}

/* Hide default webshop "Select Variant" button — replaced by bulk variant selector */
.product-details .btn-configure,
.item-configure-area .btn-configure,
.btn-configure,
a.btn-configure {
  display: none !important;
}

.item-configurator-dialog {
  display: none !important;
}

/* Product page integration */
.product-page-content .bulk-variant-container {
  margin-top: 30px;
}

.product-page-content .standard-add-to-cart {
  display: none; /* Hide standard single-item add to cart when bulk selector is active */
}

/* Loading state */
.bulk-variant-selector.loading {
  opacity: 0.6;
  pointer-events: none;
}

.bulk-variant-selector .loading-spinner {
  text-align: center;
  padding: 40px;
}

.bulk-variant-selector .loading-spinner::after {
  content: "";
  display: inline-block;
  width: 30px;
  height: 30px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #2490ef;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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