/* SayWOW Streamlined Checkout - Mobile-First Styles */

/* ============================================
   CHECKOUT FIELDS
   ============================================ */

.saywow-checkout-field {
    margin-bottom: 20px;
}

/* Touch-friendly inputs (Apple guidelines: min 44px) */
.woocommerce-checkout input[type="text"],
.woocommerce-checkout input[type="email"],
.woocommerce-checkout input[type="tel"],
.woocommerce-checkout input[type="password"],
.woocommerce-checkout select,
.woocommerce-checkout textarea {
    min-height: 48px !important;
    font-size: 16px !important; /* Prevents iOS zoom */
    padding: 12px 15px !important;
    border-radius: 4px;
    border: 2px solid #ddd;
    transition: border-color 0.3s;
}

.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 1px #2271b1;
}

/* Field descriptions */
.woocommerce-checkout .description {
    font-size: 13px;
    color: #646970;
    font-style: italic;
    margin-top: 5px;
    display: block;
}

/* ============================================
   AGE VERIFICATION (v2.0.0+)
   See age-verification.css for styles
   ============================================ */

/* ============================================
   VALIDATION STATES
   ============================================ */

/* Error state */
.woocommerce-invalid input,
.woocommerce-invalid select {
    border-color: #d63638 !important;
    background-color: #fff5f5 !important;
}

/* Success state */
.woocommerce-validated input,
.woocommerce-validated select {
    border-color: #00a32a !important;
}

/* Real-time validation messages */
.saywow-field-validation {
    margin-top: 5px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 4px;
}

.saywow-field-validation.error {
    background: #fff5f5;
    color: #d63638;
    border-left: 3px solid #d63638;
}

.saywow-field-validation.success {
    background: #f0f6f0;
    color: #00a32a;
    border-left: 3px solid #00a32a;
}

.saywow-field-validation.warning {
    background: #fff8e5;
    color: #dba617;
    border-left: 3px solid #dba617;
}

/* ============================================
   WINNER NOTICE
   ============================================ */

.saywow-winner-notice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 30px !important;
    border-radius: 8px !important;
    border: none !important;
    margin-bottom: 30px !important;
}

.saywow-winner-notice h2 {
    color: white !important;
    margin-top: 0;
    font-size: 24px;
}

.saywow-winner-notice p {
    color: white !important;
    opacity: 0.95;
}

.saywow-winner-notice .button {
    background: white;
    color: #764ba2;
    border: none;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 4px;
    transition: all 0.3s;
}

.saywow-winner-notice .button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ============================================
   MOBILE OPTIMIZATION
   ============================================ */

/* Stack fields on mobile */
@media (max-width: 767px) {
    .woocommerce-checkout .form-row-first,
    .woocommerce-checkout .form-row-last {
        width: 100% !important;
        float: none !important;
    }
    
    .saywow-dob-field {
        width: 100% !important;
        margin-bottom: 15px;
    }
}

/* Large buttons for mobile */
.woocommerce-checkout #place_order {
    min-height: 54px;
    font-size: 18px;
    padding: 15px 30px;
    width: 100%;
    border-radius: 8px;
    background: #2271b1;
    border: none;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.woocommerce-checkout #place_order:hover {
    background: #135e96;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus indicators */
.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Required field indicators */
.required {
    color: #d63638;
    font-weight: bold;
}

/* ============================================
   LOADING STATES
   ============================================ */

.saywow-checking {
    opacity: 0.6;
    pointer-events: none;
}

.saywow-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2271b1;
    border-radius: 50%;
    animation: saywow-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes saywow-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   TRUST SIGNALS
   ============================================ */

