#cod_submit_button {
    background-color: #27ae60;
    color: white;
    font-size: 18px;
    font-weight: bold;
    padding: 14px 28px;
    border-radius: 18px;
    border: none;
    height :55px;
    cursor: pointer;
    margin-bottom: 50px;
    display: inline-block;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease-in-out;
    outline: none;
}

#cod_submit_button:hover {
    background: #20c766;
    transform: scale(1.05);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#cod_submit_button:active {
    transform: scale(0.98);
}

#cod_submit_wrapper {
    text-align: center;
    width: 100%;
    margin-top: 20px;
}

/* Hide labels for all fields inside the billing fields wrapper */
.woocommerce-billing-fields__field-wrapper p label {
    display: none;
}

/* Show the label for the delivery type field */
#billing_delivery_type_field label {
    display: inline-block; /* or block, depending on your layout */
}

/* Container for the delivery type buttons */
#billing_delivery_type_field .woocommerce-input-wrapper {
    display: flex;
    margin-top: 10px;
    justify-content: space-between;
}

/* Hide the default radio buttons */
#billing_delivery_type_field .input-radio {
    display: none;
}

/* Style the labels to look like buttons */
#billing_delivery_type_field .radio {
    display: inline-flex; /* Use inline-flex for button behavior */
    align-items: center; /* Vertically center content */
    justify-content: center; /* Horizontally center content */
    min-height: 65px; /* Adjust this value as needed */
    width: 48%; /* Make both buttons slimmer */
    padding: 8px 0;
    border: 2px solid #959ca1;
    border-radius: 15px;
    background-color: white;
    font-size: 16px;
    font-weight: bold;
    color: #71797E;
    text-align: center;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Style for the selected button */
#billing_delivery_type_field .input-radio:checked + .radio {
    border: 2px solid #28a745;
    border-color: #28a745;
     background-color: white;
    color: #28a745;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.5);
}

/* Hover effect */
#billing_delivery_type_field .radio:hover {
    background-color: #28a745;
    color: #fff;
    border-color: #28a745;
     box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.6);
}

/* Main label style */
#billing_delivery_type_field label {
    width: 100%;
    text-align: center;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 8px;
}

/* Media Queries for Mobile */
@media (max-width: 768px) { /* Adjust breakpoint as needed */
    #billing_delivery_type_field .radio {
        min-height: 60px; /* Adjust for mobile */
        font-size: 14px; /* Adjust font size if needed */
    }
}

