﻿/* One address at a time, with a separate delivery form only when requested. */
.unified-address-flow > .row > .columns { display: flow-root; float: none; width: 100%; max-width: 52rem; }
.unified-address-flow #delivery-address-container { clear: both; }
.address-type-options { margin: 0 0 1rem; padding: .75rem 1rem; border: 1px solid #d0dce2; border-radius: 4px; }
.address-type-options legend { width: auto; padding: 0 .25rem; font-size: .9375rem; font-weight: 600; }
.address-type-options input[type=radio] { width: 18px; height: 18px; margin: 0 .375rem 0 0; vertical-align: middle; }
.address-type-options label { display: inline-block; margin: 0 1.25rem 0 0; min-height: 32px; line-height: 32px; }

/* Keep nested Foundation rows from adding 20px of padding around every field. */
.customer-address-fields > .row.mb-2,
.new-suite-account .new-suite-field {
    display: grid;
    grid-template-columns: minmax(9rem, 32%) minmax(0, 1fr);
    gap: 0 1rem;
    align-items: start;
    width: 100%;
    margin: 0 0 .75rem;
    padding: 0;
}
.customer-address-fields > .row.mb-2::before,
.customer-address-fields > .row.mb-2::after { display: none; }
.customer-address-fields > .row.mb-2 > .columns {
    float: none;
    width: 100%;
    min-width: 0;
    padding: 0;
}
.customer-address-fields .right-label,
.new-suite-account .new-suite-field > label {
    display: block;
    float: none;
    margin: 0;
    padding: .625rem 0 0;
    text-align: left;
    line-height: 1.5;
}
.customer-address-fields input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
.customer-address-fields select,
.new-suite-account .new-suite-field input {
    width: 100%;
    min-width: 0;
    height: 44px;
    margin: 0;
    padding: .5rem .75rem;
    font-size: .9375rem;
    line-height: 1.5;
    box-sizing: border-box;
}
.customer-address-fields select[name$="Title"] { max-width: 7rem; }
.new-suite-account .new-suite-field > div { min-width: 0; }
.new-suite-account .new-suite-field textarea { width: 100%; min-height: 72px; margin: 0; }
.customer-address-fields .address-field-error,
.customer-address-fields .field-validation-error,
.new-suite-account [data-valmsg-for] { white-space: normal; overflow-wrap: anywhere; }
.new-suite-account { margin: 0 0 1.5rem; }
.new-suite-account .signup-marketing-choice {
    display: flex;
    align-items: center;
    gap: .75rem;
    min-height: 44px;
    margin-top: .25rem;
}
.new-suite-account .signup-marketing-choice input[type=checkbox] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #316277;
}
.new-suite-account .signup-marketing-choice label {
    flex: 1;
    margin: 0;
    padding: .5rem 0;
    line-height: 1.5;
    cursor: pointer;
}

/* Shared by return addresses, invoice/concierge addresses and saved-address editors. */
@media only screen and (max-width: 40em) {
    .customer-address-form .row,
    .customer-address-fields .row { margin-left: 0; margin-right: 0; padding: 0; }
    .customer-address-fields .row > .columns,
    .customer-address-form .EditRecord .columns { float: none; width: 100%; padding-left: 0; padding-right: 0; }
    .customer-address-fields .row.mb-2 { margin-bottom: .5rem; }
    .customer-address-fields > .row.mb-2,
    .new-suite-account .new-suite-field { grid-template-columns: minmax(0, 1fr); gap: .375rem; }
    .customer-address-fields .right-label,
    .customer-address-form label.inline,
    .new-suite-account .new-suite-field > label { display: block; float: none !important; text-align: left; margin: 0 0 .375rem; padding: 0; line-height: 1.4; }
    .customer-address-fields input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    .customer-address-fields select, .customer-address-fields textarea,
    .customer-address-form .EditRecord input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    .customer-address-form .EditRecord textarea { font-size: 1rem; margin-bottom: .625rem; }
    .customer-address-fields input:not([type=checkbox]):not([type=radio]):not([type=hidden]),
    .customer-address-fields select,
    .new-suite-account .new-suite-field input,
    .new-suite-account .new-suite-field textarea { font-size: 1rem; margin-bottom: 0; }
    .customer-address-form .EditRecord { width: 100%; }
    .customer-address-form .EditRecord td { white-space: normal; padding: .375rem 0; }
    .customer-address-form .EditRecord .columns { margin-bottom: .25rem; }
    .customer-address-form .address-container { margin-right: 0 !important; }
    .customer-address-fields .address-field-error,
    .customer-address-fields .field-validation-error { white-space: normal; overflow-wrap: anywhere; }
}

