/* PROGRESS BAR - OPTIMIZED FOR 2 STAGES */
.msc-progress-bar {
    display: flex !important;
    justify-content: space-around;
    margin-bottom: 40px;
    padding: 0;
    list-style: none;
    width: 100%;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    visibility: visible !important;
}

.msc-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    padding: 15px 10px;
    display: block !important;
    max-width: 250px;
}

.msc-progress-number {
    display: inline-block !important;
    width: 50px;
    height: 50px;
    line-height: 50px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    position: relative;
    z-index: 2;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 18px;
}

.msc-progress-step.active .msc-progress-number {
    background: #EE1C23 !important;
    color: white !important;
    box-shadow: 0 0 0 4px rgba(238, 28, 35, 0.1);
}

.msc-progress-step.completed .msc-progress-number {
    background: #28a745 !important;
    color: white !important;
}

.msc-progress-label {
    display: block !important;
    font-size: 14px;
    color: #666;
    font-weight: 500;
    line-height: 1.3;
}

.msc-progress-step.active .msc-progress-label {
    color: #EE1C23 !important;
    font-weight: bold !important;
}

/* CHECKOUT CONTAINER */
body.woocommerce-checkout #multi-stage-checkout,
body.woocommerce-checkout .msc-checkout-container {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 20px !important;
    background: #fff !important;
}

.woocommerce-checkout table.shop_table {
    border: 1px solid #fff !important;
    background-color: #fff !important;
    width: 100% !important;
}

.woocommerce-checkout #payment ul.payment_methods>li>label {
    margin-bottom: 30px;
}

.woocommerce-checkout-payment ul {
    list-style-type: none;
}

/* STAGE STYLING */
.msc-stage {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

/* FORM STYLING */
.msc-form-row {
    margin-bottom: 20px;
}

.msc-form-row-group {
    display: flex;
    gap: 15px;
}

.msc-form-row-group .msc-form-row {
    flex: 1;
}

.msc-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.msc-form-row input,
.msc-form-row select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: all 0.2s ease;
}

.msc-form-row input:focus,
.msc-form-row select:focus {
    border-color: #EE1C23;
    outline: none;
    box-shadow: 0 0 0 2px rgba(238, 28, 35, 0.1);
}

.msc-form-row input.error,
.msc-form-row select.error {
    border-color: #dc3545 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1) !important;
}

.msc-form-row input.error:focus,
.msc-form-row select.error:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.1);
}

/* DELIVERY OPTIONS STYLING */
.msc-delivery-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    position: relative;
    /* Required for loading overlay */
}

.msc-delivery-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
}

.msc-delivery-fields {
    margin-top: 25px;
    padding: 25px;
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #EE1C23;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.msc-delivery-fields h4,
.msc-delivery-fields h5 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.msc-delivery-fields h4 {
    font-size: 18px;
    color: #EE1C23;
}

.msc-delivery-fields h5 {
    font-size: 16px;
}

/* BILLING AND SHIPPING SECTIONS */
.msc-billing-section,
.msc-shipping-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.msc-shipping-section {
    border-bottom: none;
    margin-bottom: 0;
}

/* ORDER REVIEW SECTION */
.msc-order-review-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 2px solid #eee;
}

.msc-order-review-section h4 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 20px;
    color: #333;
}

/* NAVIGATION BUTTONS */
.msc-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.msc-prev-btn,
.msc-next-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    text-decoration: none;
}

.msc-prev-btn {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #ddd;
}

.msc-prev-btn:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.msc-next-btn {
    background: #EE1C23;
    color: white;
}

.msc-next-btn:hover {
    background: #d11a21;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 28, 35, 0.3);
}

/* PLACE ORDER BUTTON */
#place_order {
    padding: 14px 28px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    background: #EE1C23;
    color: white;
    line-height: initial;
}

#place_order:hover {
    background: #d11a21;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(238, 28, 35, 0.3);
}

#place_order:active {
    transform: translateY(0);
    box-shadow: none;
}

#place_order:focus {
    outline: 2px solid #EE1C23;
    outline-offset: 2px;
}

#place_order:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
}

/* SUMMARY SECTION */
.msc-summary {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid #EE1C23;
    border: 1px solid #e9ecef;
}

.msc-summary h4 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #EE1C23;
    font-size: 18px;
}

