/**
 * Order Mode Styles for Lee Coffee Checkout
 */

/* Order Mode Section */
.order-mode-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.order-mode-section.active {
    border-color: #3498db;
    background: #f0f8ff;
}

.order-mode-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.order-mode-title::before {
    margin-right: 10px;
    font-size: 20px;
}

/* Order Mode Options */
.order-mode-options {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.order-mode-option {
    flex: 1;
    position: relative;
}

.order-mode-radio {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.order-mode-label {
    display: block;
    padding: 15px 20px;
    background: #fff;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.order-mode-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(52, 152, 219, 0.1), transparent);
    transition: left 0.5s ease;
}

.order-mode-radio:checked + .order-mode-label::before {
    left: 100%;
}

.order-mode-radio:checked + .order-mode-label {
    border-color: #3498db;
    background: #f0f8ff;
    color: #2c5aa0;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.order-mode-label:hover {
    border-color: #3498db;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.mode-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.mode-text {
    font-size: 14px;
    color: #5a6c7d;
}

.order-mode-radio:checked + .order-mode-label .mode-text {
    color: #2c5aa0;
}

/* Enhanced Shipping Methods Table */
.table-checkout-shipping-method {
    margin-top: 15px;
    border-collapse: collapse;
    width: 100% !important;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.table-checkout-shipping-method thead {
    background: #f8f9fa;
}

.table-checkout-shipping-method thead th {
    padding: 12px 15px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
    text-align: left;
}

.table-checkout-shipping-method tbody tr {
    border-bottom: 1px solid #f1f1f1;
    transition: background-color 0.2s ease;
}

.table-checkout-shipping-method tbody tr:hover {
    background-color: #f8f9fa;
}

.table-checkout-shipping-method tbody tr.selected {
    background-color: #f0f8ff;
    border-left: 4px solid #3498db;
}

.table-checkout-shipping-method tbody td {
    padding: 15px;
    vertical-align: middle;
}

.table-checkout-shipping-method .col-method input[type="radio"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.table-checkout-shipping-method .col-price {
    font-weight: 600;
    color: #27ae60;
    font-size: 16px;
}

.table-checkout-shipping-method .col-price.free {
    color: #e74c3c;
}

.table-checkout-shipping-method .col-method {
    min-width: 60px;
}

.table-checkout-shipping-method .col-carrier {
    color: #6c757d;
    font-size: 14px;
}

/* Loading States */
#checkout-shipping-method-load {
    position: relative;
}

.shipping-methods-loading {
    opacity: 0.5;
    pointer-events: none;
}

.shipping-methods-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
}

/* Animation Effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.table-checkout-shipping-method {
    animation: fadeInUp 0.5s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-mode-options {
        flex-direction: column;
        gap: 10px;
    }

    .order-mode-label {
        padding: 12px 15px;
    }

    .mode-icon {
        font-size: 20px;
        margin-bottom: 5px;
    }

    .table-checkout-shipping-method {
        font-size: 14px;
    }

    .table-checkout-shipping-method thead {
        display: none;
    }

    .table-checkout-shipping-method tbody tr {
        display: block;
        border: 1px solid #dee2e6;
        margin-bottom: 10px;
        border-radius: 6px;
        padding: 10px;
    }

    .table-checkout-shipping-method tbody td {
        display: block;
        padding: 5px 0;
        border: none;
    }

    .table-checkout-shipping-method .col-method::before {
        content: "Method: ";
        font-weight: 600;
    }

    .table-checkout-shipping-method .col-price::before {
        content: "Price: ";
        font-weight: 600;
    }

    .table-checkout-shipping-method .col-carrier::before {
        content: "Carrier: ";
        font-weight: 600;
    }
}

/* Additional Styling for Better UX */
.shipping-address-item .shipping-step-title {
    margin-bottom: 20px;
}

.checkout-shipping-method .step-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.checkout-shipping-method .step-title::before {
    content: "📦";
    font-size: 20px;
}

/* Loading Spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Success States */
.method-selected {
    background: #d4edda !important;
    border-color: #c3e6cb !important;
    color: #155724 !important;
}

.method-selected .col-price {
    color: #155724 !important;
    font-weight: bold;
}

/* Error States */
.shipping-method-error {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Focus States for Accessibility */
.order-mode-radio:focus + .order-mode-label {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.table-checkout-shipping-method input[type="radio"]:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

.d-none {
    display: none;
}
