/* Modern address book UI for account.php. */

#addresses-section.address-book {
    --address-brand: #078b54;
    --address-brand-dark: #056b41;
    --address-brand-soft: #edf9f3;
    --address-ink: #17251e;
    --address-muted: #748179;
    --address-border: #e1e9e4;
    --address-surface: #fff;
    --address-shadow: 0 12px 30px rgba(26,61,43,.07);
    color: var(--address-ink);
}

#addresses-section .address-book-hero {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 23px 25px;
    border-radius: 20px;
    color: #fff;
    background:
        radial-gradient(circle at 88% 18%, rgba(255,255,255,.16), transparent 28%),
        linear-gradient(135deg,#057447 0%,#0a9258 58%,#13a667 100%);
    box-shadow: 0 16px 38px rgba(7,139,84,.16);
}

#addresses-section .address-book-hero-icon {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: rgba(255,255,255,.14);
    font-size: 22px;
}

#addresses-section .address-book-hero-copy {
    min-width: 0;
    flex: 1;
}

#addresses-section .address-book-eyebrow {
    display: block;
    margin-bottom: 3px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
    opacity: .84;
}

#addresses-section .address-book-hero h4 {
    margin: 0 0 4px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: -.35px;
}

#addresses-section .address-book-hero p {
    margin: 0;
    color: rgba(255,255,255,.82);
    font-size: 13px;
    line-height: 1.5;
}

#addresses-section .address-book-add-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 43px;
    padding: 0 15px;
    border: 1px solid rgba(255,255,255,.24);
    border-radius: 12px;
    color: #fff;
    background: rgba(255,255,255,.12);
    font-size: 12px;
    font-weight: 800;
    transition: background .2s ease, transform .2s ease, border-color .2s ease;
}

#addresses-section .address-book-add-btn:hover,
#addresses-section .address-book-add-btn:focus {
    color: #fff;
    border-color: rgba(255,255,255,.42);
    background: rgba(255,255,255,.2);
    transform: translateY(-1px);
}

#addresses-section .address-book-panel {
    padding: 21px;
    border: 1px solid var(--address-border);
    border-radius: 18px;
    background: var(--address-surface);
    box-shadow: var(--address-shadow);
}

#addresses-section .address-book-panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 17px;
}

#addresses-section .address-book-panel-kicker {
    color: var(--address-brand);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .75px;
    text-transform: uppercase;
}

#addresses-section .address-book-panel-heading h5 {
    margin: 2px 0 0;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -.2px;
}

#addresses-section .address-book-panel-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    flex: 0 0 40px;
    border-radius: 12px;
    color: var(--address-brand);
    background: var(--address-brand-soft);
}

#addresses-section .address-book-loading {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--address-muted);
    font-size: 12px;
}

#addresses-section .address-book-loading .spinner-border {
    color: var(--address-brand);
}

#addresses-section .address-book-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 14px;
}

#addresses-section .address-book-card {
    position: relative;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--address-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 6px 18px rgba(26,61,43,.045);
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

#addresses-section .address-book-card:hover {
    transform: translateY(-2px);
    border-color: #c9ddd2;
    box-shadow: 0 11px 25px rgba(26,61,43,.08);
}

#addresses-section .address-book-card.is-default {
    border-color: #8ec7aa;
    background: linear-gradient(180deg,#fbfffd,#fff);
}

#addresses-section .address-book-card.is-default::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg,#078b54,#13a667);
}

#addresses-section .address-book-card-top {
    padding: 15px 15px 12px;
}

#addresses-section .address-book-card-title {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

#addresses-section .address-book-card-icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--address-brand);
    background: var(--address-brand-soft);
}

#addresses-section .address-book-card-title > div:last-child {
    min-width: 0;
    flex: 1;
}

#addresses-section .address-book-title-line {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

#addresses-section .address-book-title-line h6 {
    margin: 0;
    min-width: 0;
    color: var(--address-ink);
    font-size: 14px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

#addresses-section .address-book-default-badge,
#addresses-section .address-book-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 750;
    white-space: nowrap;
}

#addresses-section .address-book-default-badge {
    padding: 4px 7px;
    color: #087448;
    background: #e7f7ef;
}

#addresses-section .address-book-type-badge {
    margin-top: 5px;
    padding: 3px 7px;
    color: #607169;
    background: #f0f4f2;
}

#addresses-section .address-book-card-body {
    flex: 1;
    padding: 0 15px 14px;
}

#addresses-section .address-book-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    padding: 11px 0;
    border-top: 1px solid #edf2ef;
    border-bottom: 1px solid #edf2ef;
}

#addresses-section .address-book-contact-item {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 7px;
    color: #475950;
    font-size: 11px;
    font-weight: 650;
}

#addresses-section .address-book-contact-item i,
#addresses-section .address-book-address i,
#addresses-section .address-book-note i {
    width: 14px;
    flex: 0 0 14px;
    color: #809087;
    text-align: center;
}

#addresses-section .address-book-address,
#addresses-section .address-book-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 11px;
    color: #68776f;
    font-size: 11px;
    line-height: 1.55;
}

#addresses-section .address-book-address span,
#addresses-section .address-book-note span {
    min-width: 0;
    overflow-wrap: anywhere;
}

#addresses-section .address-book-note {
    padding: 8px 9px;
    border-radius: 9px;
    color: #7c7569;
    background: #faf8f3;
    font-size: 10px;
}