.msc-summary p {
    margin-bottom: 8px;
    line-height: 1.5;
}

/* PAYMENT METHODS */
.woocommerce-checkout #payment .wc_payment_methods {
    border: 1px solid transparent !important;
    background-color: transparent !important;
}

.woocommerce-checkout #payment ul.payment_methods {
    border-bottom: 1px solid transparent !important;
}

.msc-payment-methods {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.msc-payment-methods h4 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 18px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.msc-payment-note {
    background: #fff;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #17a2b8;
    border: 1px solid #e9ecef;
}

.msc-payment-note p {
    margin: 0;
    color: #666;
    font-style: italic;
}

.msc-payment-methods .payment_box {
    background-color: #fff !important;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-top: 10px;
}

.msc-payment-methods .payment_box::before {
    border-color: #fff !important;
}

/* Payment method radio buttons and labels */
.msc-payment-methods .payment_methods {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.msc-payment-methods .payment_methods>div {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.msc-payment-methods .payment_methods>div:hover {
    border-color: #EE1C23;
    background-color: #fafafa;
}

.msc-payment-methods .payment_methods>div:last-child {
    margin-bottom: 0;
}

.msc-payment-methods input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

.msc-payment-methods label {
    font-weight: 600;
    color: #333;
    cursor: pointer;
    margin-bottom: 0;
}

/* Collection payment method specific styling */
.payment_method_collection {
    background: #e8f5e8 !important;
    border-color: #28a745 !important;
}

.payment_method_collection label {
    color: #28a745 !important;
}

/* SELECT DROPDOWN STYLING */
.msc-form-row select {
    height: 45px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    appearance: none;
}

.msc-form-row select:focus {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23EE1C23' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
}

/* TOWN DROPDOWN SPECIFIC STYLING */
.msc-form-row select#shipping_town {
    border: 2px solid #ddd;
    font-weight: 500;
}

.msc-form-row select#shipping_town:focus {
    border-color: #EE1C23;
    box-shadow: 0 0 0 2px rgba(238, 28, 35, 0.1);
}

/* ERROR AND SUCCESS MESSAGE STYLING */
.msc-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #dc3545;
    font-size: 14px;
    position: relative;
    animation: fadeInDown 0.3s ease-in-out;
}

.msc-success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #28a745;
    font-size: 14px;
    position: relative;
    animation: fadeInDown 0.3s ease-in-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* LOADING STATES */
.msc-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: msc-spin 1s ease-in-out infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes msc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* DELIVERY OPTION LOADING OVERLAY */
.msc-delivery-loading-overlay {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(255, 255, 255, 0.95) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 1000 !important;
    border-radius: 8px !important;
    backdrop-filter: blur(2px) !important;
    min-height: 100px !important;
}

.msc-delivery-loading-spinner {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.msc-delivery-loading-spinner .spinner-icon {
    width: 50px !important;
    height: 50px !important;
    border: 4px solid #f3f3f3 !important;
    border-top: 4px solid #EE1C23 !important;
    border-radius: 50% !important;
    animation: msc-spin 0.8s linear infinite !important;
}

.msc-delivery-loading-spinner .spinner-text {
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* Loading animation for select dropdown */
.msc-delivery-section.loading select[name="delivery_type"] {
    background-color: #f8f9fa;
    pointer-events: none;
    opacity: 0.7;
}

/* BUTTON DISABLED STATES */
.msc-next-btn:disabled,
.msc-prev-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background-color: #ccc !important;
    transform: none !important;
    box-shadow: none !important;
}

/* OVERRIDE WOOCOMMERCE STYLES */
.woocommerce form .msc-form-row {
    padding: 0;
    margin: 0 0 20px;
}

.woocommerce form .msc-form-row label {
    line-height: 1.5;
}

.woocommerce form .msc-form-row input.input-text,
.woocommerce form .msc-form-row select {
    height: auto;
    line-height: 1.5;
    margin: 0;
}

/* HIDE DEFAULT WOOCOMMERCE ELEMENTS */
.woocommerce-checkout .form-row.place-order button#place_order {
    display: none !important;
}

/* DISABLED FORM ELEMENTS */
.msc-form-row input:disabled,
.msc-form-row select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
    opacity: 0.7;
}

