/* NextLevel API Plugin V2 Styles */

/* -------------------------------------------------------
   Autocomplete dropdowns (city-address + office/locker + street)
------------------------------------------------------- */
#nextlevel-city-address-dropdown,
#nextlevel-office-dropdown,
#nextlevel-city-dropdown,
#nextlevel-street-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: #ffffff;
    border: 2px solid #2563eb;
    border-top: none;
    border-radius: 0 0 10px 10px;
    max-height: 240px;
    overflow-y: auto;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.15);
    scrollbar-width: thin;
    scrollbar-color: #2563eb #f0f4ff;
}

#nextlevel-city-address-dropdown::-webkit-scrollbar,
#nextlevel-office-dropdown::-webkit-scrollbar,
#nextlevel-city-dropdown::-webkit-scrollbar,
#nextlevel-street-dropdown::-webkit-scrollbar {
    width: 6px;
}
#nextlevel-city-address-dropdown::-webkit-scrollbar-thumb,
#nextlevel-office-dropdown::-webkit-scrollbar-thumb,
#nextlevel-city-dropdown::-webkit-scrollbar-thumb,
#nextlevel-street-dropdown::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 3px;
}
#nextlevel-city-address-dropdown::-webkit-scrollbar-track,
#nextlevel-office-dropdown::-webkit-scrollbar-track,
#nextlevel-city-dropdown::-webkit-scrollbar-track,
#nextlevel-street-dropdown::-webkit-scrollbar-track {
    background: #f0f4ff;
}

/* Individual items inside the dropdowns */
#nextlevel-city-address-dropdown .nextlevel-autocomplete-item,
#nextlevel-office-dropdown .nextlevel-autocomplete-item,
#nextlevel-city-dropdown .nextlevel-autocomplete-item,
#nextlevel-street-dropdown .nextlevel-autocomplete-item {
    padding: 10px 14px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    border-bottom: 1px solid #e8eef8 !important;
    cursor: pointer !important;
    transition: background 0.15s ease, color 0.15s ease !important;
    line-height: 1.4 !important;
}

#nextlevel-city-address-dropdown .nextlevel-autocomplete-item:last-child,
#nextlevel-office-dropdown .nextlevel-autocomplete-item:last-child,
#nextlevel-city-dropdown .nextlevel-autocomplete-item:last-child,
#nextlevel-street-dropdown .nextlevel-autocomplete-item:last-child {
    border-bottom: none !important;
}

#nextlevel-city-address-dropdown .nextlevel-autocomplete-item:hover,
#nextlevel-office-dropdown .nextlevel-autocomplete-item:hover,
#nextlevel-city-dropdown .nextlevel-autocomplete-item:hover,
#nextlevel-street-dropdown .nextlevel-autocomplete-item:hover {
    background: #eff6ff !important;
    color: #2563eb !important;
}

/* Input fields that open these dropdowns — bold border on focus */
#nextlevel-city-address:focus,
#nextlevel-office:focus,
#nextlevel-city:focus,
#nextlevel-street:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
    border-radius: 6px 6px 0 0 !important;
}

/* Company fields - hidden by default until checkbox is checked (via JS) */
.nextlevel-company-field {
    display: none;
}

#nextlevel-company-fields input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.15);
    outline: none;
}

/* Main Container */
#nextlevel-checkout-simulator {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

#nextlevel-checkout-container {
    max-width: 100%;
    margin: 0;
}

/* Progress Steps */
.nextlevel-progress-steps {
    display: flex;
    justify-content: space-between;
    margin: 30px 0;
    position: relative;
}
.nextlevel-address-row {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.nextlevel-mini-field {
    display: flex;
    flex-direction: column;
    white-space: nowrap;     /* Prevents text wrapping */
    width: 100px;
}

.nextlevel-mini-field input {
    width: 100%;
}
.nextlevel-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.nextlevel-step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    border: 2px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin: 0 auto 10px;
    transition: all 0.3s ease;
    color: #6c757d;
}

