/* Bouqshop Add New Address modal — scoped to #new-address-modal */

.bq-add-address-modal {
    --bq-addr-green: #285d39;
    --bq-addr-green-hover: #214d30;
    --bq-addr-green-soft: #edf4e9;
    --bq-addr-pin: #315f43;
    --bq-addr-text: #252a2d;
    --bq-addr-muted: #6f7478;
    --bq-addr-border: #d9dcdf;
    --bq-addr-divider: #e8e9e8;
    --bq-addr-error: #b04442;
}

body.bq-add-address-open {
    overflow: hidden;
}

body.bq-add-address-open .modal-backdrop.show {
    background: rgba(18, 22, 20, 0.58);
    opacity: 1;
}

.bq-add-address-modal .bq-add-address-dialog {
    width: min(700px, calc(100vw - 32px));
    max-width: 700px;
    margin: 1.5rem auto;
}

.bq-add-address-modal .bq-add-address-card {
    border: 0;
    border-radius: 18px;
    background: #fff;
    box-shadow:
        0 24px 70px rgba(15, 23, 42, 0.20),
        0 4px 16px rgba(15, 23, 42, 0.08);
    overflow: hidden;
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
}

.bq-add-address-modal .bq-address-form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: calc(100vh - 48px);
}

.bq-address-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 28px 32px 20px;
    border-bottom: 1px solid var(--bq-addr-divider);
}

.bq-address-modal__heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.bq-address-modal__icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--bq-addr-green-soft);
    color: var(--bq-addr-pin);
}

.bq-address-modal__icon i {
    font-size: 24px;
    line-height: 1;
}

.bq-address-modal__title {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--bq-addr-text);
}

.bq-address-modal__subtitle {
    margin: 4px 0 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--bq-addr-muted);
}

.bq-address-modal__close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    margin: -4px -8px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7175;
    cursor: pointer;
}

.bq-address-modal__close i {
    font-size: 20px;
    line-height: 40px;
}

.bq-address-modal__close:hover,
.bq-address-modal__close:focus {
    background: #f5f6f5;
    color: var(--bq-addr-text);
    outline: none;
}

.bq-address-modal__body {
    padding: 24px 32px 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.bq-address-field {
    margin-bottom: 18px;
}

.bq-address-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--bq-addr-text);
}

.bq-address-form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px 42px;
}

.bq-add-address-modal .area-field:not(.d-none) {
    grid-column: 1 / -1;
}

.bq-add-address-modal .bq-address-input,
.bq-add-address-modal select.bq-address-select {
    width: 100%;
    height: 48px;
    padding: 0 15px;
    border: 1px solid var(--bq-addr-border);
    border-radius: 9px;
    background: #fff;
    font-size: 15px;
    color: #2e3336;
    box-shadow: none;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.bq-add-address-modal textarea.bq-address-input {
    height: auto;
    min-height: 80px;
    padding: 14px 15px;
    resize: vertical;
}

.bq-add-address-modal .bq-address-input::placeholder,
.bq-add-address-modal textarea.bq-address-input::placeholder {
    color: #858b90;
    opacity: 1;
}

.bq-add-address-modal .bq-address-input:focus,
.bq-add-address-modal select.bq-address-select:focus {
    border-color: var(--bq-addr-pin);
    box-shadow: 0 0 0 3px rgba(49, 95, 67, 0.10);
    outline: none;
}

.bq-address-select-wrap {
    position: relative;
}

.bq-address-select-wrap::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 16px;
    width: 8px;
    height: 8px;
    margin-top: -6px;
    border-right: 1.5px solid #6f7478;
    border-bottom: 1.5px solid #6f7478;
    transform: rotate(45deg);
    pointer-events: none;
}

.bq-add-address-modal select.bq-address-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: none;
}