/* VALIDATION MESSAGES */
.msc-validation-message {
    color: #dc3545;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.msc-form-row.error .msc-validation-message {
    display: block;
}

/* MOBILE RESPONSIVENESS */
@media (max-width: 768px) {
    .msc-form-row-group {
        flex-direction: column;
        gap: 0;
    }

    .msc-form-row-group .msc-form-row {
        margin-bottom: 15px;
    }

    .msc-progress-bar {
        font-size: 12px;
        margin-bottom: 30px;
    }

    .msc-progress-number {
        width: 40px;
        height: 40px;
        line-height: 40px;
        font-size: 16px;
    }

    .msc-progress-step {
        max-width: none;
        padding: 10px 5px;
    }

    .msc-navigation {
        flex-direction: column;
        gap: 15px;
    }

    .msc-prev-btn,
    .msc-next-btn,
    #place_order {
        width: 100%;
        text-align: center;
        padding: 16px 20px;
    }

    .msc-checkout-container {
        padding: 15px !important;
    }

    .msc-stage {
        padding: 20px;
    }

    .msc-delivery-fields {
        padding: 20px;
    }

    .msc-summary {
        padding: 20px;
    }

    .msc-payment-methods {
        padding: 20px;
    }
}

/* ACCESSIBILITY IMPROVEMENTS */
.msc-next-btn:focus,
.msc-prev-btn:focus,
#place_order:focus {
    outline: 2px solid #EE1C23;
    outline-offset: 2px;
}

/* SUCCESS STATES */
.msc-form-row input.success,
.msc-form-row select.success {
    border-color: #28a745;
    background-color: #f8fff8;
}

/* FOCUS ENHANCEMENTS */
.msc-form-row input:focus,
.msc-form-row select:focus {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(238, 28, 35, 0.1);
}

/* SMOOTH TRANSITIONS */
.msc-form-row input,
.msc-form-row select,
.msc-next-btn,
.msc-prev-btn,
#place_order,
.msc-delivery-fields {
    transition: all 0.3s ease;
}

/* IMPROVED SPACING */
.msc-stage h3 {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
    color: #333;
    font-size: 24px;
}

/* ENHANCED HOVER EFFECTS */
.msc-form-row input:hover:not(:disabled),
.msc-form-row select:hover:not(:disabled) {
    border-color: #EE1C23;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* PRINT STYLES */
@media print {

    .msc-navigation,
    .msc-error-message {
        display: none !important;
    }

    .msc-stage {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Hide the default shipping method */
.woocommerce-shipping-totals {
    /* display: none; */
}

/* Payment method specific styling */
.msc-payment-note {
    background: #fff;
    /* padding: 15px; */
    /* border-radius: 6px; */
    margin-bottom: 20px;
    /* border-left: 4px solid #17a2b8; */
    border: 1px solid #e9ecef;
    margin-top: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-left: 4px solid #EE1C23;
    border-radius: 4px;
}

.msc-payment-note p {
    margin: 0;
    color: #666;
    font-style: italic;
}

.msc-payment-note small {
    font-size: 13px;
}

.payment_methods {
    margin-bottom: 20px;
}

.payment_methods .payment_method_cod label {
    font-weight: 600;
}

.payment_methods .payment_box {
    margin-top: 10px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.woocommerce-error {
    background: #fee;
    border: 1px solid #dc3232;
    border-radius: 4px;
    padding: 15px;
    margin: 15px 0;
}

.woocommerce-error p {
    margin: 0;
    color: #dc3232;
}

/* Collection payment method specific styling */
.payment_method_collection {
    background: #e8f5e8 !important;
    border-color: #28a745 !important;
}

.payment_method_collection label {
    color: #28a745 !important;
}

/* Payment methods container */
.msc-payment-methods .payment_methods {
    background: #fff;
    border-radius: 6px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.msc-payment-methods .payment_methods>div {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.msc-payment-methods .payment_methods>div:hover {
    border-color: #EE1C23;
    background-color: #fafafa;
}

.stanbic-payment-image {
    text-align: center;
    margin: 15px 0;
}

.stanbic-payment-image img {
    max-width: 300px;
    height: auto;
    display: inline-block;
}

.payment_method_cod {
    margin: 10px 0;
}

.payment_method_ngenius {
    margin: 40px 0;
}

#msc-payment-methods-container>div>div>label>img {
    display: none;
}