/* NS4L Custom Points Redemption - Elegant Minimal Styles */

/* Checkout Points Redirect Message */
.ns4l-checkout-points-redirect {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.ns4l-checkout-points-redirect:before {
  display: none !important;
}

.ns4l-checkout-points-content {
  margin: 0;
}

.points-redirect-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.points-redirect-info strong {
  color: #374151;
  font-weight: 600;
  margin: 0;
}

.ns4l-scroll-to-points {
  color: #3b82f6 !important;
  font-weight: 500;
  text-decoration: none !important;
  border-bottom: 1px solid #3b82f6;
  padding-bottom: 1px;
  transition: all 0.2s ease;
}

.ns4l-scroll-to-points:hover {
  color: #1d4ed8 !important;
  border-bottom-color: #1d4ed8;
}

/* Responsive adjustments for checkout message */
@media (max-width: 768px) {
  .ns4l-checkout-points-redirect {
    padding: 12px;
    margin: 12px 0;
  }
  
  .points-redirect-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* Cart Points Message */
.ns4l-cart-points-message {
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.ns4l-cart-points-message:before {
  display: none !important;
}

.ns4l-cart-points-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.points-earning-info {
  padding: 12px 16px;
  border-radius: 6px;
  border-left: 4px solid transparent;
  background: #dbeafe;
  border-left-color: #3b82f6;
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.points-earning-info strong {
  color: #1e40af;
  font-size: 15px;
  /* display: block; */
  /* margin-bottom: 6px; */
}

.points-earning-info p {
  color: #1e3a8a;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  line-height: 1.5;
  /* display: flex;
    gap: 6px;
    align-items: center; */
}

.points-earning-info p strong {
  margin: 0;
}

.checkout-reminder {
  background: #f0f9ff;
  padding: 10px 14px;
  border-radius: 5px;
  border: 1px solid #bae6fd;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.checkout-reminder em {
  color: #0369a1;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .ns4l-cart-points-message {
    padding: 16px;
    margin: 16px 0;
  }

  .ns4l-cart-points-content {
    gap: 12px;
  }

  .points-earning-info {
    padding: 10px 12px;
  }
}

.ns4l-custom-points-redemption-block {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  padding: 16px !important;
}

.wc-block-components-order-meta:has(.ns4l-custom-points-redemption-block) {
  padding: 0 10px !important;
}

/* Header Section - Minimal */
.points-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #f3f4f6;
}

.points-title {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: #374151;
  font-weight: 600;
}

.points-balance {
  font-size: 13px;
  color: #6b7280;
  white-space: nowrap;
}

.balance-label {
  margin-right: 4px;
}

.balance-value {
  font-weight: 600;
  color: #059669;
}

/* Applied Discount Section - Compact */
.points-applied-section {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.applied-discount-info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.discount-icon {
  font-size: 16px;
}

.discount-details {
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
}

.discount-label {
  color: #0369a1;
  font-weight: 500;
  margin-bottom: 2px;
  margin: 0 !important;
}

.discount-amount {
  font-size: 15px;
  font-weight: 600;
  color: #0369a1;
}

.button-remove-points {
  background: #ef4444 !important;
  color: white !important;
  border: none !important;
  padding: 8px 8px !important;
  border-radius: 3px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  cursor: pointer !important;
  transition: background-color 0.2s ease !important;
  margin: 0 !important;
  line-height: 1;
}

.button-remove-points:hover:not(:disabled) {
  background: #dc2626 !important;
}

.button-remove-points:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Points Input Section - Streamlined */
.points-input-section {
  background: #fafafa;
  border-radius: 4px;
  padding: 12px;
  border: 1px solid #e5e7eb;
}

.input-group {
  margin-bottom: 10px;
}

.points-input-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
  margin-bottom: 6px;
}

/* Input with Controls - Refined */
.input-wrapper-with-controls {
  display: flex;
  align-items: stretch;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  overflow: hidden;
  background: white;
}

.input-wrapper-with-controls:focus-within {
  border-color: #3b82f6;
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.points-decrement-btn,
.points-increment-btn {
  background: #f9fafb;
  border: none;
  width: 32px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700 !important;
  color: #6b7280;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  line-height: 1;
  margin: 0;
  padding: 0;
  width: 40px;
  height: 40px;
}

.points-decrement-btn:hover:not(:disabled),
.points-increment-btn:hover:not(:disabled) {
  background: #e5e7eb;
  color: #374151;
}

.points-decrement-btn:active:not(:disabled),
.points-increment-btn:active:not(:disabled),
.points-decrement-btn.active,
.points-increment-btn.active {
  background: #3b82f6;
  color: white;
}

.points-decrement-btn:disabled,
.points-increment-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: stretch;
}

.points-input {
  flex: 1;
  border: none;
  padding: 0 8px;
  font-size: 14px;
  background: transparent;
  outline: none;
  text-align: center;
  margin: 0 !important;
  height: 100% !important;
}

.points-input::placeholder {
  color: #9ca3af;
  font-size: 13px;
}

.input-suffix {
  padding: 0 8px;
  background: #f3f4f6;
  color: #6b7280;
  font-weight: 500;
  font-size: 12px;
  border-left: 1px solid #e5e7eb;
  display: flex;
  align-items: center;
}

/* Discount Preview - Subtle */
.discount-preview {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fef3c7;
  border: 1px solid #fbbf24;
  border-radius: 3px;
  margin-bottom: 10px;
  justify-content: center;
}

.preview-icon {
  font-size: 14px;
}

.preview-text {
  font-size: 12px;
  font-weight: 500;
  color: #92400e;
}

/* Action Buttons - Clean */
.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.button-apply-points {
  flex: 1;
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  line-height: 1;
}

.button-apply-points:hover:not(:disabled) {
  background: #2563eb;
}

.button-apply-points:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.button-apply-points.loading {
  opacity: 0.7;
}

.button-reset-points {
  background: #6b7280;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.button-reset-points:hover:not(:disabled) {
  background: #4b5563;
}

.button-reset-points:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #9ca3af;
  color: #f3f4f6;
}

/* Helper Text - Inline with Apply Max */
.helper-text {
  font-size: 14px;
  color: #1e293b;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-weight: bold;
}

/* Points to Earn Section */
.points-to-earn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  margin-top: 12px;
}

