/**
 * Optimized Checkout Styles for Horeka Core
 * 
 * This file provides optimized styling for checkout elements including:
 * - Notification system
 * - Loading states
 * - Optimized form elements
 * - Responsive design improvements
 * 
 * @version 2.0.0
 */

/* Notification System */
.horeka-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 14px;
    line-height: 1.4;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.horeka-notification.show {
    transform: translateX(0);
}

.horeka-notification--success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.horeka-notification--error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.horeka-notification--warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

.horeka-notification--info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.horeka-notification__close {
    background: none;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-left: 10px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.horeka-notification__close:hover {
    opacity: 1;
}

/* Loading States */
.horeka-loading {
    position: relative;
    pointer-events: none;
}

.horeka-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.horeka-loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: horeka-spin 1s linear infinite;
    z-index: 1001;
}

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

/* Optimized Form Elements */
.woocommerce-checkout .form-row {
    margin-bottom: 15px;
}

.woocommerce-checkout .form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.woocommerce-checkout .form-row input,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.woocommerce-checkout .form-row input:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

/* Delivery Method Optimization */
#delivery_method {
    margin-bottom: 20px;
}

#delivery_method .blue-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

#delivery_method .blue-cards label {
    display: block;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    background: #fff;
}

#delivery_method .blue-cards label:hover {
    border-color: #3498db;
    background: #f8f9fa;
}

#delivery_method .blue-cards input[type="radio"]:checked + label {
    border-color: #3498db;
    background: #e3f2fd;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.2);
}

/* Pickup Point Optimization */
#pickup_point_field {
    margin-top: 15px;
}

#pickup_point {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Coupon Form Optimization */

.checkout_coupon .form-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.checkout_coupon .form-row .form-row {
    flex: 1;
    margin-bottom: 0;
}

.checkout_coupon input[name="apply_coupon"] {
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.checkout_coupon input[name="apply_coupon"]:hover {
    background: #2980b9;
}

/* Checkout Review Optimization */
.woocommerce-checkout-review-order {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
}

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

.woocommerce-checkout-review-order th,
.woocommerce-checkout-review-order td {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    text-align: left;
}

.woocommerce-checkout-review-order th {
    font-weight: 600;
    color: #333;
}

.woocommerce-checkout-review-order .order-total {
    font-weight: bold;
    font-size: 18px;
    color: #2c3e50;
}

/* Responsive Design */
@media (max-width: 768px) {
    .horeka-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(-100%);
    }
    
    .horeka-notification.show {
        transform: translateY(0);
    }
    
    #delivery_method .blue-cards {
        grid-template-columns: 1fr;
    }
    
    .checkout_coupon .form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .checkout_coupon input[name="apply_coupon"] {
        width: 100%;
    }
}

/* Performance Optimizations */
.woocommerce-checkout * {
    box-sizing: border-box;
}

.woocommerce-checkout img {
    max-width: 100%;
    height: auto;
}

/* Accessibility Improvements */
.woocommerce-checkout input:focus,
.woocommerce-checkout select:focus,
.woocommerce-checkout textarea:focus,
.woocommerce-checkout button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .horeka-notification,
    .horeka-loading::after,
    .horeka-loading::before {
        display: none !important;
    }
} 