/**
 * eWP FastCart Frontend Styles
 * 
 * @package EWP_FastCart
 * @version 1.0.0
 */

/* ==========================================================================
   Fast Checkout Container
   ========================================================================== */

.ewp-fast-checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ewp-fast-checkout-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.ewp-fast-checkout-header h2 {
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.ewp-checkout-description {
    margin: 0;
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* ==========================================================================
   Layout
   ========================================================================== */

.ewp-fast-checkout-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .ewp-fast-checkout-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

/* ==========================================================================
   Left Column - Customer Info & Order Summary
   ========================================================================== */

.ewp-checkout-left {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.ewp-customer-info,
.ewp-order-summary {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
}

.ewp-customer-info h3,
.ewp-order-summary h3,
.ewp-payment-section h3 {
    margin: 0 0 20px 0;
    font-size: 1.3rem;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 2px solid #f3f4f6;
    padding-bottom: 10px;
}

/* ==========================================================================
   Form Fields
   ========================================================================== */

.ewp-fast-checkout-form .form-row {
    margin-bottom: 20px;
}

.ewp-fast-checkout-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #374151;
    font-size: 0.95rem;
}

.ewp-fast-checkout-form input[type="text"],
.ewp-fast-checkout-form input[type="email"],
.ewp-fast-checkout-form select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.ewp-fast-checkout-form input[type="text"]:focus,
.ewp-fast-checkout-form input[type="email"]:focus,
.ewp-fast-checkout-form select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.ewp-fast-checkout-form input.ewp-field-valid {
    border-color: #10b981;
    background-color: #f0fdf4;
}

.ewp-fast-checkout-form input.ewp-field-error {
    border-color: #ef4444;
    background-color: #fef2f2;
}

/* ==========================================================================
   Right Column - Payment Section
   ========================================================================== */

.ewp-checkout-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ewp-payment-section {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    position: sticky;
    top: 20px;
}

/* ==========================================================================
   Payment Methods
   ========================================================================== */

.wc_payment_methods {
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
}

.wc_payment_method {
    margin-bottom: 15px;
    padding: 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.wc_payment_method:hover {
    border-color: #667eea;
    background-color: #f8faff;
}

.wc_payment_method input[type="radio"] {
    margin-right: 10px;
}

.wc_payment_method label {
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.wc_payment_method img {
    margin-left: 10px;
    max-height: 24px;
}

.payment_box {
    margin-top: 15px;
    padding: 15px;
    background-color: #f9fafb;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

/* ==========================================================================
   Place Order Button
   ========================================================================== */

.ewp-place-order-btn {
    width: 100%;
    padding: 16px 24px;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ewp-place-order-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.ewp-place-order-btn:active {
    transform: translateY(0);
}

.ewp-place-order-btn.ewp-loading {
    cursor: not-allowed;
    opacity: 0.8;
}

.ewp-btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */

.ewp-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: ewp-spin 1s linear infinite;
}

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

/* ==========================================================================
   Security Info
   ========================================================================== */

.ewp-security-info {
    background: #f9fafb;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.ewp-security-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: #6b7280;
}

.ewp-security-item:last-child {
    margin-bottom: 0;
}

.ewp-security-item .dashicons {
    color: #10b981;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Progress Indicator
   ========================================================================== */

.ewp-progress-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 20px;
    background: #f9fafb;
    border-radius: 8px;
}

.ewp-progress-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #9ca3af;
    font-size: 0.9rem;
    position: relative;
}

.ewp-progress-step.ewp-active {
    color: #667eea;
    font-weight: 600;
}

.ewp-step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
}

.ewp-progress-step.ewp-active .ewp-step-number {
    background: #667eea;
    color: white;
}

.ewp-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    left: calc(100% + 10px);
    width: 20px;
    height: 2px;
    background: #e5e7eb;
    top: 50%;
    transform: translateY(-50%);
}

.ewp-progress-step.ewp-active:not(:last-child)::after {
    background: #667eea;
}

/* ==========================================================================
   Fast Buy Button (Product Page)
   ========================================================================== */

.ewp-fast-buy-container {
    margin: 20px 0;
    text-align: center;
}


.ewp-fast-buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    color: white;
}

.ewp-fast-buy-btn:active {
    transform: translateY(0);
}

.ewp-fast-buy-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.ewp-fast-buy-btn:hover::before {
    left: 100%;
}

/* ==========================================================================
   Order Review Table
   ========================================================================== */

.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
}