.nextlevel-step.active .nextlevel-step-circle {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.nextlevel-step.completed .nextlevel-step-circle {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.nextlevel-step-label {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.nextlevel-step.active .nextlevel-step-label {
    color: #007bff;
}

/* Form Styles */
.nextlevel-form-group {
    margin-bottom: 20px;
}

.nextlevel-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.nextlevel-form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.nextlevel-form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.nextlevel-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

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

/* Delivery Type Options */
.nextlevel-delivery-options {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.nextlevel-delivery-option {
    flex: 1;
    padding: 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.nextlevel-delivery-option:hover {
    border-color: #007bff;
    background: #f8f9ff;
}

.nextlevel-delivery-option input[type="radio"] {
    display: none;
}

.nextlevel-delivery-option input[type="radio"]:checked + .nextlevel-option-icon {
    background: #007bff;
    color: white;
}

.nextlevel-delivery-option input[type="radio"]:checked ~ .nextlevel-option-text {
    color: #007bff;
}

.nextlevel-delivery-option input[type="radio"]:checked ~ .nextlevel-option-text strong {
    color: #007bff;
}

.nextlevel-delivery-option.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.nextlevel-option-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 10px;
    padding: 15px;
    border-radius: 50%;
    background: #f8f9fa;
    width: 70px;
    height: 70px;
    line-height: 40px;
    margin: 0 auto 10px;
    transition: all 0.3s ease;
}

.nextlevel-option-text {
    color: #495057;
}

.nextlevel-option-text strong {
    display: block;
    margin-bottom: 5px;
    color: #212529;
}

.nextlevel-option-text small {
    color: #6c757d;
    font-size: 12px;
}

/* Buttons */
.nextlevel-btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.nextlevel-btn-primary {
    background-color: #007bff;
    color: white;
}

.nextlevel-btn-primary:hover {
    background-color: #0056b3;
}

.nextlevel-btn-success {
    background-color: #28a745;
    color: white;
}

.nextlevel-btn-success:hover {
    background-color: #1e7e34;
}

.nextlevel-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.nextlevel-btn-secondary:hover {
    background-color: #545b62;
}

.nextlevel-btn-warning {
    background-color: #ffc107;
    color: #212529;
}

.nextlevel-btn-warning:hover {
    background-color: #e0a800;
}

.nextlevel-btn-info {
    background-color: #17a2b8;
    color: white;
}

.nextlevel-btn-info:hover {
    background-color: #117a8b;
}

.nextlevel-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading State */
.nextlevel-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: nextlevel-spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Error Messages */
.nextlevel-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Success Messages */
.nextlevel-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    padding: 12px;
    border-radius: 6px;
    margin: 10px 0;
}

/* Debug Info */
.nextlevel-debug {
    font-family: 'Courier New', monospace;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    margin: 20px 0;
}

.nextlevel-debug pre {
    background: white;
    padding: 15px;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 12px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nextlevel-delivery-options {
        flex-direction: column;
        gap: 15px;
    }
    
    .nextlevel-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .nextlevel-progress-steps {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .nextlevel-step {
        flex: 0 0 calc(50% - 5px);
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .nextlevel-step {
        flex: 0 0 100%;
    }
    
    .nextlevel-btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* WooCommerce Integration */
.woocommerce #nextlevel-checkout-simulator {
    margin: 0 0 30px 0;
}

.woocommerce .nextlevel-form-control {
    font-size: 16px; /* Prevent zoom on iOS */
}

/* Admin Styles */
.wrap .notice {
    margin: 20px 0;
}

.wrap .card {
    background: white;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.wrap .card h2 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.wrap .widefat {
    margin-top: 15px;
}

/* Animation */
.nextlevel-fade-in {
    animation: nextlevel-fadeIn 0.3s ease-in;
}

@keyframes nextlevel-fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Tooltips */
.nextlevel-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.nextlevel-tooltip .nextlevel-tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 12px;
}
.nextlevel-delivery-type-card, .nextlevel-courier-card {
    display: flex;
    align-items: center;
    gap: 16px;

    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;

    background: transparent;
    border: none;
    border-radius: 0;
    color: #374151;

    cursor: pointer;
    transition: background-color 0.2s ease;

    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;

    width: 100%;
    box-sizing: border-box;
    
    /* Remove all card-like properties */
    margin: 0;
    box-shadow: none;
    transform: none;
    position: static;
    overflow: visible;
}
.nextlevel-delivery-type-card:hover, .nextlevel-courier-card:hover {
    background: #f8fafc;
}

.nextlevel-delivery-type-card.active, .nextlevel-courier-card.selected {
    background: #eff6ff;
    color: #1e40af;
    font-weight: 500;
}

/* Delivery type card icon styling */
.nextlevel-delivery-type-card .delivery-icon, .nextlevel-courier-card .courier-icon {
    font-size: 20px;
    opacity: 0.8;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nextlevel-delivery-type-card:hover .delivery-icon, .nextlevel-courier-card:hover .courier-icon {
    opacity: 1;
}

.nextlevel-delivery-type-card.active .delivery-icon, .nextlevel-courier-card.selected .courier-icon {
    opacity: 1;
    color: #3b82f6;
}

/* Delivery type card text styling */
.nextlevel-delivery-type-card .delivery-text, .nextlevel-courier-card .courier-name {
    font-weight: 400;
    transition: all 0.2s ease;
    flex: 1;
}

.nextlevel-delivery-type-card:hover .delivery-text, .nextlevel-courier-card:hover .courier-name {
    font-weight: 500;
}

.nextlevel-delivery-type-card.active .delivery-text, .nextlevel-courier-card.selected .courier-name {
    font-weight: 600;
}

/* List container styling */
.nextlevel-delivery-type-picker {
    display: flex;
    flex-direction: column;
    gap: 0;
    width: 100%;
    border: none;
    border-radius: 0;
    overflow: visible;
    background: transparent;
}

/* Remove last item border */
.nextlevel-delivery-type-picker .nextlevel-delivery-type-card:last-child,
.nextlevel-delivery-type-picker .nextlevel-courier-card:last-child {
    border-bottom: none;
}

/* Custom courier dropdown styling */
.nextlevel-courier-dropdown-container {
    margin-bottom: 20px;
}

.nextlevel-courier-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #374151;
    font-size: 14px;
}

.nextlevel-courier-select {
    width: 100%;
    position: relative;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.nextlevel-courier-select:hover {
    border-color: #d1d5db;
}

.nextlevel-courier-select.open {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.nextlevel-courier-selected {
    padding: 2px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
}

.nextlevel-courier-placeholder {
    color: #9ca3af;
    font-size: 14px;
}

.nextlevel-courier-selected-logo {
    width: 60px;
    height: 24px;
    object-fit: contain;
}

.nextlevel-courier-selected span {
    font-size: 12px;
    color: #374151;
    font-weight: 500;
    flex: 1;
}

.nextlevel-courier-arrow {
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.nextlevel-courier-select.open .nextlevel-courier-arrow {
    transform: rotate(180deg);
}

.nextlevel-courier-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.nextlevel-courier-select.open .nextlevel-courier-options {
    display: block;
}

.nextlevel-courier-option {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.nextlevel-courier-option:last-child {
    border-bottom: none;
}

.nextlevel-courier-option:hover {
    background-color: #f9fafb;
}

.nextlevel-courier-option:first-child:hover {
    background-color: #f3f4f6;
}

.nextlevel-courier-option-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.nextlevel-courier-option-text {
    font-size: 14px;
    color: #374151;
    font-weight: 500;
}

.nextlevel-courier-option:first-child .nextlevel-courier-option-text {
    color: #9ca3af;
    font-weight: 400;
}
.nextlevel-tooltip:hover .nextlevel-tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Checkout Field Customization */
.woocommerce-billing-fields h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.woocommerce-billing-fields .form-row {
    margin-bottom: 15px;
    position: relative;
}

.woocommerce-billing-fields .form-row label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.woocommerce-billing-fields .form-row input[type="text"],
.woocommerce-billing-fields .form-row input[type="email"],
.woocommerce-billing-fields .form-row input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 16px;
    background: #ffffff;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.woocommerce-billing-fields .form-row input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #f8fafc;
}

.woocommerce-billing-fields .form-row input::placeholder {
    color: #9ca3af;
    font-style: italic;
}

.woocommerce-billing-fields .form-row.woocommerce-validated input {
    border-color: #10b981;
    background: #f0fdf4;
}

.woocommerce-billing-fields .form-row.woocommerce-invalid input {
    border-color: #ef4444;
    background: #fef2f2;
}

/* Specific field styling and layout */
.woocommerce-billing-fields .form-row {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.woocommerce-billing-fields .form-row#billing_email_field {
    order: 1;
}

.woocommerce-billing-fields .form-row#billing_phone_field {
    order: 2;
}

.woocommerce-billing-fields .form-row#billing_first_name_field {
    order: 3;
}

.woocommerce-billing-fields .form-row#billing_last_name_field {
    order: 3;
}

/* New layout: Email (top), Phone (middle), Name+Lastname (bottom row) */
@media (min-width: 769px) {
    .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper {
        display: block !important;
    }
    
    /* Email and Phone - full width, block display */
    .woocommerce-billing-fields .form-row#billing_email_field,
    .woocommerce-billing-fields .form-row#billing_phone_field {
        display: block !important;
        width: 100% !important;
        margin-bottom: 20px !important;
        clear: both !important;
    }
    
    /* Name fields - side by side using float */
    .woocommerce-billing-fields .form-row#billing_first_name_field {
        display: block !important;
        width: 48% !important;
        float: left !important;
        margin-right: 4% !important;
        margin-bottom: 0 !important;
        clear: both !important;
    }
    
    .woocommerce-billing-fields .form-row#billing_last_name_field {
        display: block !important;
        width: 48% !important;
        float: left !important;
        margin-bottom: 20px !important;
    }
    
    /* Clearfix for the name fields container */
    .woocommerce-billing-fields .form-row#billing_last_name_field::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* Override all flex properties */
    .woocommerce-billing-fields .form-row {
        flex: none !important;
        flex-direction: row !important;
        display: block !important;
    }
    
    /* Ensure labels and inputs display correctly */
    .woocommerce-billing-fields .form-row label {
        display: block !important;
    }
    
    .woocommerce-billing-fields .form-row input {
        display: block !important;
        width: 100% !important;
    }
}

/* Compact layout for mobile - preserve JavaScript field order */
@media (max-width: 768px) {
    .woocommerce-billing-fields .woocommerce-billing-fields__field-wrapper {
        display: block !important;
    }
    
    .woocommerce-billing-fields .form-row {
        width: 100%;
        margin-bottom: 15px;
    }
    
    /* Ensure name fields container stacks vertically on mobile */
    .woocommerce-billing-fields .nextlevel-name-fields-container {
        flex-direction: column !important;
        gap: 15px !important;
        margin-bottom: 15px !important;
    }
    
    .woocommerce-billing-fields .nextlevel-name-fields-container .form-row {
        flex: none !important;
        max-width: 100% !important;
        width: 100% !important;
        margin-bottom: 15px !important;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .woocommerce-billing-fields .form-row input[type="text"],
    .woocommerce-billing-fields .form-row input[type="email"],
    .woocommerce-billing-fields .form-row input[type="tel"] {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 14px 16px;
    }
}

/* COD Checkbox Styling */
.woocommerce-billing-fields .form-row input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.woocommerce-billing-fields .form-row label.checkbox {
    display: flex !important;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

.woocommerce-billing-fields .form-row label.checkbox:hover {
    color: #007bff;
}

/* Hide shipping section since we're not using shipping addresses */
.woocommerce-shipping-fields {
    display: none !important;
}

/* Hide 'Ship to a different address' checkbox and section */
.woocommerce-shipping-fields__field-wrapper,
.woocommerce-shipping-fields__title,
.woocommerce-shipping-fields__field-wrapper > *,
.woocommerce-form__input[type="checkbox"][name="ship_to_different_address"],
.woocommerce-form__label[for="ship_to_different_address"],
.woocommerce-shipping-fields > h3,
.woocommerce-shipping-fields > .woocommerce-shipping-fields__field-wrapper,
.woocommerce-billing-fields + .woocommerce-shipping-fields {
    display: none !important;
}

/* Additional selectors to completely hide shipping address section */
.woocommerce-checkout .ship-to-different-address,
.woocommerce-checkout .shipping_address,
.woocommerce-checkout #ship-to-different-address,
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-shipping-fields * {
    display: none !important;
}

/* More comprehensive hiding of ship to different address */
.woocommerce-checkout .woocommerce-shipping-fields,
.woocommerce-checkout .woocommerce-shipping-fields > *,
.woocommerce-checkout .ship-to-different-address,
.woocommerce-checkout .ship-to-different-address > *,
.woocommerce-checkout .woocommerce-form-row.woocommerce-form-row--wide,
.woocommerce-checkout .woocommerce-form-row.woocommerce-form-row--wide > *,
.woocommerce-checkout input[name="ship_to_different_address"],
.woocommerce-checkout label[for="ship_to_different_address"],
.woocommerce-checkout .woocommerce-shipping-fields__title,
.woocommerce-checkout .woocommerce-shipping-fields__field-wrapper {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* COD checkbox styling within simulator */
.nextlevel-cod-option {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: #f8f9fa;
    padding: 15px;
    margin-top: 20px;
    transition: all 0.3s ease;
}

.nextlevel-cod-option:hover {
    border-color: #007bff;
    background: #f0f8ff;
}

.nextlevel-cod-option label {
    display: flex !important;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: #333;
    margin: 0 !important;
    transition: color 0.3s ease;
}

.nextlevel-cod-option label:hover {
    color: #007bff;
}

.nextlevel-cod-option input[type="checkbox"] {
    margin-right: 10px !important;
    transform: scale(1.2);
    cursor: pointer;
}

/* Ensure the simulator container properly contains the COD option */
#nextlevel-checkout-simulator {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

/* Ensure billing section is properly displayed */
.woocommerce-billing-fields {
    display: block !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .woocommerce-billing-fields .form-row {
        margin-bottom: 12px;
    }
    
    .woocommerce-billing-fields .form-row input[type="text"],
    .woocommerce-billing-fields .form-row input[type="email"],
    .woocommerce-billing-fields .form-row input[type="tel"] {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Structured Checkout Layout */
.nextlevel-checkout-layout-wrapper {
    --nextlevel-checkout-max-width: 1600px;
    max-width: var(--nextlevel-checkout-max-width);
    width: min(var(--nextlevel-checkout-max-width), calc(100vw - 32px));
    margin: 0 auto;
    padding: 0 20px 40px;
    box-sizing: border-box;
}

.nextlevel-checkout-layout-wrapper form.woocommerce-checkout {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
}

.nextlevel-checkout-left,
.nextlevel-checkout-right,
.nextlevel-checkout-bottom {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nextlevel-checkout-main-row {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
    gap: 24px;
    align-items: start;
}

.nextlevel-checkout-left #nextlevel-checkout-simulator {
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

.nextlevel-checkout-left #nextlevel-checkout-container {
    max-width: 100%;
    margin: 0;
    padding-top: 0;
}

.nextlevel-checkout-left .nextlevel-simulator-step:first-child {
    margin-top: 0;
}

.nextlevel-checkout-contact {
    margin-bottom: 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e5e7eb;
}

.nextlevel-checkout-contact + #nextlevel-checkout-container,
.nextlevel-checkout-left #nextlevel-checkout-container {
    margin-top: 0;
    padding-top: 0;
}

.nextlevel-checkout-left #nextlevel-checkout-container .nextlevel-checkout-wizard,
.nextlevel-checkout-left #nextlevel-checkout-container .nextlevel-form-container,
.nextlevel-checkout-left #nextlevel-checkout-container .nextlevel-simple-form {
    margin: 0;
    padding: 0;
}

.nextlevel-checkout-left #nextlevel-checkout-container .nextlevel-simulator-step:first-child {
    margin-top: 0;
    margin-bottom: 12px;
}

.nextlevel-checkout-contact #customer_details,
.nextlevel-checkout-contact .col2-set,
.nextlevel-checkout-contact .col-1,
.nextlevel-checkout-contact .col-2 {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

.nextlevel-checkout-contact .col-2,
.nextlevel-checkout-contact .woocommerce-shipping-fields,
.nextlevel-checkout-contact .ship-to-different-address,
.nextlevel-checkout-contact .shipping_address {
    display: none !important;
    height: 0 !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
}

.nextlevel-checkout-contact .woocommerce-billing-fields {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
}

.nextlevel-checkout-contact .woocommerce-billing-fields h3 {
    grid-column: 1 / -1;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 8px;
    padding: 0;
    border: none;
}

.nextlevel-checkout-contact .woocommerce-billing-fields__field-wrapper {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin: 0;
    padding: 0;
}

.nextlevel-checkout-contact .woocommerce-billing-fields .form-row,
.nextlevel-checkout-contact .woocommerce-billing-fields__field-wrapper .form-row {
    margin: 0 !important;
    padding: 0 !important;
    width: 100%;
    float: none !important;
    clear: none !important;
}

.nextlevel-checkout-bottom {
    margin-top: 24px;
}

.nextlevel-section-title,
.nextlevel-checkout-right #order_review_heading {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.nextlevel-checkout-contact .woocommerce-billing-fields .form-row-wide,
.nextlevel-checkout-contact .woocommerce-billing-fields .form-row-first,
.nextlevel-checkout-contact .woocommerce-billing-fields .form-row-last {
    grid-column: span 1;
    width: 100%;
}

.nextlevel-checkout-contact .woocommerce-billing-fields .form-row input[type="text"],
.nextlevel-checkout-contact .woocommerce-billing-fields .form-row input[type="email"],
.nextlevel-checkout-contact .woocommerce-billing-fields .form-row input[type="tel"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 12px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nextlevel-checkout-contact .woocommerce-billing-fields .form-row input:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
}

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

.nextlevel-checkout-right .woocommerce-checkout-review-order-table th,
.nextlevel-checkout-right .woocommerce-checkout-review-order-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.nextlevel-checkout-right #payment {
    background: #f9fafb;
    border-radius: 8px;
    padding: 16px;
    margin-top: 8px;
}

.nextlevel-checkout-bottom .woocommerce-form-coupon-toggle {
    margin: 0;
}

.nextlevel-checkout-bottom .woocommerce-form-coupon-toggle .woocommerce-info {
    margin: 0;
    border-radius: 6px;
}

.nextlevel-checkout-bottom form.checkout_coupon,
.nextlevel-checkout-bottom .checkout_coupon {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f3f4f6;
}

.nextlevel-checkout-bottom form.checkout_coupon .form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    margin: 0;
}

.nextlevel-checkout-bottom form.checkout_coupon .form-row-first {
    flex: 1;
}

.nextlevel-checkout-bottom form.checkout_coupon input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.nextlevel-checkout-bottom form.checkout_coupon input[type="text"] {
    width: 200%;
    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
}

.nextlevel-checkout-notes {
    margin-top: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nextlevel-checkout-notes .woocommerce-additional-fields h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f3f4f6;
}

.nextlevel-checkout-notes #order_comments_field label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.nextlevel-checkout-notes #order_comments {
    width: 100%;
    min-height: 90px;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nextlevel-checkout-notes #order_comments:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.12);
    outline: none;
}

.nextlevel-checkout-left .nextlevel-form-group label,
.nextlevel-checkout-left .nextlevel-simulator-step-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}

.nextlevel-checkout-left .nextlevel-form-group--compact {
    margin-bottom: 0;
}

.nextlevel-checkout-left .nextlevel-form-control,
.nextlevel-checkout-left .nextlevel-selected-country {
    font-size: 14px;
}

.nextlevel-checkout-left .nextlevel-location-section .nextlevel-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    text-transform: none;
    letter-spacing: normal;
}