.earn-icon {
  font-size: 16px;
}

.earn-text {
  font-size: 13px;
  font-weight: 500;
  color: #166534;
}

.apply-max-btn {
  background: none !important;
  border: none;
  color: #0053db !important;
  font-weight: 500 !important;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  transition: color 0.2s ease;
  padding: 6px 12px !important;
  line-height: 1;
  text-transform: uppercase;
  font-size: 14px !important;
  margin: 0 !important;
}

.apply-max-btn:hover:not(:disabled) {
  color: #2563eb;
}

.apply-max-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  .ns4l-custom-points-redemption-block {
    padding: 12px;
    margin: 12px 0;
  }

  .points-header {
    align-items: flex-start;
    gap: 4px;
  }

  .points-balance {
    align-self: stretch;
  }

  .action-buttons {
    flex-direction: column;
  }

  .applied-discount-info {
    align-items: flex-start;
    gap: 4px;
  }

  .points-decrement-btn,
  .points-increment-btn {
    font-size: 14px;
  }

  .button-remove-points {
    padding: 14px 0px !important;
    font-size: 14px !important;
  }

  .button-apply-points  {
    padding: 14px 0px !important;
    font-size: 16px !important;
  }

  .button-apply-points,
  .button-reset-points {
    height: 32px;
    font-size: 13px;
  }
}

/* Focus styles for accessibility */
.points-input:focus,
.button-apply-points:focus,
.button-reset-points:focus,
.button-remove-points:focus,
.points-increment-btn:focus,
.points-decrement-btn:focus,
.apply-max-btn:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 1px;
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {

  .button-apply-points,
  .button-reset-points,
  .button-remove-points,
  .points-increment-btn,
  .points-decrement-btn,
  .apply-max-btn {
    transition: none;
  }
}

/* Toastify Custom Styles with Animation */
@keyframes toast-in {
  from {
    transform: translate(-50%, -100%);
    opacity: 0;
  }

  to {
    transform: translate(-50%, 0);
    opacity: 1;
  }
}

@keyframes toast-out {
  from {
    transform: translate(-50%, 0);
    opacity: 1;
  }

  to {
    transform: translate(-50%, -100%);
    opacity: 0;
  }
}

.toastify.toastify-top {
  position: fixed;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: toast-in 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

.toastify.toastify-top.toastify-end {
  animation: toast-out 0.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) both;
}

.ns4l-toast-success,
.ns4l-toast-error {
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  border-radius: 6px;
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.ns4l-toast-success {
  background: linear-gradient(135deg, #28a745, #218838);
}

.ns4l-toast-error {
  background: linear-gradient(135deg, #dc3545, #c82333);
}