.woocommerce-checkout-review-order-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.woocommerce-checkout-review-order-table .cart_item td {
    vertical-align: top;
}

.woocommerce-checkout-review-order-table .product-name {
    font-weight: 500;
}

.woocommerce-checkout-review-order-table .product-total {
    text-align: right;
    font-weight: 600;
}

.woocommerce-checkout-review-order-table .order-total {
    background-color: #f9fafb;
    font-weight: 700;
    font-size: 1.1rem;
}

.woocommerce-checkout-review-order-table .order-total td {
    border-bottom: none;
    padding: 16px 12px;
}

/* ==========================================================================
   Create Account Section
   ========================================================================== */

.ewp-create-account {
    margin-top: 20px;
    padding: 15px;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}

.ewp-create-account label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    cursor: pointer;
    font-size: 0.95rem;
    color: #0369a1;
}

.ewp-create-account input[type="checkbox"] {
    width: auto;
    margin: 0;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 768px) {
    .ewp-fast-checkout-container {
        padding: 15px;
    }
    
    .ewp-fast-checkout-header {
        padding: 20px 15px;
    }
    
    .ewp-fast-checkout-header h2 {
        font-size: 2rem;
    }
    
    .ewp-customer-info,
    .ewp-order-summary,
    .ewp-payment-section {
        padding: 20px;
    }
    
    .ewp-progress-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .ewp-progress-step:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .ewp-fast-checkout-header h2 {
        font-size: 1.8rem;
    }
    
    .ewp-checkout-description {
        font-size: 1rem;
    }
    
    .ewp-customer-info,
    .ewp-order-summary,
    .ewp-payment-section {
        padding: 15px;
    }
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.ewp-fast-checkout-form input:focus,
.ewp-fast-checkout-form select:focus,
.ewp-place-order-btn:focus,
.ewp-fast-buy-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .ewp-place-order-btn,
    .ewp-fast-buy-btn,
    .ewp-fast-checkout-form input,
    .wc_payment_method {
        transition: none;
    }
    
    .ewp-spinner {
        animation: none;
    }
}

/* ==========================================================================
   Modal Styles
   ========================================================================== */

/* Prevent body scroll when modal is open */
body.ewp-modal-open {
    overflow: hidden;
}

/* Modal overlay and container styles are defined inline in the PHP template */

/* Modal-specific form styles */
#ewp-fast-buy-form .ewp-field-wrapper {
    margin-bottom: 15px;
}

#ewp-fast-buy-form .ewp-field-wrapper label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

#ewp-fast-buy-form .ewp-field-wrapper input,
#ewp-fast-buy-form .ewp-field-wrapper textarea,
#ewp-fast-buy-form .ewp-field-wrapper select {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

#ewp-fast-buy-form .ewp-field-wrapper input:focus,
#ewp-fast-buy-form .ewp-field-wrapper textarea:focus,
#ewp-fast-buy-form .ewp-field-wrapper select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

#ewp-fast-buy-form .ewp-field-error {
    border-color: #e74c3c !important;
}

#ewp-fast-buy-form .ewp-field-error-message {
    color: #e74c3c;
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Modal notice styles */
.ewp-modal-notice {
    padding: 12px;
    margin: 10px 0;
    border-radius: 6px;
    border-left: 4px solid;
    font-size: 14px;
}

.ewp-modal-notice.ewp-notice-error {
    background: #fef2f2;
    border-left-color: #ef4444;
    color: #991b1b;
}

.ewp-modal-notice.ewp-notice-success {
    background: #f0fdf4;
    border-left-color: #10b981;
    color: #065f46;
}

.ewp-modal-notice.ewp-notice-info {
    background: #f0f9ff;
    border-left-color: #3b82f6;
    color: #1e40af;
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
    .ewp-fast-checkout-header,
    .ewp-progress-indicator,
    .ewp-security-info,
    .ewp-place-order-btn {
        display: none;
    }
    
    .ewp-fast-checkout-content {
        grid-template-columns: 1fr;
    }
    
    /* Hide modal in print */
    .ewp-modal {
        display: none !important;
    }
} 
