/**
 * Cart Enhancements Styles
 * Styles for loyalty points, installments, and membership features
 */

/* Membership Tier Info */
.membership-tier-info {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-left: 4px solid var(--hisense-primary, #007cba);
}

.membership-info-section {
  padding: 15px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-radius: 25px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.tier-badge.tier-bronze {
  background: linear-gradient(135deg, #cd7f32 0%, #b8860b 100%);
  color: white;
}

.tier-badge.tier-silver {
  background: linear-gradient(135deg, #c0c0c0 0%, #a8a8a8 100%);
  color: #333;
}

.tier-badge.tier-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
  color: #333;
}

.tier-badge.tier-platinum {
  background: linear-gradient(135deg, #e5e4e2 0%, #c0c0c0 100%);
  color: #333;
}

.tier-badge.updated {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 124, 186, 0.3);
}

.tier-discount {
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.8em;
  font-weight: 700;
}

/* Loyalty Points Section */
.loyalty-points-section {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  border-left: 4px solid #f39c12;
}

.points-info-wrapper {
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.current-points,
.potential-points {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.points-label {
  font-size: 0.9em;
  color: #666;
  margin-bottom: 5px;
}

.points-value {
  font-size: 1.2em;
  font-weight: 700;
  color: #333;
}

.points-value.potential {
  color: #27ae60;
}

/* Points Redemption Form */

.points-redemption-form-wrapper {
  padding: 20px;
}

.redemption-input-group {
  margin-bottom: 15px;
}

.redemption-input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: #333;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}



.points-max {
  font-size: 0.9em;
  color: #666;
  white-space: nowrap;
}

.redemption-value-display {
  display: none !important;
  margin-top: 15px;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease-out;
}

.redemption-value-display.show {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
}

/* Legacy styles removed - now handled in cart-totals.php */

/* Coupon Form Styling */
.coupon-section {
  margin: 20px 0;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.coupon-section h4 {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
}

.woocommerce-coupon-form .coupon-code {
  display: flex;
  gap: 10px;
  align-items: center;
}

.apply-coupon-btn:disabled {
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Form Spacing */
.points-redemption-section,
.coupon-section {
  margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .woocommerce-coupon-form .coupon-code {
    flex-direction: column;
    gap: 10px;
  }

  .apply-coupon-btn,
  .redeem-points-btn {
    width: 100%;
    padding: 12px;
  }
}

/* Installment Options */
.installment-options-section {
  margin: 20px 0;
  padding: 20px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #dee2e6;
}

.installment-options-section h3 {
  margin: 0 0 20px 0;
  color: #333;
  font-size: 1.2em;
  font-weight: 600;
}

.installment-options {
  display: grid;
  gap: 12px;
}

.installment-option {
  position: relative;
}

.installment-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.installment-option label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: white;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.installment-option label:hover {
  border-color: var(--hisense-primary, #007cba);
  background: #f8f9fa;
}

.installment-option input[type="radio"]:checked+label {
  border-color: var(--hisense-primary, #007cba);
  background: rgba(0, 124, 186, 0.05);
  box-shadow: 0 2px 10px rgba(0, 124, 186, 0.1);
}

.option-title {
  font-weight: 600;
  color: #333;
}

.option-amount {
  font-weight: 700;
  color: var(--hisense-primary, #007cba);
}

.selected-installment-info {
  margin-top: 15px;
  padding: 12px 15px;
  background: rgba(0, 124, 186, 0.1);
  border-radius: 6px;
  border-left: 4px solid var(--hisense-primary, #007cba);
  color: #333;
}

/* Terms and Conditions */
.terms-conditions-section {
  margin: 20px 0;
  padding: 20px;
  background: #fff3cd;
  border-radius: 8px;
  border: 1px solid #ffeaa7;
}

.terms-checkbox-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.terms-checkbox-wrapper input[type="checkbox"] {
  margin-top: 3px;
  transform: scale(1.2);
}

.terms-checkbox-wrapper label {
  flex: 1;
  line-height: 1.5;
  color: #333;
}

.terms-checkbox-wrapper label a {
  color: var(--hisense-primary, #007cba);
  text-decoration: underline;
  font-weight: 600;
}

.terms-checkbox-wrapper label a:hover {
  color: #0056b3;
}

.terms-checkbox-wrapper.error-highlight {
  animation: errorShake 0.5s ease-in-out;
  background: #f8d7da;
  border-color: #f5c6cb;
  border-radius: 6px;
  padding: 10px;
}

@keyframes errorShake {

  0%,
  100% {
    transform: translateX(0);
  }

  25% {
    transform: translateX(-5px);
  }

  75% {
    transform: translateX(5px);
  }
}

/* Checkout Button States */
.wc-proceed-to-checkout a.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  background: #6c757d !important;
}

/* Responsive Design */
@media (max-width: 768px) {
  .points-info-wrapper {
    flex-direction: column;
    text-align: center;
  }

  .installment-option label {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }

  .terms-checkbox-wrapper {
    flex-direction: column;
    gap: 8px;
  }

  .terms-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0;
    align-self: flex-start;
  }
}

@media (max-width: 480px) {

  .installment-options-section,
  .terms-conditions-section {
    margin: 15px -10px;
    padding: 15px;
    border-radius: 0;
  }

  .points-redemption-form-wrapper {
    padding: 15px;
  }

  .input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .points-max {
    text-align: center;
    margin-top: 5px;
  }
}

/* Notice Styles */
.woocommerce-notices-wrapper:not(:empty) {
  margin-bottom: 20px;
}



.woocommerce-message,
.woocommerce-error {
  padding: 15px 20px 15px 50px;
  border-radius: 6px;
  margin-bottom: 15px;
  font-weight: 500;
  line-height: 1.2;
}

.woocommerce-message {
  background: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.woocommerce-error {
  background: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Points Discount Line in Order Summary */
.points-discount-line {
  background: rgba(40, 167, 69, 0.1) !important;
  border-left: 3px solid #28a745 !important;
}

.points-discount-line .lable-txt {
  color: #155724;
  font-weight: 600;
}

.points-discount-line .discount-amount {
  color: #28a745 !important;
  font-weight: 700;
}

.remove-points-discount-inline,
.remove-points-discount-checkout {
  background: none !important;
  border: none !important;
  color: #dc3545 !important;
  cursor: pointer !important;
  font-size: 14px !important;
  font-weight: bold !important;
  padding: 2px 6px !important;
  border-radius: 50% !important;
  transition: all 0.3s ease !important;
  margin-left: 8px !important;
}

.remove-points-discount-inline:hover,
.remove-points-discount-checkout:hover {
  background: #dc3545 !important;
  color: white !important;
  transform: scale(1.1);
}

/* Checkout Points Discount Styling */
.total-line.points-discount {
  background: rgba(40, 167, 69, 0.1);
  border-left: 3px solid #28a745;
  padding: 12px 15px;
  margin: 5px 0;
  border-radius: 4px;
}

.total-line.points-discount .label {
  color: #155724;
  font-weight: 600;
}

.total-line.points-discount .discount-amount {
  color: #28a745 !important;
  font-weight: 700;
}

/* Points Redemption Applied Display (Legacy - for any remaining usage) */
.points-redemption-applied {
  background: #d4edda !important;
  border-top: 2px solid #28a745 !important;
}

.points-redemption-summary {
  padding: 15px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.7);
}

.points-redemption-summary .remove-points-discount {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  padding: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.points-redemption-summary .remove-points-discount:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

.points-redemption-summary .redemption-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
}

.points-redemption-summary .points-used {
  display: flex;
  flex-direction: column;
}

.points-redemption-summary .discount-amount {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.points-redemption-summary .success-icon {
  color: #28a745;
  margin-right: 8px;
  font-size: 1.1em;
}

/* Loading States */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    left: -100%;
  }

  100% {
    left: 100%;
  }
}

/* Responsive Design for Points Redemption Display */
@media (max-width: 768px) {
  .points-redemption-summary {
    padding: 12px;
  }

  .points-redemption-summary .redemption-details {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }

  .points-redemption-summary .discount-amount {
    text-align: center;
  }
}