/* Checkout Page Specific Styles */

/* Checkout Progress Animation */
@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes stepComplete {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Progress Bar Animation */
.h-1.bg-primary {
  animation: progressFill 0.8s ease-out;
}

/* Step Completion Animation */
.w-10.h-10.bg-primary {
  animation: stepComplete 0.6s ease-out;
}

/* Form Animations */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInFromLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.checkout-step {
  animation: slideInFromRight 0.6s ease-out;
}

/* Form Input Focus */
input:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(138, 0, 0, 0.1);
  border-color: var(--sqube-red);
}

/* Payment Option Selection */
.payment-option input:checked + div {
  border-color: var(--sqube-red);
  background-color: rgba(138, 0, 0, 0.05);
}

.payment-option:hover div {
  border-color: var(--sqube-red);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 0, 0, 0.15);
}

/* Payment Details Animation */
.payment-details {
  animation: slideInFromLeft 0.4s ease-out;
}

/* Order Summary Sticky */
.sticky {
  position: sticky;
  top: 2rem;
}

/* Cart Item Hover */
.flex.items-center.space-x-4:hover {
  transform: translateX(4px);
  transition: transform 0.3s ease;
}

/* Button Animations */
button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 0, 0, 0.3);
}

#next-btn:hover,
#prev-btn:hover {
  transform: translateY(-2px);
}

/* Promo Code Input */
input[placeholder="Promo code"]:focus {
  border-color: var(--sqube-orange);
  box-shadow: 0 0 0 3px rgba(133, 49, 0, 0.1);
}

/* Security Badge */
.bg-background {
  transition: all 0.3s ease;
}

.bg-background:hover {
  background-color: rgba(138, 0, 0, 0.05);
  transform: scale(1.02);
}

/* Trust Indicators */
.flex.flex-col.items-center:hover {
  transform: translateY(-4px);
  transition: transform 0.3s ease;
}

.flex.flex-col.items-center:hover .w-16.h-16 {
  transform: scale(1.1);
  transition: transform 0.3s ease;
}

/* Form Validation */
input:invalid {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input:valid {
  border-color: #22c55e;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--sqube-red);
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Step Transitions */
.checkout-step.hidden {
  display: none;
}

.checkout-step:not(.hidden) {
  display: block;
  animation: slideInFromRight 0.6s ease-out;
}

/* Order Summary Animations */
.space-y-4 > div {
  animation: slideInFromLeft 0.4s ease-out;
  animation-fill-mode: both;
}

.space-y-4 > div:nth-child(1) {
  animation-delay: 0.1s;
}
.space-y-4 > div:nth-child(2) {
  animation-delay: 0.2s;
}
.space-y-4 > div:nth-child(3) {
  animation-delay: 0.3s;
}

/* Trust Indicators Animation */
.grid.grid-cols-1.md\\:grid-cols-3 > div {
  animation: slideInFromLeft 0.6s ease-out;
  animation-fill-mode: both;
}

.grid.grid-cols-1.md\\:grid-cols-3 > div:nth-child(1) {
  animation-delay: 0.1s;
}
.grid.grid-cols-1.md\\:grid-cols-3 > div:nth-child(2) {
  animation-delay: 0.2s;
}
.grid.grid-cols-1.md\\:grid-cols-3 > div:nth-child(3) {
  animation-delay: 0.3s;
}

/* Responsive Design */
@media (max-width: 768px) {
  .checkout-step {
    animation: none;
  }

  .sticky {
    position: static;
  }

  .grid.grid-cols-1.lg\\:grid-cols-3 {
    grid-template-columns: 1fr;
  }

  .flex.items-center.justify-between {
    flex-direction: column;
    gap: 1rem;
  }

  .flex-1.h-1 {
    display: none;
  }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
  .bg-background {
    background-color: #1a1a1a;
  }

  .bg-background {
    background-color: #2d2d2d;
    color: #ffffff;
  }

  .text-text {
    color: #a0a0a0;
  }

  .border-gray-300 {
    border-color: #4a4a4a;
  }

  .bg-background {
    background-color: #3a3a3a;
  }
}
