/* Reset e Base */
.hidden {
    display: none !important;
}

#checkout-ui-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    color: #1f2937;
    background-color: #f9fafb; /* gray-50 */
    overflow-x: hidden; /* Prevent global scrollbar */
    width: 100%;
}

#checkout-ui-wrapper *, 
#checkout-ui-wrapper *::before, 
#checkout-ui-wrapper *::after {
    box-sizing: border-box !important;
}

/* Fallback Grid System if Tailwind is missing */
@media (min-width: 1024px) {
    .lg\:grid-cols-12 {
        display: grid;
        grid-template-columns: repeat(12, minmax(0, 1fr));
    }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:col-span-5 { grid-column: span 5 / span 5; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .gap-6 { gap: 1.5rem; }
}

/* Header & Timer */
#checkout-ui-top-bar {
    background: #ef4444; /* red-500 */
    color: white;
}

/* Inputs */
#checkout-ui-wrapper input[type="text"],
#checkout-ui-wrapper input[type="email"],
#checkout-ui-wrapper input[type="tel"],
#checkout-ui-wrapper select {
    transition: all 0.2s ease-in-out;
    outline: none;
    max-width: 100%; /* Prevent overflow */
}

#checkout-ui-wrapper input:focus,
#checkout-ui-wrapper select:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

#checkout-ui-wrapper .input-error {
    border-color: #ef4444;
    animation: shake 0.4s cubic-bezier(.36,.07,.19,.97) both;
}

@keyframes shake {
  10%, 90% { transform: translate3d(-1px, 0, 0); }
  20%, 80% { transform: translate3d(2px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-4px, 0, 0); }
  40%, 60% { transform: translate3d(4px, 0, 0); }
}

/* Payment Methods */
.payment-method-radio input:checked + div {
    border-color: #10b981; /* green-500 */
    background-color: #ecfdf5; /* green-50 */
    box-shadow: 0 0 0 1px #10b981;
}

.payment-method-radio {
    flex: 1 1 45%;
    min-width: 120px;
}

.payment-method-radio > div {
    width: 100%;
}

#step2-col,
#step2-content,
.payment-method-container {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.payment-method-container * {
    max-width: 100%;
}

/* Mobile Stepper Styles - Refactored */
.mobile-stepper-line {
    position: absolute;
    left: 0;
    right: 0;
    top: 14px; /* Exact center of 28px circle */
    height: 2px;
    z-index: 1; /* Behind nodes (z-index 2) */
    margin-top: -1px; /* Exact vertical center adjustment */
    background: #e5e7eb; /* lighter gray */
}

.mobile-stepper-line-progress {
    position: absolute;
    left: 0;
    top: 14px; /* Exact center of 28px circle */
    height: 2px;
    z-index: 1; /* Behind nodes */
    margin-top: -1px;
    width: 0;
    /* Color handled by inline style or JS usually, but defaults to highlight via class */
}

.mobile-stepper-node {
    position: relative;
    z-index: 2; /* Above the line */
    background-color: #f9fafb; /* Matches page bg to mask line */
    padding: 0 10px; /* Breathing room around text/circle to mask line */
}

/* Mobile Responsive Fixes */
@media (max-width: 1023px) {
    #step2-col,
    #step2-content,
    .payment-method-container {
        overflow-x: hidden;
    }
    
    /* Stack payment methods on mobile for better touch targets and spacing */
    .payment-method-radio {
        flex-basis: 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    #step2-content {
        padding: 1rem !important; /* Slightly reduced padding */
    }
    
    /* Ensure inputs don't overflow */
    #checkout-ui-wrapper input {
        width: 100% !important;
        min-width: 0 !important;
    }
}

/* Order Bumps */
.order-bump-wrapper {
    transition: all 0.2s ease;
}

.order-bump-wrapper.bg-red-50 {
    background-color: #fef2f2;
    border-color: #ef4444;
    border-style: solid;
}

.orderbump-checkbox:checked + label .text-gray-800 {
    color: #ef4444;
}

/* Step Overlay */
#step2-overlay {
    backdrop-filter: blur(2px);
    transition: all 0.3s ease;
}

/* Scrollbar styling for smoother look */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1; 
}
::-webkit-scrollbar-thumb {
    background: #d1d5db; 
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #9ca3af; 
}
