/**
 * Discounts Bolt - Frontend Styles
 */

/* Discount Code Input Section */
.discount-code-section {
  margin: 16px 0;
  padding: 16px;
  background: #f9fafb;
  border-radius: 8px;
}

.discount-input-wrapper {
  display: flex;
  gap: 8px;
}

.discount-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  font-family: inherit;
}

.discount-input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.discount-input::placeholder {
  text-transform: none;
  color: #9ca3af;
}

.discount-apply-btn {
  padding: 10px 20px;
  background: #374151;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.discount-apply-btn:hover {
  background: #1f2937;
}

.discount-apply-btn:disabled {
  background: #9ca3af;
  cursor: not-allowed;
}

.discount-apply-btn.loading {
  position: relative;
  color: transparent;
}

.discount-apply-btn.loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  top: 50%;
  left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: discount-spin 0.6s linear infinite;
}

@keyframes discount-spin {
  to { transform: rotate(360deg); }
}

/* Discount Message */
.discount-message {
  margin-top: 8px;
  font-size: 0.85rem;
  min-height: 20px;
}

.discount-message.success {
  color: #059669;
}

.discount-message.error {
  color: #dc2626;
}

/* Applied Discount Display */
.discount-applied {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 6px;
}

.discount-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.discount-label {
  font-size: 0.85rem;
  color: #065f46;
}

.discount-code {
  font-family: monospace;
  font-weight: 600;
  background: #d1fae5;
  padding: 2px 8px;
  border-radius: 4px;
  color: #065f46;
}

.discount-savings {
  font-weight: 600;
  color: #059669;
}

.discount-remove {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.15s;
}

.discount-remove:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Checkout Summary Discount Row */
.checkout-discount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
  color: #059669;
}

.checkout-discount-row .discount-code-tag {
  font-family: monospace;
  font-size: 0.85rem;
  background: #d1fae5;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 8px;
}

.checkout-discount-row .discount-amount {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 480px) {
  .discount-input-wrapper {
    flex-direction: column;
  }
  
  .discount-apply-btn {
    width: 100%;
  }
  
  .discount-applied {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }
  
  .discount-info {
    justify-content: center;
  }
}
