/* === Innova Core Checkout CSS === */

/* Page: single column */
.woocommerce-checkout .innova-main,
.woocommerce-checkout main {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

/* Force form to 2-column layout using flexbox */
.woocommerce-checkout .woocommerce-billing-fields,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 0 1rem !important;
}
.woocommerce-checkout .woocommerce-billing-fields .form-row,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    float: none !important;
    clear: none !important;
    margin-right: 0 !important;
}
.woocommerce-checkout .woocommerce-billing-fields .form-row-wide,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row-wide {
    flex: 0 0 100% !important;
}

/* Fields that span both columns */
.woocommerce-checkout .form-row-wide {
    flex: 0 0 100% !important;
}

/* Section headers span both columns */
.woocommerce-checkout .inn-section {
    flex: 0 0 100% !important;
}

/* Gift, scheduling, date, time full width */
.woocommerce-checkout #is_present_field,
.woocommerce-checkout #billing_scheduled_delivery_field,
.woocommerce-checkout #billing_date_field,
.woocommerce-checkout #billing_time_field {
    flex: 0 0 100% !important;
}

/* Gift recipient fields */
.woocommerce-checkout #billing_recipient_field {
    grid-column: 1 !important;
}
.woocommerce-checkout #billing_recipient_phone_field {
    grid-column: 2 !important;
}
.woocommerce-checkout #billing_msg_field {
    flex: 0 0 100% !important;
}

/* Make inputs fill their container */
.woocommerce-checkout .form-row .woocommerce-input-wrapper,
.woocommerce-checkout .form-row input[type="text"],
.woocommerce-checkout .form-row input[type="email"],
.woocommerce-checkout .form-row input[type="tel"],
.woocommerce-checkout .form-row input[type="date"],
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.woocommerce-checkout .form-row .woocommerce-input-wrapper {
    display: block !important;
    width: 100% !important;
}

/* Section headers styling */
.inn-section {
    margin-top: 2rem;
    border-bottom: 2px solid #5b0f14;
    padding-bottom: 0.5rem;
    color: #5b0f14;
    font-family: "Playfair Display", serif;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Highlight number field */
#billing_number {
    border-color: #FF9601 !important;
    border-width: 2px !important;
}

/* Datepicker: opaque background */
#ui-datepicker-div.ui-datepicker {
    background: #fff !important;
    opacity: 1 !important;
    border: 1px solid #5b0f14 !important;
    border-radius: 4px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
    z-index: 9999 !important;
}

/* Datepicker blocked date */
.inn-blocked-date {
    background: #fee !important;
    color: #c00 !important;
}

/* Hide additional info, coupon */
.woocommerce-additional-fields,
.woocommerce-form-coupon-toggle {
    display: none !important;
}

/* Hide "Ship to a different address?" — Innova always ships to customer address */
#ship-to-different-address,
.woocommerce-shipping-fields {
    display: none !important;
}

/* Hide "(opcional)" from gift fields labels */
#billing_recipient_field .optional,
#billing_recipient_phone_field .optional,
#billing_msg_field .optional {
    display: none !important;
}

/* Responsive: single column on mobile */
@media (max-width: 768px) {
    .woocommerce-checkout .woocommerce-billing-fields,
    .woocommerce-checkout .woocommerce-billing-fields__field-wrapper,
    .woocommerce-checkout .form-row {
        flex: 0 0 100% !important;
        grid-template-columns: 1fr !important;
    }
}
/* Force input width with higher specificity */
.woocommerce-checkout form.checkout .form-row .woocommerce-input-wrapper {
    width: 100% !important;
    display: block !important;
}
.woocommerce-checkout form.checkout .form-row .woocommerce-input-wrapper input,
.woocommerce-checkout form.checkout .form-row .woocommerce-input-wrapper textarea,
.woocommerce-checkout form.checkout .form-row .woocommerce-input-wrapper select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Force Data and Scheduled to wide */
.woocommerce-checkout #billing_date_field,
.woocommerce-checkout #billing_scheduled_delivery_field {
    flex: 0 0 100% !important;
}