#addresses-section .address-book-actions {
    display: flex;
    gap: 6px;
    padding: 11px 13px 13px;
    border-top: 1px solid #edf2ef;
    background: #fbfcfb;
}

#addresses-section .address-book-action {
    min-width: 0;
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 36px;
    padding: 0 8px;
    border-radius: 10px;
    background: #fff;
    font-size: 10px;
    font-weight: 750;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

#addresses-section .address-book-action-edit {
    border: 1px solid #d5dfda;
    color: #526159;
}

#addresses-section .address-book-action-edit:hover {
    border-color: #9fcab2;
    color: var(--address-brand);
    background: #f3faf6;
}

#addresses-section .address-book-action-default {
    border: 1px solid #d8c78e;
    color: #8a6a11;
}

#addresses-section .address-book-action-default:hover {
    border-color: #c6a74c;
    color: #76580c;
    background: #fff9e7;
}

#addresses-section .address-book-action-delete {
    border: 1px solid #eed3d3;
    color: #b34c4c;
}

#addresses-section .address-book-action-delete:hover {
    border-color: #dda7a7;
    color: #a13636;
    background: #fff6f6;
}

#addresses-section .address-book-empty {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 28px 16px;
    border: 1px dashed #ceddd5;
    border-radius: 15px;
    color: var(--address-muted);
    text-align: center;
    background: #fafdfb;
}

#addresses-section .address-book-empty-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin-bottom: 3px;
    border-radius: 17px;
    color: var(--address-brand);
    background: var(--address-brand-soft);
    font-size: 25px;
}

#addresses-section .address-book-empty strong {
    color: #405048;
    font-size: 14px;
}

#addresses-section .address-book-empty span {
    max-width: 390px;
    font-size: 11px;
    line-height: 1.5;
}

#addresses-section .address-book-empty button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 39px;
    margin-top: 6px;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    color: #fff;
    background: var(--address-brand);
    font-size: 11px;
    font-weight: 750;
}

/* Address add/edit modal follows the same visual language. */
#address-modal .modal-content {
    overflow: hidden;
    border: 0;
    border-radius: 18px;
    box-shadow: 0 22px 60px rgba(20,43,31,.18);
}

#address-modal .modal-header {
    padding: 17px 20px;
    color: #fff;
    border-bottom: 0;
    background: linear-gradient(135deg,#057447,#10a265);
}

#address-modal .modal-header .modal-title {
    font-weight: 800;
}

#address-modal .modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: .9;
}

#address-modal .modal-body {
    padding: 19px 20px;
    background: #fbfcfb;
}

#address-modal .form-label {
    margin-bottom: 6px;
    color: #43544b;
    font-size: 11px;
    font-weight: 750;
}

#address-modal .form-control,
#address-modal .form-select {
    min-height: 43px;
    border: 1px solid #dce6e0;
    border-radius: 11px;
    background-color: #fff;
    box-shadow: none;
}

#address-modal textarea.form-control {
    min-height: 86px;
}

#address-modal .form-control:focus,
#address-modal .form-select:focus {
    border-color: #66b691;
    box-shadow: 0 0 0 3px rgba(7,139,84,.09);
}

#address-modal .modal-footer {
    padding: 13px 20px 17px;
    border-top: 1px solid #edf2ef;
    background: #fff;
}

#address-modal .modal-footer .btn {
    min-height: 40px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 750;
}

#address-modal .modal-footer .btn-primary {
    border-color: var(--address-brand, #078b54);
    background: var(--address-brand, #078b54);
}

@media (max-width: 991.98px) {
    #addresses-section .address-book-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    #addresses-section .address-book-hero {
        align-items: flex-start;
        gap: 12px;
        padding: 18px 16px;
        border-radius: 17px;
    }

    #addresses-section .address-book-hero-icon {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 13px;
        font-size: 19px;
    }

    #addresses-section .address-book-hero h4 {
        font-size: 20px;
    }

    #addresses-section .address-book-hero p {
        font-size: 11px;
    }

    #addresses-section .address-book-add-btn {
        width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 12px;
    }

    #addresses-section .address-book-add-btn span {
        display: none;
    }

    #addresses-section .address-book-panel {
        padding: 16px;
        border-radius: 16px;
    }

    #addresses-section .address-book-card-top {
        padding: 14px 13px 11px;
    }

    #addresses-section .address-book-card-body {
        padding: 0 13px 12px;
    }

    #addresses-section .address-book-contact {
        display: grid;
        gap: 7px;
    }

    #addresses-section .address-book-actions {
        display: grid;
        grid-template-columns: repeat(3,minmax(0,1fr));
        padding: 10px 11px 11px;
    }

    #addresses-section .address-book-card.is-default .address-book-actions {
        grid-template-columns: 1fr 1fr;
    }

    #addresses-section .address-book-action {
        min-height: 38px;
        padding: 0 5px;
        font-size: 9px;
    }

    #address-modal .modal-dialog {
        width: calc(100% - 14px);
        max-width: calc(100% - 14px);
        margin: 7px auto;
    }

    #address-modal .modal-content {
        border-radius: 16px;
    }

    #address-modal .modal-header,
    #address-modal .modal-body,
    #address-modal .modal-footer {
        padding-left: 15px;
        padding-right: 15px;
    }
}