.bq-phone-control {
    display: flex;
    align-items: stretch;
    min-height: 48px;
    border: 1px solid var(--bq-addr-border);
    border-radius: 9px;
    background: #fff;
    overflow: hidden;
    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.bq-phone-control:focus-within {
    border-color: var(--bq-addr-pin);
    box-shadow: 0 0 0 3px rgba(49, 95, 67, 0.10);
}

.bq-add-address-modal .bq-phone-control .iti {
    width: 100%;
    display: block;
}

.bq-add-address-modal .bq-phone-control .bq-address-input,
.bq-add-address-modal .bq-phone-control input[type="tel"] {
    height: 48px;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
}

.bq-add-address-modal .bq-phone-control .iti__flag-container {
    height: 48px;
}

.bq-add-address-modal .bq-phone-control .iti__selected-flag {
    height: 48px;
    padding: 0 10px 0 12px;
    background: transparent;
    border-right: 1px solid #e6e8ea;
}

.bq-add-address-modal .bq-phone-control .iti__selected-dial-code {
    font-size: 15px;
    color: #2e3336;
}

.bq-address-field.is-invalid .bq-address-input,
.bq-address-field.is-invalid .bq-address-select,
.bq-address-field.is-invalid .bq-phone-control {
    border-color: var(--bq-addr-error);
}

.bq-field-error {
    display: none;
    margin-top: 6px;
    font-size: 13px;
    color: var(--bq-addr-error);
}

.bq-address-field.is-invalid .bq-field-error {
    display: block;
}

.bq-default-address {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin: 6px 0 10px;
    cursor: pointer;
}

.bq-default-address input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    accent-color: var(--bq-addr-green);
    cursor: pointer;
}

.bq-default-address strong {
    display: block;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--bq-addr-pin);
}

.bq-default-address small {
    display: block;
    margin-top: 2px;
    font-size: 13px;
    color: #7b8185;
}

.bq-address-map {
    margin: 4px 0 16px;
}

.bq-address-map #map {
    height: 180px;
    margin: 10px 0;
    border-radius: 9px;
    overflow: hidden;
}

.bq-address-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
    margin-top: 8px;
    padding: 18px 32px 24px;
    border-top: 1px solid var(--bq-addr-divider);
}

.bq-address-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    border-radius: 7px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.bq-address-btn--secondary {
    background: #fff;
    border: 1px solid #d6dadd;
    color: var(--bq-addr-text);
}

.bq-address-btn--secondary:hover,
.bq-address-btn--secondary:focus {
    background: #f7f8f7;
    border-color: #c7cbce;
    color: var(--bq-addr-text);
}

.bq-address-btn--primary {
    min-width: 168px;
    padding: 0 26px;
    background: var(--bq-addr-green);
    border: 1px solid var(--bq-addr-green);
    color: #fff;
}

.bq-address-btn--primary:hover,
.bq-address-btn--primary:focus {
    background: var(--bq-addr-green-hover);
    border-color: var(--bq-addr-green-hover);
    color: #fff;
}

.bq-address-btn--primary:disabled {
    opacity: 0.8;
    cursor: wait;
}

.bq-save-address-icon {
    font-size: 16px;
    line-height: 1;
}

.bq-address-btn-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bq-addr-spin 0.7s linear infinite;
}

.bq-address-btn--primary.is-saving .bq-save-address-icon {
    display: none;
}

.bq-address-btn--primary.is-saving .bq-address-btn-spinner {
    display: inline-block;
}

@keyframes bq-addr-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 700px) {
    .bq-add-address-modal .bq-add-address-dialog {
        width: calc(100vw - 24px);
        max-width: none;
        margin: 12px auto;
    }

    .bq-add-address-modal .bq-add-address-card,
    .bq-add-address-modal .bq-address-form {
        max-height: calc(100dvh - 24px);
        border-radius: 15px;
    }

    .bq-address-modal__header {
        padding: 20px 20px 16px;
    }

    .bq-address-modal__icon {
        width: 48px;
        height: 48px;
    }

    .bq-address-modal__title {
        font-size: 24px;
    }

    .bq-address-modal__body {
        padding: 20px 20px 8px;
    }

    .bq-address-form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .bq-address-modal__footer {
        padding: 16px 20px 20px;
    }

    .bq-add-address-modal .bq-address-input,
    .bq-add-address-modal select.bq-address-select,
    .bq-add-address-modal .bq-phone-control input[type="tel"] {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .bq-address-modal__heading {
        gap: 12px;
    }

    .bq-address-modal__footer {
        flex-direction: column-reverse;
        gap: 10px;
    }

    .bq-address-btn {
        width: 100%;
    }
}