@media (min-width: 992px) {
    .nextlevel-checkout-contact .woocommerce-billing-fields,
    .nextlevel-checkout-contact .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 992px) {
    .nextlevel-checkout-main-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nextlevel-checkout-layout-wrapper {
        padding: 0 12px 32px;
    }

    .nextlevel-checkout-left,
    .nextlevel-checkout-right,
    .nextlevel-checkout-bottom,
    .nextlevel-checkout-notes {
        padding: 16px;
    }

    .nextlevel-checkout-contact .woocommerce-billing-fields__field-wrapper {
        grid-template-columns: 1fr;
    }

    .nextlevel-checkout-bottom form.checkout_coupon .form-row {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Widen checkout on theme containers */
body.woocommerce-checkout .container,
body.woocommerce-checkout .container-fluid,
body.woocommerce-checkout .wrap,
body.woocommerce-checkout .site-content,
body.woocommerce-checkout .site-main,
body.woocommerce-checkout .content-area,
body.woocommerce-checkout .content-container,
body.woocommerce-checkout .site-container,
body.woocommerce-checkout .ast-container,
body.woocommerce-checkout .col-full,
body.woocommerce-checkout .oceanwp-container,
body.woocommerce-checkout .elementor-container,
body.woocommerce-checkout .et_pb_row,
body.woocommerce-checkout .entry-content,
body.woocommerce-checkout .woocommerce,
body.woocommerce-checkout .woocommerce-page,
body.woocommerce-checkout #primary,
body.woocommerce-checkout #main,
body.woocommerce-checkout #content,
body.woocommerce-checkout .page-content,
body.woocommerce-checkout main,
body.woocommerce-checkout .content-wrap,
body.woocommerce-checkout .content-wrapper,
body.woocommerce-checkout .main-content,
body.woocommerce-checkout .page-container,
body.woocommerce-checkout .ct-container,
body.woocommerce-checkout .e-con-inner {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box;
}


.woocommerce-checkout #order_review_heading, .woocommerce-checkout #order_review {
    float: none;
    width: auto!important;
}


form.woocommerce-checkout #order_review, form.woocommerce-checkout #order_review_heading {
    float: none!important;
    width: 100%!important;
}

#nextlevel-city, #nextlevel-city-address, #nextlevel-office, #nextlevel-street {
    width: 100% !important;
    max-width: 100% !important;
}