.woocommerce-checkout-payment {
    background: #f6f7f7;
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.woocommerce-terms-and-conditions-wrapper {
    background: white;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

/* ============================================
   RESPONSIVE IMPROVEMENTS
   ============================================ */

/* Note: max-width constraint removed in v2.0.2 - was causing layout issues */

/* ============================================
   PRINT STYLES (for order confirmation)
   ============================================ */

@media print {
    .saywow-winner-notice,
    .saywow-field-validation {
        display: none;
    }
}

/* ============================================
   EMAIL DETECTION & RETURNING CUSTOMER
   ============================================ */

.saywow-returning-customer-wrapper {
    margin-bottom: 30px;
}

.saywow-login-prompt {
    background: #e7f7ff !important;
    border-left: 4px solid #2271b1 !important;
    padding: 20px !important;
    border-radius: 4px;
    margin-bottom: 20px !important;
}

.saywow-login-prompt strong {
    font-size: 16px;
    color: #1d2327;
}

.saywow-login-prompt .button {
    margin-top: 0;
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.saywow-login-prompt .button:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34, 113, 177, 0.3);
}

.saywow-continue-guest {
    color: #646970;
    text-decoration: underline;
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s;
}

.saywow-continue-guest:hover {
    color: #2271b1;
    text-decoration: none;
}

#saywow-login-form-wrapper {
    background: #f6f7f7;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2271b1;
}

#saywow-login-form-wrapper .form-row {
    margin-bottom: 15px;
}

#saywow-login-form-wrapper input[type="text"],
#saywow-login-form-wrapper input[type="password"] {
    width: 100%;
    min-height: 48px;
    font-size: 16px;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

#saywow-login-form-wrapper input:focus {
    border-color: #2271b1;
    outline: none;
}

#saywow-login-form-wrapper .lost_password {
    margin-top: 15px;
    font-size: 14px;
}

#saywow-login-form-wrapper .lost_password a {
    color: #2271b1;
    text-decoration: none;
}

#saywow-login-form-wrapper .lost_password a:hover {
    text-decoration: underline;
}

/* Mobile optimization for login form */
@media (max-width: 767px) {
    .saywow-login-prompt {
        padding: 15px !important;
    }
    
    .saywow-login-prompt .button {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .saywow-continue-guest {
        display: block;
        text-align: center;
        margin-top: 10px;
    }
    
    #saywow-login-form-wrapper {
        padding: 20px 15px;
    }
}

/* ============================================
   TERMS & CONDITIONS LIGHTBOX
   ============================================ */

.saywow-terms-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.saywow-terms-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.saywow-terms-content {
    position: relative;
    background: #fff;
    width: 100%;
    max-width: 800px;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    animation: saywowSlideUp 0.3s ease-out;
    overflow: hidden; /* Keep border-radius clean */
}

@keyframes saywowSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.saywow-terms-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.saywow-terms-close:hover {
    background: #e0e0e0;
    color: #333;
}

.saywow-terms-body {
    padding: 40px;
    padding-right: 25px; /* Account for scrollbar */
    overflow-y: auto;
    flex: 1;
}

/* Custom scrollbar for better appearance */
.saywow-terms-body::-webkit-scrollbar {
    width: 8px;
}

.saywow-terms-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.saywow-terms-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.saywow-terms-body::-webkit-scrollbar-thumb:hover {
    background: #999;
}

.saywow-terms-body h1,
.saywow-terms-body h2,
.saywow-terms-body h3 {
    margin-top: 0;
    color: #1d2327;
}

.saywow-terms-body h1:first-child,
.saywow-terms-body h2:first-child {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.saywow-terms-body p {
    line-height: 1.7;
    color: #444;
}

.saywow-terms-body ul,
.saywow-terms-body ol {
    padding-left: 25px;
    line-height: 1.7;
}

.saywow-terms-loading {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    font-size: 16px;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .saywow-terms-lightbox {
        padding: 10px;
    }
    
    .saywow-terms-content {
        max-height: 90vh;
    }
    
    .saywow-terms-body {
        padding: 25px 20px;
    }
    
    .saywow-terms-close {
        top: 10px;
        right: 10px;
    }
}