/* General field styling */
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row select, 
.woocommerce form .form-row textarea {
    border: 2px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.woocommerce form .form-row label {
    font-weight: bold;
    margin-bottom: 5px;
    display: block;
}

/* Fix alignment for custom half fields */
.custom-half-field {
    width: calc(50% - 4px); /* Use calc to ensure proper spacing */
    float: left;
    margin-right: 8px;
}

.custom-half-field.form-row-last {
    margin-right: 0;
}

/* Clearfix */
.woocommerce .form-row:after {
    content: "";
    display: table;
    clear: both;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .custom-half-field {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Disable input styling */
input[disabled] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

/* Center the cloned place order button */
.place-order-wrapper {
    text-align: center;
    margin-top: 20px;
}


.place-order-wrapper {
    margin-top: 20px;
    text-align: center; /* Center the button, for example */
}

.cloned-place-order {
    /* Custom styling for the cloned button */
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
}
*.woocommerce-billing-fields {
    border: 1px solid #ccc;  /* A light gray border */
    border-radius: 8px;        /* Rounded corners */
    padding: 15px;             /* Optional: some inner spacing */
}
/* Center the button container and add spacing */
.place-order-wrapper {
    text-align: center;
    margin-top: 20px;
}

/* Style for the main Place Order button and its clone */
#place_order,
#place_order_clone,
.cloned-place-order {
    background-color: #0073aa;  /* Blue background */
    color: #ffffff;             /* White text */
    border: none;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    text-transform: uppercase;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Hover effect for a darker background and slight scale-up */
#place_order:hover,
#place_order_clone:hover,
.cloned-place-order:hover {
    background-color: #005177;  /* Darker blue on hover */
    transform: scale(1.03);
}

/* Focus state for accessibility */
#place_order:focus,
#place_order_clone:focus,
.cloned-place-order:focus {
    outline: 2px solid #ffb900;
    outline-offset: 2px;
}

/* Toggle Switch Styles */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
    margin: 0;
}

/* Hide default HTML checkbox */
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

/* The slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: .4s;
    transition: .4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background-color: #2196F3;
}

.switch input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

.switch input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

/* Optional: Add active/inactive text */
.slider:after {
    content: 'OFF';
    color: #000;
    display: block;
    position: absolute;
    transform: translate(-50%,-50%);
    top: 50%;
    left: 70%;
    font-size: 10px;
    font-family: Verdana, sans-serif;
}

.switch input:checked + .slider:after {
    content: 'ON';
    left: 30%;
}

/* Ensure proper spacing in table */
.form-table td {
    vertical-align: middle;
}

/* Override any conflicting styles */
.form-table .switch input[type="checkbox"] {
    display: none;
}

.wilaya-visibility-radio {
    display: inline-flex;
    gap: 15px;
}

.wilaya-visibility-radio label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}

.wilaya-visibility-radio input[type="radio"] {
    margin: 0;
}

.validation-message {
    display: block;
    font-size: 12px;
    
    margin-bottom: 10px;
}

input.error {
    border-color: red !important;
}

.quantity-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
    width: 100%;
    height: 50px;
    border: 2px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
     flex-direction: row-reverse;
}


.quantity-wrapper input[type="number"] {
    flex: 1;
    border: none !important;
    margin: 0 !important;
    padding: 5px !important;
    text-align: center !important;
    font-size: 16px;
    min-width: 50px;
    background: white;
    direction: ltr !important;
}

.quantity-wrapper input[type="number"]::-webkit-outer-spin-button,
.quantity-wrapper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-wrapper button {
    width: 40px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: #28a745 !important;
    color: #333;
    font-size: 18px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}

.quantity-wrapper button:hover {
    background: #01945c !important;
}

.quantity-wrapper button:active {
    background: #01945c !important;
}

/* Remove any conflicting styles */
.quantity-wrapper .qty-btn:first-child,
.quantity-wrapper .qty-btn:last-child {
    border-radius: 0;
}

/* Ensure the wrapper matches other form fields */
.form-row .quantity-wrapper {
    width: 100%;
    box-sizing: border-box;
}


#cod-form,
.woocommerce-billing-fields {
    max-width: 600px;
    margin: 20px auto;
    padding: 10px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-family: Arial, sans-serif;
    direction: rtl;
    text-align: right;
}

#cod-form form input[type='text'],
#cod-form form input[type='number'],
#cod-form form select,
.woocommerce-billing-fields__field-wrapper input[type='text'],
.woocommerce-billing-fields__field-wrapper input[type='number'],
.woocommerce-billing-fields__field-wrapper select {
    width: 100%;
    padding: 12px;
    height: 50px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}


/* Phone field aligned with other RTL fields */
#billing_phone {
    direction: rtl !important;
    text-align: right !important;
}

/* RTL select arrow fix: Move dropdown arrow to the left in RTL forms */
body[dir="rtl"] select,
#cod-form[dir="rtl"] select,
form[dir="rtl"] select {
    direction: rtl;
    text-align: right;
    /* Remove default arrow for custom styling */
    background-position: left 0.75em center !important;
    padding-right: 1em;
    padding-left: 2em;
    /* Hide default arrow for custom styling */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='16' viewBox='0 0 20 20' width='16' xmlns='http://www.w3.org/2000/svg'><path d='M5.516 7.548a.625.625 0 0 1 .884-.088l3.6 3.1 3.6-3.1a.625.625 0 1 1 .796.972l-4 3.444a.625.625 0 0 1-.796 0l-4-3.444a.625.625 0 0 1-.088-.884z'/></svg>");
    background-repeat: no-repeat;
    background-size: 1em;
}

body[dir="rtl"] input[type="tel"],
#cod-form[dir="rtl"] input[type="tel"],
form[dir="rtl"] input[type="tel"] {
    direction: rtl;
    text-align: right;
}

#quantity-input {
    text-align: center !important;
    direction: ltr !important;
}


/* Direction-aware form styling */
.custom-form-wrapper[dir="ltr"] #cod-form,
.custom-form-wrapper[dir="ltr"] .woocommerce-billing-fields {
    direction: ltr;
    text-align: left;
}

.custom-form-wrapper[dir="rtl"] #cod-form,
.custom-form-wrapper[dir="rtl"] .woocommerce-billing-fields {
    direction: rtl;
    text-align: right;
}

/* Input field direction */
.custom-form-wrapper[dir="ltr"] input,
.custom-form-wrapper[dir="ltr"] select,
.custom-form-wrapper[dir="ltr"] textarea {
    direction: ltr;
    text-align: left;
}

.custom-form-wrapper[dir="rtl"] input,
.custom-form-wrapper[dir="rtl"] select,
.custom-form-wrapper[dir="rtl"] textarea {
    direction: rtl;
    text-align: right;
}

/* Select dropdown arrow positioning */
.custom-form-wrapper[dir="ltr"] select {
    background-position: right 0.75em center !important;
    padding-left: 1em;
    padding-right: 2em;
}

.custom-form-wrapper[dir="rtl"] select {
    background-position: left 0.75em center !important;
    padding-right: 1em;
    padding-left: 2em;
}
