/**
 * Wollkugeli Stepper Styles
 * Responsive Design für Desktop und Mobile
 */

/* Stepper Container */
.wollkugeli-stepper {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  margin: 15px 0;
  font-family: inherit;
}

/* Stepper Controls Row */
.stepper-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

/* Stepper Price Display */
.stepper-price {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 500;
  width: 100%;
  gap: 8px;
}

.price-label {
  color: #666666;
}

.price-value {
  color: #007cba;
  font-weight: bold;
  font-size: 18px;
}

/* Stepper Buttons */
.stepper-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid #e0e0e0;
  background: #ffffff;
  color: #333333;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.stepper-btn:hover {
  border-color: #007cba;
  background: #f8f9fa;
  color: #007cba;
}

.stepper-btn:active {
  transform: scale(0.95);
  background: #e3f2fd;
}

.stepper-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #e0e0e0;
  background: #f5f5f5;
  color: #999999;
}

.stepper-btn:disabled:hover {
  border-color: #e0e0e0;
  background: #f5f5f5;
  color: #999999;
  transform: none;
}

/* Stepper Icon */
.stepper-icon {
  line-height: 1;
  font-size: 20px;
  font-weight: 300;
}

/* Input Wrapper */
.stepper-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 80px;
}

/* Stepper Input */
.stepper-input {
  width: 100%;
  height: 48px;
  padding: 0 35px 0 8px;
  border: 2px solid #e0e0e0;
  background: #ffffff;
  color: #333333;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  border-radius: 6px;
  transition: border-color 0.2s ease;
  -moz-appearance: textfield; /* Firefox: Spinner entfernen */
}

.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none; /* Chrome/Safari: Spinner entfernen */
  margin: 0;
}

.stepper-input:focus {
  outline: none;
  border-color: #007cba;
  box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.stepper-input:invalid {
  border-color: #dc3545;
}

/* Unit Label */
.stepper-unit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666666;
  font-weight: 500;
  pointer-events: none;
}

/* State Classes */
.wollkugeli-stepper.at-min .stepper-minus {
  opacity: 0.5;
  cursor: not-allowed;
}

.wollkugeli-stepper.at-max .stepper-plus {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .wollkugeli-stepper {
    max-width: 100%;
    gap: 6px;
  }

  .stepper-btn {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .stepper-input {
    height: 44px;
    font-size: 18px;
    padding: 0 30px 0 6px;
  }

  .stepper-unit {
    font-size: 14px;
    right: 6px;
  }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
  .stepper-btn {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .stepper-input {
    height: 48px;
    font-size: 20px;
  }

  .stepper-btn:active {
    background: #e3f2fd;
    transform: scale(0.9);
  }
}

/* Dark Mode Support (falls Theme es unterstützt) */
@media (prefers-color-scheme: dark) {
  .stepper-btn {
    border-color: #404040;
    background: #2a2a2a;
    color: #ffffff;
  }

  .stepper-btn:hover {
    border-color: #007cba;
    background: #1a1a1a;
  }

  .stepper-input {
    border-color: #404040;
    background: #2a2a2a;
    color: #ffffff;
  }

  .stepper-input:focus {
    border-color: #007cba;
  }

  .stepper-unit {
    color: #cccccc;
  }
}

/* Integration mit WooCommerce */
.woocommerce .wollkugeli-stepper {
  margin: 15px 0;
}

.woocommerce .wollkugeli-stepper .stepper-btn {
  border-color: #d3d3d3;
}

.woocommerce .wollkugeli-stepper .stepper-btn:hover {
  border-color: #a46497;
  color: #a46497;
}

.woocommerce .wollkugeli-stepper .stepper-input:focus {
  border-color: #a46497;
  box-shadow: 0 0 0 2px rgba(164, 100, 151, 0.1);
}

/* Animation für Wertänderungen */
.stepper-input {
  transition: all 0.2s ease;
}

.stepper-input.changed {
  background: #e8f5e8;
  border-color: #28a745;
}

/* Accessibility */
.stepper-btn:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

.stepper-input:focus {
  outline: 2px solid #007cba;
  outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .stepper-btn {
    border-width: 3px;
  }

  .stepper-input {
    border-width: 3px;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  .stepper-btn,
  .stepper-input {
    transition: none;
  }

  .stepper-btn:active {
    transform: none;
  }
}
