/**
 * Frontend CSS for LULU POD Checkout Pricing
 */

/* Checkout Pricing Section */
#lulu-pod-checkout-pricing {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: inherit;
}

#lulu-pod-checkout-pricing h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Address Status */
#lulu-address-status {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-weight: 500;
}

#lulu-address-status.address-incomplete {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

#lulu-address-status.address-complete {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Loading Animation */
#lulu-loading {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

#lulu-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Shipping Options */
#lulu-shipping-options {
    margin: 15px 0;
}

#lulu-shipping-options h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

#lulu-shipping-options-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shipping-option {
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.shipping-option:hover {
    border-color: #2196f3;
    box-shadow: 0 4px 8px rgba(33, 150, 243, 0.2);
    transform: translateY(-1px);
    background: #f8f9fa;
}

.shipping-option.selected {
    border-color: #2196f3;
    background: #e3f2fd;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.shipping-option.selected::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 2px solid #2196f3;
    border-radius: 8px;
    background: transparent;
    pointer-events: none;
}

.shipping-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.shipping-name {
    font-weight: 600;
    color: #333;
}

.shipping-cost {
    font-weight: 600;
    color: #d32f2f;
    font-size: 16px;
}

.shipping-option-details {
    color: #666;
    font-size: 14px;
}

.shipping-option-level {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
    font-style: italic;
}

/* Pricing Breakdown */
#lulu-pricing-breakdown {
    margin: 20px 0;
}

#lulu-pricing-breakdown h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.pricing-breakdown {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.pricing-row:last-child {
    border-bottom: none;
}

.pricing-row.service-fee {
    background: #f8f9fa;
    color: #6c757d;
    font-size: 14px;
}

.pricing-row.shipping-cost {
    background: #fff3cd;
    color: #856404;
    font-size: 14px;
}

.pricing-row.total {
    background: #e3f2fd;
    font-weight: 600;
    font-size: 16px;
    color: #1976d2;
}

.pricing-row span:first-child {
    flex: 1;
}

.pricing-row span:last-child {
    font-weight: 600;
    margin-left: 20px;
}

/* Error Messages */
.lulu-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    #lulu-pod-checkout-pricing {
        padding: 15px;
        margin: 15px 0;
    }
    
    .shipping-option {
        padding: 12px;
    }
    
    .shipping-option-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .pricing-row {
        padding: 10px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
    
    .pricing-row span:last-child {
        margin-left: 0;
        font-size: 14px;
    }
    
    .pricing-row.total span:last-child {
        font-size: 16px;
    }
}

/* Integration with WooCommerce checkout */
.woocommerce-checkout #lulu-pod-checkout-pricing {
    margin: 20px 0;
}

.woocommerce-checkout #lulu-pod-checkout-pricing h3 {
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

/* Success/Complete States */
.lulu-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px 15px;
    border-radius: 4px;
    margin: 10px 0;
}

.step-indicator {
    display: inline-block;
    background: #007cba;
    color: white;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
    font-size: 12px;
    font-weight: bold;
    margin-right: 8px;
}

/* Loading state improvements */
#lulu-loading p {
    margin: 0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lulu-loading p::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #007cba;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}
