/* ── My Addresses module ──────────────────────────────────────────────── */

.my-addresses-wrapper {
    position: relative;
}

/* Notices */
.ma-notices {
    margin-bottom: 16px;
}

.ma-notices:empty {
    margin: 0;
}

.ma-notice {
    padding: 10px 16px;
    border-radius: 4px;
    margin-bottom: 8px;
    font-size: 14px;
}

.ma-notice--success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ma-notice--error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Header bar */
.ma-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

@media (max-width: 575.9px) {
    .ma-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ma-header>* {
        width: 100%;
    }
}

.ma-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
}

/* Address list — single column stack */
.ma-list-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* ── Individual address card ───────────────────────────────────────────── */
.ma-address-card {
    padding: 24px;
    background: #fff;
    border-radius: 8px;
    border: 1px solid var(--Primary-Gray-300, #E2E1E0);
}

.ma-address-card.is-default {
    border-color: #E16F37;
    /* brand orange */
}

/* Card header row: pin+type on left, Delete/Edit on right */
.ma-address-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ma-address-card__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 500;
    line-height: 30px;
}

.ma-pin-icon {
    flex-shrink: 0;
    color: #e07b39;
}

/* Top-right action links */
.ma-address-card__top-actions {
    display: flex;
    gap: 16px;
}

.ma-address-card__top-actions button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-decoration: none;
    text-transform: capitalize;
    color: #777675;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.ma-address-card__top-actions button:hover {
    color: #e07b39;
}

/* Address / phone lines */
.ma-address-card__details {
    margin-bottom: 12px;
    padding-inline-start: 40px;
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
}

.ma-address-card__details p {
    margin: 0;
}

[dir="rtl"] .ma-address-card__phone {
    direction: ltr;
    text-align: end;
}

/* Footer: set-as-default toggle */
.ma-address-card__footer {
    padding-inline-start: 40px;
}

/* Set-as-default button with radio circle */
.ma-set-default-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #555;
    cursor: pointer;
}

.ma-set-default-btn:disabled {
    cursor: default;
}

.ma-set-default-btn__circle {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ccc;
    flex-shrink: 0;
    position: relative;
    transition: border-color 0.15s;
}

/* Filled orange circle when this address is the default */
.ma-set-default-btn.is-active .ma-set-default-btn__circle {
    border-color: #e07b39;
    background: #e07b39;
}

.ma-set-default-btn.is-active .ma-set-default-btn__circle::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Empty state */
.ma-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
    padding: 50px 0px;
    max-width: 357px;
    margin: 0 auto;
}

.ma-empty__icon {
    margin-bottom: 17px;
    line-height: 1;
}

.ma-empty__title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin: 0;
}

.ma-empty__msg {
    color: #777675;
    text-align: center;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    margin: 0;
}

/* Modal field errors (inline spans kept hidden — errors shown at top instead) */
.ma-field-error {
    display: block;
    color: #c0392b;
    font-size: 12px;
    margin-top: 3px;
}

.ma-field-error:empty {
    display: none;
}

/* Error list shown at the top of the modal */
.ma-error-list {
    margin: 0;
    padding-left: 18px;
}

.ma-error-list li {
    margin-bottom: 2px;
}

/* Red border on phone wrapper when invalid */
.ma-phone-wrapper--error {
    border-color: #e3342f !important;
}

/* Modal notices */
.ma-modal-notices {
    margin-bottom: 10px;
}

.ma-modal-notices:empty {
    margin: 0;
}

.myAddressModal .modal-body {
    max-width: 650px;
    width: 100%;
    padding: 32px 32px 0;
    margin: auto;
}

.myAddressModal .gap-3 {
    gap: 1.25rem;
}

.woocommerce-page .myAddressModal .form-row {
    margin-bottom: 20px;
}

.myAddressModal .form-row::before,
.myAddressModal .form-row::after {
    content: none !important;
}

.myAddressModal .form-row .form-group {
    flex: 1;
}

/* Address type radio */
.ma-address-type {
    display: flex;
    gap: 20px;
    align-items: center;
}

.ma-address-type label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    margin: 0;
}

/* Phone field with Egypt flag */
.ma-phone-wrapper {
    display: flex;
    border: 1px solid #e2e1e0;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.ma-phone-wrapper:has(input[readonly]) {
    background: #F0EFED;
    cursor: not-allowed;
}

.ma-phone-prefix {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 14px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 70px;
}

.ma-phone-prefix+.ma-phone-input {
    padding-inline-start: 0 !important;
}

[dir="rtl"] .ma-phone-prefix+.ma-phone-input {
    padding-inline-start: 14px !important;
    padding-inline-end: 0 !important;
    text-align: end;
}

.ma-phone-flag {
    width: 20px;
    height: 16px;
    object-fit: cover;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ma-phone-flag img {
    display: block !important;
    height: 13px !important;
    width: 20px !important;
    object-fit: cover;
    border-radius: 3px;
}

.ma-phone-code {
    --font-family-primary: 'Roboto', sans-serif;
    font-size: 14px;
    color: #a09f9e;
    font-weight: 500;
    font-family: var(--font-family-primary);
}

.ma-phone-input {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    flex: 1;
    min-width: 0;
}

.ma-phone-input:focus {
    box-shadow: none !important;
    outline: none;
}

.ma-phone-wrapper .ma-field-error {
    display: block;
    width: 100%;
    padding: 2px 10px;
}

/* Pagination */
.ma-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #E2E1E0;
    /* matching $gray-300-color */
}

.ma-pagination .btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
}

[dir="rtl"] .ma-pagination .btn {
    transform: scaleX(-1);
}

.ma-btn-icon {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

.ma-page-info {
    font-size: 16px;
    font-weight: 500;
    color: #444342;
    /* matching $gray-800-color */
}