/* ===== Address Selection Modal - Fixed UI Styles ===== */

.modal#addressModal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 2147483646;
}

.modal-card {
    position: relative;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
    width: min(500px, 92vw);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    z-index: 2147483647;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #f3f4f6;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close-btn:hover {
    color: #374151;
}

.modal-body {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
    max-height: 60vh;
}

.modal-body input[type="radio"] {
    width: 12px !important;
    height: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid #d1d5db !important;
    background: white !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border-radius: 50% !important;
}

.modal-body input[type="radio"]:checked {
    background: #2f7d32 !important;
    border-color: #2f7d32 !important;
}

.modal-body input[type="radio"]:checked::after {
    content: '' !important;
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 6px !important;
    height: 6px !important;
    border-radius: 50% !important;
    background: white !important;
}

/* Address List - Clean Layout */
.addr-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.addr-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.addr-item:hover {
    border-color: #2f7d32;
    background: #f8fffe;
}

.addr-item.selected {
    border-color: #2f7d32;
    background: #f0f9ff;
    box-shadow: 0 0 0 1px #2f7d32;
}

.addr-radio {
    accent-color: #2f7d32;
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    margin: 0;
    padding: 0;
    border: none;
    outline: none;
    box-sizing: border-box;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    position: relative;
}

.addr-radio:checked {
    background: #2f7d32;
    border-color: #2f7d32;
}

.addr-radio:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: white;
}

.addr-content {
    flex: 1;
    min-width: 0;
}

.addr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.addr-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 15px;
}

.addr-phone {
    color: #6b7280;
    font-size: 13px;
}

.addr-default-tag {
    background: #dcfce7;
    color: #166534;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.addr-full {
    color: #4b5563;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.addr-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.edit-btn {
    background: transparent;
    border: none;
    color: #6b7280;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: underline;
}

.edit-btn:hover {
    background: #2f7d32;
    color: white;
    border-color: #2f7d32;
}

/* Add New Address Button */
.add-new-addr {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    background: #fafafa;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    margin-top: 8px;
}

.add-new-addr:hover {
    border-color: #2f7d32;
    color: #2f7d32;
    background: #f8fffe;
}

.add-icon {
    font-size: 16px;
    font-weight: bold;
}

/* Modal Footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid #f3f4f6;
    background: #fff;
}

.btn {
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn.cancel {
    background: #fff;
    border: 1px solid #d1d5db;
    color: #374151;
}

.btn.cancel:hover {
    background: #f9fafb;
}

.btn.confirm {
    background: #ef4444;
    color: white;
}

.btn.confirm:hover {
    background: #dc2626;
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .modal-card {
        width: 95vw;
        margin: 10px;
    }
    
    .addr-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    
    .addr-phone {
        order: 1;
    }
    
    .addr-default-tag {
        order: 2;
    }
}