/* Force form-row to fill flex space */
.woocommerce-checkout .woocommerce-billing-fields .form-row,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row {
    min-width: 0 !important;
    box-sizing: border-box !important;
    width: auto !important;
}
.woocommerce-checkout .woocommerce-billing-fields .form-row.form-row-first,
.woocommerce-checkout .woocommerce-billing-fields .form-row.form-row-last,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row.form-row-first,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row.form-row-last {
    flex: 0 0 calc(50% - 0.5rem) !important;
    min-width: 0 !important;
}
.woocommerce-checkout .woocommerce-billing-fields .form-row.form-row-wide,
.woocommerce-checkout .woocommerce-billing-fields__field-wrapper .form-row.form-row-wide {
    flex: 0 0 100% !important;
}

/* === Fix customer_details width === */
.woocommerce-checkout #customer_details.col2-set {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
}

/* === Fix labels === */
.woocommerce-checkout .woocommerce-billing-fields label,
.woocommerce-checkout .woocommerce-shipping-fields label {
    margin-bottom: 0 !important;
    font-weight: 400 !important;
    font-size: 0.8em !important;
}

/* === Fix checkbox inline with text === */
.woocommerce-checkout #is_present_field .woocommerce-input-wrapper,
.woocommerce-checkout #billing_scheduled_delivery_field .woocommerce-input-wrapper {
    display: inline !important;
    width: auto !important;
}
.woocommerce-checkout #is_present_field label.checkbox,
.woocommerce-checkout #billing_scheduled_delivery_field label.checkbox {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}
.woocommerce-checkout #is_present_field input[type=checkbox],
.woocommerce-checkout #billing_scheduled_delivery_field input[type=checkbox] {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    display: inline-block !important;
}

/* === Fix hidden field width === */
.woocommerce-checkout #inn_is_gift {
    width: auto !important;
    max-width: none !important;
}

/* === Widen main container === */
.woocommerce-checkout .innova-main,
.woocommerce-checkout main {
    max-width: 100% !important;
    width: 100% !important;
}

/* === Datepicker styling === */
.ui-datepicker {
    padding: 16px !important;
    background: #fff !important;
    border: 1px solid #5b0f14 !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important;
}
.ui-datepicker .ui-datepicker-header {
    padding: 8px 0 !important;
    border: none !important;
    background: transparent !important;
}
.ui-datepicker .ui-datepicker-title {
    font-weight: 600 !important;
    color: #5b0f14 !important;
}
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    position: absolute !important;
    top: 16px !important;
    display: block !important;
    width: 32px !important;
    height: 32px !important;
    line-height: 32px !important;
    background: #5b0f14 !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    text-align: center !important;
    text-decoration: none !important;
    overflow: hidden !important;
    z-index: 10 !important;
}
.ui-datepicker .ui-datepicker-prev { left: 16px !important; }
.ui-datepicker .ui-datepicker-next { right: 16px !important; }
.ui-datepicker .ui-datepicker-prev .ui-icon,
.ui-datepicker .ui-datepicker-next .ui-icon {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}
.ui-datepicker .ui-datepicker-prev:after {
    content: "◀" !important;
    color: #fff !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}
.ui-datepicker .ui-datepicker-next:after {
    content: "▶" !important;
    color: #fff !important;
    font-size: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
}
.ui-datepicker .ui-datepicker-calendar th {
    padding: 8px 4px !important;
    color: #5b0f14 !important;
    font-weight: 600 !important;
}
.ui-datepicker .ui-datepicker-calendar td {
    padding: 4px 2px !important;
}
.ui-datepicker .ui-datepicker-calendar td a {
    padding: 8px 10px !important;
    border-radius: 4px !important;
    text-align: center !important;
}
.ui-datepicker .ui-state-default {
    background: #f8f8f8 !important;
    border: none !important;
    color: #333 !important;
}
.ui-datepicker .ui-state-active {
    background: #5b0f14 !important;
    color: #fff !important;
}
.ui-datepicker .ui-state-highlight {
    background: #FF9601 !important;
    color: #fff !important;
    border-radius: 4px !important;
}


/* === Datepicker: center title, give space for buttons === */
.ui-datepicker .ui-datepicker-title {
    text-align: center !important;
    padding: 0 48px !important;
    line-height: 32px !important;
}
.ui-datepicker .ui-datepicker-header {
    position: relative !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
}