/* A single address stays compact; paired addresses share the available desktop width. */
#buildInvoiceForm.customer-address-form {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto 1.5rem;
    padding: 0 1.5rem 1.5rem;
    box-sizing: border-box;
}
#buildInvoiceForm.customer-address-form > .row,
#buildInvoiceForm.customer-address-form .address-container > .row { margin-left: 0; margin-right: 0; padding: 0; }
#buildInvoiceForm.customer-address-form > .row > .columns,
#buildInvoiceForm.customer-address-form .display-address { padding: 0; }
#buildInvoiceForm.customer-address-form > .invoice-address-columns > .columns { display: flow-root; float: none; width: 100%; max-width: none; min-width: 0; }
#buildInvoiceForm.customer-address-form .address-container { margin-right: 0 !important; }
#buildInvoiceForm.customer-address-form .address-heading,
#buildInvoiceForm.customer-address-form > .invoice-address-columns > .columns > h4 { margin: 0 0 .75rem; }
#buildInvoiceForm.customer-address-form .address-selector { max-width: 100%; margin-bottom: .75rem; }
#buildInvoiceForm.customer-address-form .address-container > .row { margin-bottom: .75rem; }
#buildInvoiceForm.customer-address-form .address-container > .row.margin-bottom { margin-bottom: .75rem !important; }
#buildInvoiceForm.customer-address-form .address-container .button { min-height: 44px; margin: 0; font-size: .875rem; }
#buildInvoiceForm.customer-address-form #delivery-address-container { margin-top: 1rem; }
#buildInvoiceForm.customer-address-form #delivery-same-container { margin: 0 0 1rem; padding: 0; font-size: .9375rem; font-weight: 600; }
#buildInvoiceForm.customer-address-form #btn-invoice-addresses-continue { min-height: 44px; margin: .5rem 0 0; }
#buildInvoiceForm.customer-address-form .address-choice-row { display: flex; align-items: center; gap: .75rem; clear: both; padding: 0; margin: 0 0 .75rem; }
#buildInvoiceForm.customer-address-form .address-choice-row > .columns { float: none; width: auto; padding: 0; }
.customer-address-form .address-choice-row > .columns:first-child { flex: 0 0 20px; }
.customer-address-form .address-choice-row > .columns:last-child { flex: 1; min-width: 0; }
.customer-address-form .address-choice-row label { margin: 0; line-height: 1.5; }
.customer-address-form .address-choice-row .checkbox { margin: 0; }
/* Use the native checked/disabled state instead of the legacy offset pseudo-element tick. */
.customer-address-form .address-choice-row .checkbox { border: 0; border-radius: 0; background: transparent; }
.customer-address-form .address-choice-row .checkbox input[type=checkbox] { display: block; position: static; appearance: auto; -webkit-appearance: checkbox; width: 20px; height: 20px; margin: 0; opacity: 1; accent-color: #316277; cursor: pointer; }
.customer-address-form .address-choice-row .checkbox input[type=checkbox]:disabled { cursor: default; }
.customer-address-form .address-choice-row .checkbox > label { display: none; }
.customer-address-form .address-choice-row::before,
.customer-address-form .address-choice-row::after { display: none; }
@media only screen and (max-width: 40em) {
    #buildInvoiceForm.customer-address-form { padding-left: 1rem; padding-right: 1rem; }
    .invoice-address-page-heading { padding: .25rem 1rem .75rem; }
}

/* Use equal billing and delivery columns throughout the shared address views. */
@media only screen and (min-width: 48em) {
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address { max-width: 76rem; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address > .invoice-address-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address > .invoice-address-columns::before,
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address > .invoice-address-columns::after { display: none; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address > .invoice-address-columns > .columns { display: flow-root; float: none; width: 100%; max-width: none; min-width: 0; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address #delivery-address-container { margin-top: 0; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address #delivery-same-container { grid-column: 1 / -1; }
    #buildInvoiceForm.customer-address-form.has-separate-delivery-address .new-suite-account { max-width: 39rem; margin-left: auto; margin-right: auto; }
}

/* Address dialogs stay above page controls and fit the viewport after a resize. */
.address-entry-modal.skypax-modal { z-index: 10000000; padding: 1rem; box-sizing: border-box; }
.address-entry-modal.skypax-modal.active,
.address-entry-modal.skypax-modal.closing { height: 100vh; height: 100dvh; }
.address-entry-modal .modal-dialog.modal-lg { width: 100%; max-width: 42rem; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); margin: 0 auto; padding: 1rem; box-sizing: border-box; }
