/**
 * Frontend styles for OvoFood Plugin
 */

/* Address List */
.ovofood-wrapper {
    margin: 20px 0;
}

.ovofood-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.ovofood-header h2 {
    margin: 0;
}

.ovofood-list {
    display: flex;
    flex-direction: column;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.ovofood-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    background: #fff;
    transition: box-shadow 0.3s ease;
    position: relative;
}

.ovofood-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ovofood-item.is-default {
    border-color: #2c3e50;
    background: #f8f9fa;
}

.ovofood-item-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
    gap: 10px;
}

.ovofood-item-title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
}

.ovofood-badge-default {
    background: #2c3e50;
    color: #fff;
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 0.85em;
    white-space: nowrap;
}

.ovofood-item-content {
    margin-bottom: 15px;
}

.ovofood-item-content address {
    font-style: normal;
    line-height: 1.6;
    color: #555;
}

.ovofood-item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    position: absolute;
    right: 0;
    top: 0;
}

.ovofood-item-actions .button {
    background: transparent;
    border: 0px;
    padding: 0px;
}

/* Address Form */
.ovofood-form-wrapper {
    max-width: 600px;
    margin: 20px 0;
}

.ovofood-form-wrapper h2 {
    margin-bottom: 20px;
}

.ovofood-form-row {
    margin-bottom: 0;
}

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

.ovofood-form-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.ovofood-form-messages {
    margin-top: 20px;
}

.ovofood-form-messages .woocommerce-message,
.ovofood-form-messages .woocommerce-error {
    margin-bottom: 15px;
}

/* Checkout Address Selector */
.ovofood-checkout-selector {
    background: #f8f9fa;
    border: 2px solid #2c3e50;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
    margin-top: 0;
    clear: both;
    width: 100%;
}

.ovofood-checkout-selector h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.3em;
}

.ovofood-checkout-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.ovofood-checkout-option {
    position: relative;
}

.ovofood-checkout-label {
    display: block;
    padding: 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.ovofood-checkout-label:hover {
    border-color: #2c3e50;
}

.ovofood-checkout-label input[type="radio"] {
    margin-right: 12px;
    vertical-align: middle;
}

.ovofood-checkout-label input[type="radio"]:checked ~ .ovofood-checkout-address {
    font-weight: 600;
}

.ovofood-checkout-label:has(input[type="radio"]:checked) {
    border-color: #2c3e50;
    background: #f8f9fa;
}

.ovofood-checkout-address {
    display: inline-block;
    width: calc(100% - 30px);
    vertical-align: middle;
}

.ovofood-checkout-address-name {
    display: block;
    margin-bottom: 8px;
    font-size: 1.1em;
}

.ovofood-checkout-address-details {
    font-size: 0.95em;
    line-height: 1.6;
    color: #555;
}

.ovofood-badge-default-checkout {
    display: inline-block;
    background: #2c3e50;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    margin-top: 8px;
}

.ovofood-checkout-add-new {
    margin-top: 15px;
    margin-bottom: 0;
    text-align: center;
}

/* Loading State */
.ovofood-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Hide WooCommerce default shipping fields when using custom selector */
.ovofood-hidden-field {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}
.w-30 {
    width: 30px;
}

/* Hide shipping section title and wrapper when user has saved addresses */
body.has-ovofood-addresses .woocommerce-shipping-fields h3,
body.has-ovofood-addresses .woocommerce-shipping-fields__field-wrapper {
    display: none !important;
}

/* Shipping address checkbox is now controlled via backend */

/* Ensure order notes appear after address selector */
body.has-ovofood-addresses .woocommerce-additional-fields {
    margin-top: 20px;
}

/* Style order notes section when address selector is present */
body.has-ovofood-addresses .woocommerce-additional-fields h3 {
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .ovofood-list {
        grid-template-columns: 1fr;
    }

    .ovofood-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .ovofood-item-actions {
        flex-direction: column;
    }


    .ovofood-form-actions {
        flex-direction: column;
    }

    .ovofood-form-actions .button {
        width: 100%;
    }
}


.select2-container .select2-selection--single {
    height: inherit;
}

#billing_guest_user_type_field input[type="radio"] {
    margin: -4px 7px 0px 15px;
}
#billing_guest_user_type_field label {
    margin:0px;
}

#billing_tipo_documento_field > label {
    display: block;
    margin-bottom: 8px;
}
#billing_tipo_documento_field .woocommerce-input-wrapper {
    display: block;
}
#billing_tipo_documento_field .woocommerce-input-wrapper label {
    display: inline-block;
    margin-right: 20px;
    margin-bottom: 0;
}
#billing_tipo_documento_field input[type="radio"] {
    margin-right: 5px;
    vertical-align: middle;
}

.elementor-kit-6 input:focus:not([type="button"]):not([type="submit"]) {
    border: 1px solid #f6c247 !important;
}

.ovofood-guest-rut {
    position: relative;
}

.ovofood-rut-error {
    margin-top: 0em !important;
    position: absolute;
}